4 Answers
+ 3
the print simply output the text, in this case explain how to use the program:
python, call for execute the file
pw.py, the name of the file
[account], optional argument that'll be putted in sys.argv [1]
copy account password, if you put an account name it'll copy the password on the clipboard
the print statement obviously only print text and does nothing
+ 1
you add command line argument support, so when you execite your program, for ex:
python myfile.py
you can add arguments:
python myfile.py argument
in this case you can enter an account name and you'll get the password for that account so:
python myfile.py luggage
and you'll get 12345 copied to the clipboard(in the third step the book add codes for copy this to the clipboard, so for now it'll do nothing)
0
ok...please explain the print argument
if len(sys.argv) < 2:
print('Usage: python pw.py [account] - copy account password')
0
thank you