Python
References
Installation
- sudo apt-get install python
- sudo apt-get install idle
Files
- /usr/bin/python - symbolic link to /usr/bin/python2.7
- /usr/bin/python-config - symbolic link to /usr/bin/python2.7-config
- /usr/lib/python* - directories containing the standard modules
- /usr/include/python* - directories containing the include files
Environment Variables (See man page for details)
- PYTHONHOME
- PYTHONPATH
- PYTHONSTARTUP
- PYTHON2K
- PYTHONOPTIMIZE
- PYTHONDEBUG
- PYTHONDONTWRITEBYTECODE
- PYTHONINSPECT
- PYTHONIOENCODING
- PYTHONNOUSERSITE
- PYTHONUNBUFFERED
- PYTHONVERBOSE
- PYTHONWARNINGS
Tidbits
- Statement grouping is done by indentation instead of beginning and ending brackets
- No variable or argument declarations are necessary
- In python, associative arrays are called Dictionaries
Starting The Interpreter
idle - start the IDE
python - start in interactive mode
python -c command [arg] ... (best to quote command) - Execute command with args
python filename - execute script in filename
python -i filename - go interactive after filename terminates
filename - Using she-bang notation, execute script in filename
python -m module [arg] - execute the source file for module
Semantics
Syntax
- a = b = c = 0 - Assign a value to multiple variables
- a, b = 0, 1 - Multiple assignment
- I/O
- Math
- Keywords
Send mail to the Webmaster
 |
This site best viewed with a browser |
| Warning: This is a Debian centric site and MAY contain peanuts. |
| Many thanks to Debra Lynn and Ian Murdock for making Debian possible |
| First created Aug 2, 2011 ~ Last revised February 15, 2012 |