473,396 Members | 1,989 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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# VisualStudio2005) 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 1394
En Sat, 17 Nov 2007 12:04:49 -0300, <do********@hotmail.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# VisualStudio2005) 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********@hotmail.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# VisualStudio2005) 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.ar>
wrote:
En Sat, 17 Nov 2007 12:04:49 -0300, <dongarb...@hotmail.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# VisualStudio2005) 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...@websafe.comwrote:
dongarb...@hotmail.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# VisualStudio2005) 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********@hotmail.comwrote:
On Nov 19, 3:49 pm, Larry Bates <larry.ba...@websafe.comwrote:
dongarb...@hotmail.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# VisualStudio2005) 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
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...
0
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:...
13
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
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...
8
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...
0
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...
1
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...
28
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...
2
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...
37
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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,...

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.