I have downloaded this script named, pyAES.py and put it in a folder name codes, inside a Desktop directory of my Linux,
According to this example, http://brandon.sternefamily.net/2007/06/aes-tutorial-python-implementation/
When I type,
./pyAES.py -e testfile.txt -o testfile_encrypted.txt
the file pyAES.py should be executed. but I am getting this error,
pi@raspberrypi ~/Desktop/Codes $ pyAES.py
-bash: pyAES.py: command not found
the output of ls -l
command is,
pi@raspberrypi ~/Desktop/Codes $ ls -l
total 16
-rw-r--r-- 1 pi pi 14536 Oct 8 10:44 pyAES.py
Here is the output after chmod +x
pi@raspberrypi ~/Desktop/Codes $ chmod +x pyAES.py pi@raspberrypi ~/Desktop/Codes $
pi@raspberrypi ~/Desktop/Codes $ pyAES.py
-bash: pyAES.py: command not found
pi@raspberrypi ~/Desktop/Codes $
and the command, chmod +x pyAES.py && ./pyAES.py
gives the following error,
-bash: ./pyAES.py: /usr/bin/python2: bad interpreter: No such file or directory
I have also tried moving the file in /usr/bin
directory and then executing it,
pi@raspberrypi /usr/bin $ pyAES.py
-bash: /usr/bin/pyAES.py: /usr/bin/python2: bad interpreter: No such file or directory
pi@raspberrypi /usr/bin $
I can see the file is present in /usr/bin directory but it is still giving an error that No such file or directory.
I want to know why the Linux terminal is not executing the python script ?
ls -l
.chmod +x pyAES.py
then retry.python pyAES.py
orchmod +x pyAES.py && ./pyAES.py
should do the jobpython2
by typingtype -p python2
See where the binary is located and put it in the files' header.