
August 24th, 2012, 12:20 PM
|
 |
Contributing User
|
|
|
|
|
Works like this in unix:
$ chmod +x p.py # make "it" executable
$ cat p.py # show "it"
#! /usr/bin/python
import sys
print(sys.argv)
$
$
$ ./p.py abc # run "it"
['./p.py', 'abc']
$
$
$ python ./p.py abc # run "it"
['./p.py', 'abc']
$
$
$ python -ic 'import p' abc # run "it"
['-c', 'abc']
>>>
__________________
[code] Code tags[/code] are essential for python code!
|