Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sys import argv
- print "arguments: ", argv
- script, first, second, third=argv
- print "The script is called: ", script
- print "The first variable is: ", first
- print "The second variable is: ", second
- print "Your third variable is: ", third
- ##Windows PYthon SHELL
- ##>>> import sys
- ##>>> sys.argv=['','alpha','beta','gama']
- ##>>> execfile('ex13.py')
- ##Combine raw_input with argv to make a script that gets more input from a user.
- from sys import argv
- script, arg1, arg2=argv
- for i in range(1,int(arg1)):
- print('All work and no play')
- for j in range(1,int(arg2)):
- print('Makes Jack a dull boy')
- ##Windows PYthon SHELL
- ##>>> import sys
- ##>>> sys.argv=['','2','5']
- ##>>> execfile('ex13_p3.py')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement