thread tools (just above the first post of the thread) -> mark as solved
thread tools (just above the first post of the thread) -> mark as solved
make the first line of the python file "#!/usr/bin/env python" then, assuming your file is called "hello.py" you need to type the following in the command line in the directory that "hello.py" is located:
this command gives the file "executable permission" that is it can be executed as a standalone script.Code:chmod +x hello.py
What happens is bash looks at the first line of the file and if it starts with "#!" then it executes the command that follows the "#!" with the scriplt file as an argument. So while #!/usr/bin/env python works. so does #!/usr/bin/python.
Bookmarks