Newbee question about running a script

Miki Tebeka miki.tebeka at gmail.com
Sun Jan 6 11:10:35 EST 2013


On Sunday, January 6, 2013 8:03:43 AM UTC-8, marc.assin wrote:
> I wonder how I could specify a parameter on the command line from
> within the interpreter.
Guido wrote some advice a while back - http://www.artima.com/weblogs/viewpost.jsp?thread=4829

Import your module and call its main.

The other way is to execute in another process:
    from subprocess import check_call
    import sys
    check_call([sys.executable, 'myscript.py', 'arg1', 'arg2'])



More information about the Python-list mailing list