dinov at exchange.microsoft.com
Fri Mar 23 23:35:43 CET 2007
I think the problem is we're not setting the module name to __main__. If I do this with:
from System.Windows.Forms import MessageBox
>From 'hello.py' the message box shows 'hello'.
I believe this is the same as bug #2537 (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=2537). Currently the bug has 0 votes so we haven't been paying too much attention to it to date.
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Bryan
Sent: Friday, March 23, 2007 11:48 AM
To: users at lists.ironpython.com
Subject: [IronPython] compiling
i just wrote my first ipy script and i have some questions.
import System.Windows.Forms as WinForms
WinForms.MessageBox.Show('Hello', 'Hello World')
if __name__ == '__main__':
when i execute the following
c:\> ipy -X:SaveAssemblies hello.py
a hello.exe file is generated and i can successfully execute it.
but when i compile with pyc as follows:
c:\> ipy pyc /main:hello.py
c:\> ipy pyc /main:hello.py /target:winexe
it generates hello.exe, but the program doesn't run (the MessageBox doesn't
display). i even tried explicitly adding /r:System.Windows.Forms without
luck. what am i doing wrong?
users mailing list
users at lists.ironpython.com
More information about the Ironpython-users