python:index
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
python:index [2014/07/19 22:02] – tkbletsc | python:index [2014/07/20 17:48] (current) – tkbletsc | ||
---|---|---|---|
Line 11: | Line 11: | ||
< | < | ||
+ | # use this like a dictonary (d[' | ||
+ | class DictObject(dict): | ||
+ | def __getattribute__(self, | ||
+ | def __setattribute__(self, | ||
+ | |||
+ | |||
from datetime import datetime | from datetime import datetime | ||
def timestamp(): | def timestamp(): | ||
Line 122: | Line 128: | ||
< | < | ||
def recognize_type(v): | def recognize_type(v): | ||
- | | + | |
- | return int(v) | + | except ValueError: pass |
- | | + | |
- | | + | try: return int(v) |
+ | | ||
+ | |||
return v | return v | ||
| |
python/index.txt · Last modified: 2014/07/20 17:48 by tkbletsc