Ok, let's begin with issubclass(class, classinfo).
class A(object): pass class B(A): pass a = A() b = B() print issubclass(a.__class__,A) print issubclass(b.__class__,B)
It is easy right? ^^
|
|
Hi, I'm Veerapat Sriarunrungrueang, an expert in technology field, especially full stack web development and performance testing.This is my coding diary. I usually develop and keep code snippets or some tricks, and update to this diary when I have time.
Nowadays, I've been giving counsel to many well-known firms in Thailand.
view more... |
class A(object): pass class B(A): pass a = A() b = B() print issubclass(a.__class__,A) print issubclass(b.__class__,B)
import datetime dt = datetime.datetime.now() print dt.year print dt.month print dt.day print dt.hour print dt.minute print dt.secondVery easy right ^^
git add => to add a file into git server. git commit -a => to update a file when we change something git status => check status git revert => reverse changes
import dircache
flist = dircache.listdir("/Test/")
print flist
import os os.getcwd()
import sys import os # sys.path => will retrive the list of the system paths. sys.path.add(os.getcwd())
for x in xrange(5): print x
0 1 2 3 4