Hello everybody.
I need a quick help.
I have a problem with running my python file code.
I use Linux. I had a file with the name "app3.py" file on the Desktop; then i removed ".py" from the end of the name of the file; so now i have "app3" file. The first line of the file is this:

#!/usr/bin/env python3

I have checked the "Execute: Allow executing file as program" checkbox too.
I have typed this command on Linux terminal:

sudo chmod +x app3

Now when i type "./app3" on the terminal; it should works but it doesn't. I don't know why.
What should i do? I need a quick help.
Thank you

Recommended Answers

All 4 Replies

Well, now when i type "./app3" on the terminal, i get this error:

./app3: line 6: import: command not found
./app3: line 7: import: command not found
./app3: line 9: DBFILENAME: command not found
./app3: line 10: loaded: command not found
./app3: line 11: favorite_movies: command not found
./app3: line 14: syntax error near unexpected token `('
./app3: line 14: `def pathtofile(filename=DBFILENAME):'

But why? For example line 6 is import os and line 7 is import pickle.

My code file hadn't these errors before.

I fixed the problem myself. Thank you.

What went wrong ? With the shebang line, it should work readily.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.