[Crossfire-wiki] [Crossfire DokuWiki] page added: user:katia:about_python

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Sun Sep 30 09:36:39 CDT 2012


A page in your DokuWiki was added or changed. Here are the details:

Date        : 2012/09/30 09:36
User        : katia
Edit Summary: created

====== About Python ======
This section is for python beginners. 
===== Indentation =====
If you are new to python you should know it’s very important to keep indentation to make a python script work properly.

Please make sure it’s correctly kept when you copy the contents of my script to your file.
===== Version =====
If you don't know what python version you have installed you can type 'python' at your console and see what it says. It should be something like this:

  Python 2.7.3 (default, Apr 24 2012, 00:06:13) 
  [GCC 4.7.0 20120414 (prerelease)] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> 

Then use Ctrl+d to exit the python console.
So, the second line of that output shows you the version. If it says 3 or over you may have to try the command 'python2' instead, or may need to install it too. 
===== Sheebang =====
The sheebang is the first line of the script.

It tells the operating system what interpreter to use to run the code. 

Specifically it also determines the version of the Python it will use, depending on how you have installed python on your pc.

More or less sheebangs have the form #!/bin/bash/<interpreter> then the file /bin/bash/<interpreter> should exist in your system and it will define the version that will run.

So change your sheebang according to how you have installed python in your system and the version needed for each script. Running /bin/bash/<interpreter> in your console should tell you the version it would use (see [[#Version]])


IP-Address  : 186.52.69.211
Old Revision: none
New Revision: http://wiki.metalforge.net/doku.php/user:katia:about_python

-- 
This mail was generated by DokuWiki at
http://wiki.metalforge.net/



More information about the crossfire-wiki mailing list