This wiki has been archived and made read-only.
For up-to-date information about TkkrLab and it's projects please visit our main website at tkkrlab.nl.

PythonMaterial

From

Jump to: navigation, search

Handy cheat sheet syntax and standard library.

This is a subdivision of the theoretical part of the PythonCourse. It is a mix of language constructs and libraries so it will be possible to quickly create a functional program.

1. Basic types 
This part will discuss the PythonBasicTypes together with their constants and operators.
  • integer, long, float, boolean, string
2. Flow control 
To create programs we will need PythonFlowControl statements.
  • for, if, while, def
3. Structures 
Storing more than single variables needs data PythonStructures.
  • list, string, dict, set
4. Cairo introduction 
We want nice colorful output so we need a library PythonCairo.
  • lines, colors, rotation & translation, text
5. Functions 
Python can do much more interesting things with PythonFunctions.
  • default values, named arguments, multiple arguments, closures, anonymous
6. Modules 
To keep our projects tidy we use PythonModules.
  • compiled code, global variables, module initialization, import
7. Error handling 
Not everything will succeed every time, sometimes we need PythonErrorHandling.
  • try except, try finally, raise
8. File handling 
To store and read data we use PythonFileHandling routines.
  • reading/writing text files, csv files, binary
9. Event handling 
Interactive programs needs PythonEventHandling.
  • mouse clicks, file reading events, input boxes
10. Classes 
We can build advanced data structures with PythonClasses.
  • definition, __init__, __dict__, __repr__, private variables, inheritance, iterators, properties, operators, json
11. String formatting 
To output data in a specific format we need PythonStringFormatting.
12. Regular expressions 
To find all kinds of information in texts we can use PythonRegularExpressions.
13. Websites 
Use python in dynamic PythonWebsites.
14. Advanced types 
There are still more types in python PythonAdvancedTypes.
  • complex, rational, unicode
15. Generators 
To easy and efficiently create lists we can use PythonGenerators.
  • iterators, list generator, coroutines
16. Dynamic code 
Python is an interpreter we can make use of that with PythonDynamicCode.
17. Reflection 
Python knows a lot about it's own data and functions PythonReflection.
  • class details, alter classes
18. Databases 
Show the use SQLAlchemy of for connections to PythonDatabases.