A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/304792.html below:

Python executable

Python executable Python executableJules Dubois not-even at dispsable.address.this.time
Tue Sep 6 01:06:57 EDT 2005
On Monday 05 September 2005 21:54, presentt <presentt at gmail.com>
(<1125978845.080791.14520 at g43g2000cwa.googlegroups.com>) wrote:

> So I created a file named helloworld.py, and put in it:
> 
> #! /usr/bin/env python
> print "Hello, world!"
> 
> and then used
> $ chmod +x helloworld.py
> to set the permissions.  Finally, I went to my terminal and typed
> $ helloworld.py
> but I was given the bash: helloworld.py: command not found error.
> 
> Can someone tell me
> (1)Am I right in saying that something is directly executable if I can
> enter the filename in the command line and it runs?

Almost.  For more information, you might read about the PATH variable.

> (2)Am I setting up the script to be directly executable correctly?

Yes.

> and (3)Am I trying to run the directly executable script correctly?

No.  The best (safest) method is to type 

  ./helloworld.py

to tell your shell that the script is in the current directory.

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4