473,729 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

python application dll

Hi,

Is there a way to create a .dll from a python program which includes
the python runtime?

I'm building a Windows application (C# VisualStudio200 5) and I'd like
to utilize some of the functionality available in a Python module. For
my users who install my Windows application, I'd prefer that they not
have to install the entirety of Python on their machines.

Thanks much,
D
Nov 17 '07 #1
5 1417
En Sat, 17 Nov 2007 12:04:49 -0300, <do********@hot mail.comescribi �:
Is there a way to create a .dll from a python program which includes
the python runtime?

I'm building a Windows application (C# VisualStudio200 5) and I'd like
to utilize some of the functionality available in a Python module. For
my users who install my Windows application, I'd prefer that they not
have to install the entirety of Python on their machines.
I think that linking Python directly with C# isn't easy; Python + C++ OTOH
is a lot easier.
Another approach is to have a Python *application* (.exe) running; you may
communicate the two with virtually any available IPC mechanism. You can
use py2exe to generate the .exe

--
Gabriel Genellina

Nov 19 '07 #2
do********@hotm ail.com wrote:
Hi,

Is there a way to create a .dll from a python program which includes
the python runtime?

I'm building a Windows application (C# VisualStudio200 5) and I'd like
to utilize some of the functionality available in a Python module. For
my users who install my Windows application, I'd prefer that they not
have to install the entirety of Python on their machines.

Thanks much,
D
Turn the Python program into a COM object instead. Then it can be dispatched by
any programming language and distributed after bundling with py2exe.

-Larry
Nov 19 '07 #3
On Nov 19, 2:28Â*am, "Gabriel Genellina" <gagsl-...@yahoo.com.a r>
wrote:
En Sat, 17 Nov 2007 12:04:49 -0300, <dongarb...@hot mail.comescribi �:
Is there a way to create a .dll from a python program which includes
the python runtime?
I'm building a Windows application (C# VisualStudio200 5) and I'd like
to utilize some of the functionality available in a Python module. For
my users who install my Windows application, I'd prefer that they not
have to install the entirety of Python on their machines.

I think that linking Python directly with C# isn't easy; Python + C++ OTOHÂ*
is a lot easier.
Another approach is to have a Python *application* (.exe) running; you mayÂ*
communicate the two with virtually any available IPC mechanism. You can Â*
use py2exe to generate the .exe

--
Gabriel Genellina
How do you linke Python directly with C++? This could be a
consideration for me if it is possible to call a C++-based dll from
C#. That leads to my next question which might not be appropriate for
a python newsgroup, but what the heck: Is it possible to call a C++-
based dll from C#?
Nov 20 '07 #4
On Nov 19, 3:49 pm, Larry Bates <larry.ba...@we bsafe.comwrote:
dongarb...@hotm ail.com wrote:
Hi,
Is there a way to create a .dll from a python program which includes
the python runtime?
I'm building a Windows application (C# VisualStudio200 5) and I'd like
to utilize some of the functionality available in a Python module. For
my users who install my Windows application, I'd prefer that they not
have to install the entirety of Python on their machines.
Thanks much,
D

Turn the Python program into a COM object instead. Then it can be dispatched by
any programming language and distributed after bundling with py2exe.

-Larry
OK, I'm a newbie and not sure how to create/call COM objects. This is
probably not a question for a python newsgroup, but what the heck: How
do you turn a python program into a COM object? And, what does it mean
to be "dispatched "?
Nov 20 '07 #5
On Nov 20, 2007 8:12 AM, <do********@hot mail.comwrote:
On Nov 19, 3:49 pm, Larry Bates <larry.ba...@we bsafe.comwrote:
dongarb...@hotm ail.com wrote:
Hi,
Is there a way to create a .dll from a python program which includes
the python runtime?
I'm building a Windows application (C# VisualStudio200 5) and I'd like
to utilize some of the functionality available in a Python module. For
my users who install my Windows application, I'd prefer that they not
have to install the entirety of Python on their machines.
Thanks much,
D
Turn the Python program into a COM object instead. Then it can be dispatched by
any programming language and distributed after bundling with py2exe.

-Larry

OK, I'm a newbie and not sure how to create/call COM objects. This is
probably not a question for a python newsgroup, but what the heck: How
do you turn a python program into a COM object? And, what does it mean
to be "dispatched "?
You're getting in far above your head - these are advanced concepts
and require a fairly detailed low level knowledge of .NET, Python, and
COM.

Firstly, you should be aware that doing this will still require your
users to "install all of Python" on their machine, or at least a large
subset, because you'll need a good portion of the standard library to
do anything useful.

You should look at the python for .NET project and IronPython,
depending on your needs.

Python for .NET is a .NET <-CPython bridge, which will allow you to
create and drive a CPython interpreter from .NET. This instance of
Python will be able to use regular CPython extension modules, as well
as (through the bridge) call back up into .NET code. It requires a
working CPython installation.

IronPython is a pure .NET implementation of Python, and will allow you
have a Python interpreter that can load .NET assemblies, but it won't
be able to load Python C modules. It requires installation like all
..NET libraries do, but no CPython installation - it's a separate
implementation of Python.
Nov 20 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2111
by: Sridhar R | last post by:
Hi, I am a little experienced python programmer (2 months). I am somewhat experienced in C/C++. I am planning (now in design stage) to write an IDE in python. The IDE will not be a simple one. I had an idea of writing the IDE in C/C++, as it is a big project, bcoz of the following 1. if python is used, then the memory required for running the IDE will be high.
0
2535
by: Phillip J. Eby | last post by:
PEP: 333 Title: Python Web Server Gateway Interface v1.0 Version: $Revision: 1.1 $ Last-Modified: $Date: 2004/08/27 17:30:09 $ Author: Phillip J. Eby <pje at telecommunity.com> Discussions-To: Python Web-SIG <web-sig at python.org> Status: Draft Type: Informational Content-Type: text/x-rst Created: 07-Dec-2003
13
3342
by: Ajay | last post by:
hi! can you call a Python application from a Java program? does this require any additional package to be installed? thanks cheers
2
2870
by: Roose | last post by:
With some googling I have found these resources: http://docs.python.org/ext/win-dlls.html http://www.python.org/doc/faq/windows.html I have a large Win32/MFC/C/C++ application that has an embedded scripting language (a very limited one). I would like to rip it out and replace it with Python. I am thinking that this would be relatively simple since the scripting language is a very small interface between the UI and the engine --...
8
446
by: Saravanan | last post by:
Hello, Im running Python Application as a Windows Service (using windows extensions). But, sporadically the application crashes (crash in Python23.dll) and this stops the service. This problem cann't be reproduced easily in my system and the call stack generated by the application is given below. Occurrence: 2005/4/22 23:24:57
0
1597
by: Robby Dermody | last post by:
Hey guys (thus begins a book of a post :), I'm in the process of writing a commercial VoIP call monitoring and recording application suite in python and pyrex. Basically, this software sits in a VoIP callcenter-type environment (complete with agent phones and VoIP servers), sniffs voice data off of the network, and allows users to listen into calls. It can record calls as well. The project is about a year and 3 months in the making and...
1
2379
by: Andrew McCall | last post by:
Hi Folks, I am building an application under multiple OS's, and I wanted to give my application For example, the test application I am working on is a calculator and I would like to have a menu in the GUI option to open a command line where you can use Python commands to perfom the functions of the application within the Python command line. For example, if I wanted to clear the display or display the about screen I would be able type
28
2632
by: H J van Rooyen | last post by:
Hi, I want to write a small system that is transaction based. I want to split the GUI front end data entry away from the file handling and record keeping. Now it seems almost trivially easy using the sockets module to communicate between machines on the same LAN, so that I want to do the record keeping on one machine.
2
2007
by: Michael R. Copeland | last post by:
I have some questions about the suitability of Python for some applications I've developed in C/C++. These are 32 bit Console applications, but they make extensive use of STL structures and functions (Lists, Maps, Vectors, arrays) - primarily because the data volume is high (2,500,000+ records). The main thing I'd like to do is port one part of the system that has a series of user menus and works with several text data files (one _very_...
37
9053
by: Michael Palmer | last post by:
As anyone knows, the state of Python GUI programming is a little fractured at this time, with many toolkits, wrappers and meta-wrappers dead and alive, with or without documentation. I've come across two projects that have the appeal of striving for simple, pythonic APIs: PyGUI and wax. The latter is a wrapper around wxPython. It is lacking documentation but actually quite usable and concise. The other, PyGUI, has an even nicer API and...
0
8763
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9284
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9202
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9148
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8151
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2683
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.