I am trying to execute my python file using a shell script, in Ubuntu 12.04. For doing this, I have the following code, with the help of the link
#!/bin/bash
file_path=/home/itachi/LN_project/cover_image
for f in $file_path
do
python Question2_lsbreplacement_encode.py $f message_2.txt 0.7
done
I am new to scripting, so please bear with me if there are other mistakes as well. Am welcome to inputs. This is the following error I get
Traceback (most recent call last):
File "Question2_lsbreplacement_encode.py", line 26, in <module>
img = Image.open(imgname) # reading image
File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1955, in open
fp = __builtin__.open(fp, "rb")
IOError: [Errno 21] Is a directory: '/home/itachi/LN_project/cover_image'
Basically, I do not want to explicitly mention the path as well. I want to concatenate just the folder name with the current working directory. Can you please tell me how I can do this?