When writing Python scripts, sometimes you will need to read in the arguments given.
1.
import
sys
2.
print
sys.argv
Using pop() to retrieve the information, we pull out the stuff we need.
For example the script was called using:
1.
python script.py admin@example.com mypass
Then the arguments can be retrieved using:
1.
args
=
sys.argv
2.
3.
args.pop(
0
)
# filename for current script
4.
email
=
args.pop(
0
)
# username/email
5.
password
=
args.pop(
0
)
# password
[ Source ]