Python3

From vwiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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

  1. Install latest Python version available (3.1 at time of writing this)
    • apt-get install python3.1
  2. Install required add on packages
    • EG apt-get install python-mysqldb

Variables

Variable Information

Get a variables available methods...

dir(variable)

Variable Conversion

int(var)                # Convert to integer
str(var)                # Convert to string