[IronPython] Python Command Line Compiler issues and questions

Patrick O'Brien sum.ergo.code at gmail.com
Mon Jan 1 09:10:37 PST 2007


>
> I've had a play with makeexe.py, it's very nice.
>
> You can compile multiple Python files (including imports) into a single
> executable.
>
> The difficulty we had was with maintaining our package structure. We
> want import semantics like 'from Main.Something import Something', which
>   didn't seem to work with PYC.
>
> It *does* seem to work (initial experiments) with makeexe.py, which is
> cool. (I included the empty 'package/__init__.py' file in the arguments
> to makeexe.py.)


I'm still confused because makeexe doesn't appear to be that different from
PYC.  They both rely on Hosting.PythonCompiler, and while they pass a
different number of arguments to the PythonCompiler, the difference doesn't
seem significant based on my perusal of the PythonCompiler.cs source code.

I'm still not clear on what it means to supply multiple source files to the
PythonCompiler.  Can anyone explain what happens to the other source files?
If imports of those modules are supposed to work directly from the resulting
exe, without the original .py files, I haven't been able to get that to
work.  Hmm, take that back.  I just tried with makeexe.py and it works as
expected - normal python import without having to have the original .py file
available.  So I guess the real question is why this isn't working in PYC.
Sounds like a bug to me...

Thanks, Mark and Michael.  Now I'm much closer to the solution I was hoping
for.

-- 
Patrick K. O'Brien
Orbtech       http://www.orbtech.com
Schevo        http://www.schevo.org
Louie         http://www.pylouie.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20070101/b9d8fa4a/attachment.html 


More information about the users mailing list