August 20th, 2012, 11:24 AM
Create a variable just before running the script
Hi, it is hard to explained what I want, but I will try. I writing an script that I want the user to create the variable when the run ths script. Something like this
The user running the script:
python scriptname.py 34
I want the number 34 that the user wrote after scriptname.py be inside my script like a regular variable. Thanks in advance
number = "what ever the user input after scriptname.py"
August 20th, 2012, 11:44 AM
# try this program saved as p.py with command line use
# $ python p.py arguments like 43 34 I mean.
[/code] are essential for python code and Makefiles!
August 20th, 2012, 11:49 AM
Thanks, is exctly what I was looking for.
Originally Posted by b49P23TIvg
September 3rd, 2012, 06:49 PM
You use the sys module
python script.py variable