xuv's notebook

Side notes, howtos and random bits of information related to Julien Deswaef's projects

User Tools

Site Tools


workshops:python_with_glue

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
workshops:python_with_glue [2012/01/22 15:06] 62.235.231.149workshops:python_with_glue [2012/01/22 17:42] (current) 62.235.231.149
Line 24: Line 24:
 A python library for pretty printing. A python library for pretty printing.
  
 +=== OOP ===
 +<code python>
 +# Creating a class
 +class Hello:
 +    def method(self):
 +        return 'hello'
 +    
 +#  Or the now official way (compatible with python3)
 +class Hello(object):
 +    pass
 +    
 +h  = Hello() # Creates an instance of the class Hello
 +
 +h.value1 = 23 # adds an attributes to the instance h
 +
 +Hello.value2 = 45 # adds an attribute to the class and all its instances. 
 +</code>
 +
 +You can add attributes and methods on the fly.
 +
 +=== Pyinotify ===
 +A python module for monitoring filesystem changes
 +https://github.com/seb-m/pyinotify
 +
 +=== Scapy ===
 +http://www.secdev.org/projects/scapy/ \\
 +Interactive packet manipulation program
  
  
workshops/python_with_glue.1327241204.txt.gz · Last modified: 2012/01/22 15:06 by 62.235.231.149