Introduction

One of the best things that Python offers is an extensive standard library that offers a wide range of included features that range from network functionality, database handling, and XML processing all the way to zip file processing. There are hundreds of additional libraries that extend the abilities of Python.

The current versions of Python that are available at this writing are 2.7 and 3.2.5. The reason for this is that version 3.x is NOT completely backward compatible to the earlier versions, and with the wealth of existing code and libraries that are currently being used on a daily basis, both versions are available. You can find these versions at www.python.org for the Windows, Linux/Unix, and Mac OS X operating systems. If you are running Linux, you can check your normal distribution, which will have a version of Python available. It might already be installed on your system. You can do a web search for versions that are available for other operating systems.

Although there are many free and for-pay IDEs (Integrated Development Editors) available for Python, all code may be written in a standard text editor and run from the command line in a standard terminal or command box. My personal preference is a free IDE named Geany, which is available for both Linux and Windows.

The goal of this book is to provide (as the name suggests) a quick guide to the Python language syntax. Sometimes, a programmer is called on to know multiple languages and the differences from one programming language to another can be just different enough to cause issues. This guide is designed to be kept not on the bookshelf but on the desk, to provide a way to quickly get answers.

You’ll find chapters on data structures, keywords, strings, variables, and more. There is even a chapter on some of the more useful standard libraries that come with almost every distribution of Python.

Conventions used in this book

Almost all code presented here will be simple examples showing how to use a particular command or function and can be run in the interpreter shell. The code will look like the following, with the output or response from the shell in bold.

print('This is a test')
This is a test

If you see a line of code that starts with “>>>”, that shows the prompt from the interpreter shell. Do not insert that into your code, just the part after it. If you see a line of code that starts with “. . .”, that shows that the shell recognizes this is a line that should be indented. Again, do not insert the dots in your code. Just remember that you have to indent that portion of the code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset