Hi,
Use sys.argv to access the command line arguments
eg:
import sys
print sys.argv[0]
print sys.argv[1]

Run the above script as
/test.py hello world

On 4/7/07, Eric Price <[EMAIL PROTECTED]> wrote:

Hi;
How do I pass a variable to a python script? Something like this (which
doesn't work):

./test.py?var=hello_world

TIA,
Eric

_________________________________________________________________
Mortgage refinance is Hot. *Terms. Get a 5.375%* fix rate. Check savings

https://www2.nextag.com/goto.jsp?product=100000035&url=%2fst.jsp&tm=y&search=mortgage_text_links_88_h2bbb&disc=y&vers=925&s=4056&p=5117

--
http://mail.python.org/mailman/listinfo/python-list




--
Regards--
Rishi Pathak
National PARAM Supercomputing Facility
Center for Development of Advanced Computing(C-DAC)
Pune University Campus,Ganesh Khind Road
Pune-Maharastra
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to