views:

1074

answers:

3

Hi,

I am using IronPython studio to create IronPython scripts and convert them into executables. When converted to executables, it creates a Main exe and two dlls (IronMath.dll and IronPython.dll). Is it possible to create the executables without IronPython studio. I tried PYC downloaded from codeplex.com. It creates an exe and a dll with the same name as that of the exe (say main.exe and main.dll). But I need an exe and two dlls (similar to what is created by the IronPython studio). So that I can use other IronPython exes without any separate dlls (these 2 dlls would be enough for any FePy exe).

A: 

I maybe don't understand the question well but copying IronMath.dll and IronPython.dll to the folder with main.exe and main.dll should work for Ironpython 1.x. These .dlls are different for IronPython 2.x.

Edit: Well, I tried PYC with IP 1.1 and it does not work. That means you have to use it with at least IP 2.0.2 (it is located in Samples\pyc folder). For simple script 'print 'hello' you need to ship (along with hello.dll and hello.exe).

  • IronPython.dll
  • Microsoft.Scripting.Core.dll
  • Microsoft.Scripting.dll
  • Microsoft.Scripting.ExtensionAttribute.dll

For more complicated script you will probably need IronPython.Modules.dll as well.

Lukas Cenovsky
Generating executables using PYC and using IronMath.dll and IronPython.dll with them doesn't work. I have tried that.
Prabhu
I have added a new findings.
Lukas Cenovsky
A: 

A DLL is a dynamically linked library. It's required for your application to run properly. All applications written in .NET use them. You just don't know it, because support is built into the .NET framework, which most everyone has installed on their systems. Yay, way to go Microsoft. The DLR (Dynamic Language Runtime) isn't built into any .NET destributable at this time, however (this will change in .NET 4.0). That's why you get the dll file.

Are you writing software that utilizes any .NET libraries? If not, just write it in good 'ol cpython (the way you're supposed to). Then, uou should look into a program called py2exe. Have you ever used uTorrent? I'm assuming you have. It's build using strait up cpython + py2exe.

Enjoy. :)

Kenneth Reitz
Tried using py2exe. Even that generates a 'dist' folder which needs to be redistributed right?? Is there any way to get only a single EXE out of the python script.
Prabhu
py2exe will compile to a single exe, if used correctly.
Kenneth Reitz
Kenneth: Add an answer explaining how to do that completely.
jmucchiello
http://www.py2exe.org/index.cgi/SingleFileExecutable
Kenneth Reitz
+1  A: 

I have created a C# application that uses the IronPython.dll and IronMath.dll to convert the IronPython scripts to executables. This doesn't require IronPython studio to be present. Only the DLLs are enough. The behavior of exe is same as that created by IronPython studio(Integrated with VS2008)

Prabhu