[Tutor] Invoking Python
kinuthiA muchanE
muchanek at gmail.com
Thu Jun 26 17:46:07 CEST 2008
On Thu, 2008-06-26 at 09:57 -0400, bhaaluu wrote:
> You can create a Python script on a *nix system and run it with:
>
> $ python threeplusfour.py
>
> You can place a shebang line as the first line of the script, which points
> to the python interpreter:
>
> #!/usr/bin/python
> print("Hello, world!\n")
>
> Save the file, then make it an executable with:
>
> $ chmod u+x threeplusfour.py
>
> Then execute it with:
>
> $ ./threeplusfour.py
>
> Why the dot-slash? Here is a good explanation:
> http://www.linfo.org/dot_slash.html
>
> You can also create a Python script and place it in a directory that is
> included in your PATH (echo $PATH). Once the executable script is in
> a directory in your PATH, you can execute it with:
>
> $ threeplusfour.py
bhaluu, I was not having a problem with any of that, it was Danny
Laya! :-)
>
> Happy Programming!
More information about the Tutor
mailing list