On 11 Oct 2005 07:07:44 -0700, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> i wrote a .py file and it works fine, my goal is to pass argument to
> that py file when it get executed, and accept that argument within py
> file, eg. i prefer a command like below:
>
> python test.py -t
>
> and then, i may get "-t" within test.py for later use.
>
> i have no ideas how to do and i'm really stuck, can anyone help ?

Short answer:

import sys
print sys.argv

You might also want to take to butchers at the optparse module.

--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to