[IronPython] Another deployment question...
Michael Foord
fuzzyman at voidspace.org.uk
Tue Jul 1 16:26:18 CEST 2008
Bob Rosembob wrote:
> One script that I'm using is a third party code and they would prefere
> me to use the compiled version of it. Is there a way to compile it?
>
You *cannot* use '.pyc' files with IronPython.
With IronPython 1 you can compile Python files into .NET assemblies that
you can import from as if they were Python files (Resolver Systems use
that). You can use the 'Pyc' compiler sample to do this.
There is not yet any equivalent for IronPython 2.
Michael Foord
> Please advise.
>
> Thanks,
> Bob
>
> -----------------------------------------------------------------------
> Bob Rosembob wrote:
> >/ Hi there,
> />/ I have a couple of questions.
> />/
> />/ 1. If I'm using IronPython to call Python function from my C# app.
> />/ What do I need to deploy my project?
> />/
> />/ I added references to my project to the following dlls:
> />/ /IronPython.dlll
> />/ IronMath.dll/
> />/ /
> />/ /
> />/ In the code I'm using the following:
> />/ /using IronPython.Runtime;
> />/ using IronPython.Runtime.Types;
> />/ using IronPython.Runtime.Operations;
> />/ usingIronPython.Hosting;
> />/ using IronPython.Modules;/
> />/ /
> />/ /
> />/ The script imports:
> />/ /string/
> />/ /sys/
> />/ /os/
> />/ /math/
> />/ and other
> />/
> />/ 2. In order to run the script I had to copy imported libraries
> into />/ directory where my exe is. For some reason if I copy the
> compiled
> />/ version of the files (e.g. string.pyc, sys.pyc, etc.) my script won't
> />/ find them. It can see only none-compiled files. Why is it? What
> should />/ I do to be able run all script files (py) as compiled (pyc)?
> /
> Those compiled files are compiled into bytecode for the CPython VM. They
> will never run on the .NET framework.
>
> What is wrong with using the '.py' source files?
>
> Michael
>
>
> >/
> />/ Please advise.
> />/
> />/ Thanks,
> />/ Bob
> />/
> />/
> />/
> ------------------------------------------------------------------------/
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/
http://www.trypython.org/
http://www.ironpython.info/
http://www.resolverhacks.net/
http://wwww.theotherdelia.co.uk/
More information about the Ironpython-users
mailing list