[Tutor] defining / calling arguments on a compiled script?

Alan Gauld alan.gauld at btinternet.com
Sun Mar 13 22:12:43 CET 2011

"Ryan Hussain" <ryanh.net at gmail.com> wrote

> I was wondering if there is a solution to add arguments to a 
> compiled python
> script, compiled with py2exe?

Assuming you still have the original source code then there is no
difference to it being compiled with py2exe than if it weren't You
just read the command line arguments using sys.argv as usual.

If you are not familiar with that read the second half of the
"Talking to the User" topic in my tutorial...

If OTOH you only have the exe and no access to the source
then I suspect you are beat. You can't really change the
exe file directly to read arguments (without being a guru level
hacker that is! :-)

Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list