I am studying automate the boring stuff with python
book and therein after finishing the password locker
project it is suggested to create a batch file using the following codes:
@py.exe C:\Python34\pw.py %*
@pause
and I did exactly the same mine one looks like this (copied entire script if there are any other potential errors):
import sys
import pyperclip
""" PASSWORD LOCKER """
passwords = {
'facebook' : 'password of facebook',
'gmail' : 'password of gmail',
'quora' : 'password of quora'
}
if len(sys.argv) == 2:
account_name = sys.argv[1]
if account_name in passwords:
print('Password of [' + str(account_name).upper() + '] has been copied to clipboard.')
acc_password = passwords[account_name]
pyperclip.copy(acc_password)
print('Paste it anywhere')
else:
print('There is no name registered with that account name.')
@py.exe 'C:\py\Automate the Boring Stuff with Python\Data Structures, Dictionary\pw.py' %*
@pause
then saved the file as pw.bat
, according to instruction of the book:
With this batch file created, running the password-safe program on Windows is just a matter of pressing win-R and typing pw .
I then followed these steps again and it didn't work fine. Can you please help me with this. Thank you.