Python3: Difference between revisions
Jump to navigation
Jump to search
(Initial creation) |
(Added Python category) |
||
Line 24: | Line 24: | ||
str(var) # Convert to string | str(var) # Convert to string | ||
</source> | </source> | ||
[[Category:Python]] |
Latest revision as of 13:30, 18 May 2011
Getting Started
The main site for downloads, documentation etc, can be found at http://www.python.org.
Python2 or Python3
The language is going through a metamorphosis from v2 to v3 and you'll have to choose which to go for. Essentially if you're starting from scratch then go for v3, but if you need to integrate with existing Python code or are a complete scripting/coding novice (and so need to be able to use the wealth of examples etc on the web) go for v2. See http://wiki.python.org/moin/Python2orPython3 for further info.
This page is for Python3
Install
- Install latest Python version available (3.1 at time of writing this)
apt-get install python3.1
- Install required add on packages
- EG
apt-get install python-mysqldb
- EG
Variables
Variable Information
Get a variables available methods...
dir(variable)
Variable Conversion
int(var) # Convert to integer
str(var) # Convert to string