[IronPython] Python Command Line Compiler issues and questions

Dino Viehland dinov at exchange.microsoft.com
Thu Jan 4 23:52:16 CET 2007


I've opened CodePlex bug 7011 for this (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=7011).  Feel free to vote on it to raise its visibility! :).

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord
Sent: Thursday, January 04, 2007 2:39 PM
To: Discussion of IronPython
Subject: Re: [IronPython] Python Command Line Compiler issues and questions

Dino Viehland wrote:
> That works for me, I did it a little differently, but basically the same:
>
> a:
> import b
> print 'hello'
> b.foo()
>
> b:
> print 'goodbye'
> def foo(): print 42
>
>> ipy pyc.py /target:exe /main:a.py b.py
> ...
>
>> a.exe
> goodbye
> hello
> 42
>
> That works even if a.py and b.py aren't available after the compilation.  What I thought wasn't working w/ pyc, but maybe was working w/ the simpler one, was the more complex case involving packages:
>
> a:
> import b.c
> b.c.d()
>
> c\
>                 __init__.py:
>                 d.py:
>                                 def d(): print 42
>
> I can compile a.py w/ c\__init__.py and get something that "works" but it works only if I run it from the directory that contains c.  It works because we just re-compile d.py on the fly.  But removing c causes it to break again.  Unfortunately I don't think the compiler understands packages right now and it's something we should add to the to-do list.
>

I thought it worked with makeexe.py, but renaming the package causes the
executable to fail. Oh well.

We would really like this to work.

Michael
http://www.voidspace.org.uk/ironpython/index.shtml


>
> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Patrick O'Brien
> Sent: Thursday, January 04, 2007 2:14 PM
> To: Discussion of IronPython
> Subject: Re: [IronPython] Python Command Line Compiler issues and questions
>
> On 1/4/07, Dino Viehland <dinov at exchange.microsoft.com<mailto:dinov at exchange.microsoft.com>> wrote:
> I am surprised one is behaving different.  It works for me w/ pyc if I keep the package directory on the path, but if I don't then it breaks.
>
> I'm curious did you include all of your individual package files, or just __init__.py?  And were the packages on your path?
>
> In my case I didn't have a package, merely an extra Python module, imported from the local directory.  Something like the following:
>
> main.py
> ======
>
> import extra
>
> print extra.foo()
>
>
> extra.py
> ======
>
> def foo():
>     return "Hello"
>
>
> Does that make sense?  Can you duplicate the problem?  If not, I can create a real example for you.
>
> --
> Patrick K. O'Brien
> Orbtech       http://www.orbtech.com
> Schevo        http://www.schevo.org
> Louie         http://www.pylouie.org
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> users mailing list
> users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.410 / Virus Database: 268.16.5/616 - Release Date: 04/01/2007

_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list