473,226 Members | 1,660 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,226 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 1387
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: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.