I am trying to run the following code from the terminal window. I am following the tutorial found on this website https://automatetheboringstuff.com/chapter6/ . The name of my file is "pw.py" I ran chmod +x pw.py to make it executable from the terminal window. However, when I run ./pw.py I get an error saying "-bash: ./pw.py: python: bad interpreter: No such file or directory". Any Idea what I missed? Thanks for the help!
#! /usr/bin/python
# pw.py - An insecure password locker program.
PASSWORDS = {'email' : 'F7minlBDDuvMJuxESSKHFhTxFtjVB6' ,
'blog' : 'VmALvQyKAxiVH5G8v01if1MLZF3sdt' ,
'luggage' : '12345'}
import sys, pyperclip
if len(sys.argv) < 2:
print('Usage: python pw.py[account] - copy account password')
sys.exit()
account = sys.argv[1] # first cammand line arg is the account name
if account in PASSWORDS:
pyperclip.copy(PASSWORDS[account])
print('Password for ' + account + ' copied to clipboard.')
else:
print('There is no account named ' + account)