The Glowing Python

A collection of sloppy snippets for scientific computing and data visualization in Python.

Showing posts with label oop. Show all posts
Showing posts with label oop. Show all posts
Wednesday, April 20, 2011

How to create threads

›
The example show how to define the behavior of a thread and run it. import threading import time import random class MyThread(threading.Th...
Tuesday, April 19, 2011

How to work with exceptions

›
Here is: How to define an exception How to raise an exception How to catch an exception class MyException(Exception): # a custom except...
Monday, April 18, 2011

How to define a class (using inheritance too)

›
The snippet contains: How to declare and use a class with attributes and methods How to declare a class using inheritance class Point2D...
›
Home
View web version
Powered by Blogger.