0

I have a small problem when I try to run a script in bash. First of all , my script work well when I run in terminal, but when I try to run by launcher in Ubuntu, I have this error

"python: can't open file 'teste.py': [Errno 2] No such file or directory"

My script is similar at :

 #! /bin/bash
 # This script use sample.py
 python sample.py games.txt
 sleep 15

Other informations :

Ubuntu 11.04
Python 2.7

Thanks in advance

0

1 Answer 1

3

From the error message it looks like you have to specify the full path to your script in the launcher.

Try adding the full paths to your command in your bash script, i.e. similar to:

   python /home/glc/sample.py /home/glc/games.txt

By the way, what is this file teste.py? In your post you refer to script sample.py - is this a different file? How does it connect? Did you possibly specify the wrong file name in the launcher?

Sign up to request clarification or add additional context in comments.

1 Comment

Geraldo: For debugging, stick an ls and/or pwd in your bash script before calling the python file. This way you can see the directory contents and the current working dir.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.