User Tools

Site Tools


python:index

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
python:index [2014/07/19 22:04]
tkbletsc
python:index [2014/07/20 17:48] (current)
tkbletsc
Line 11: Line 11:
  
 <code=python> <code=python>
 +# use this like a dictonary (d['thing']) OR an object (d.thing)
 +class DictObject(dict):
 +    def __getattribute__(self,k): return self[k]
 +    def __setattribute__(self,k,v): self[k]=v
 +
 +
 from datetime import datetime from datetime import datetime
 def timestamp(): return datetime.now().strftime("%Y%m%d-%H%M%S") def timestamp(): return datetime.now().strftime("%Y%m%d-%H%M%S")
python/index.txt ยท Last modified: 2014/07/20 17:48 by tkbletsc