import os print os.getcwd() # working directory 願鍵 os.chdir('d:\pydata')
>>> a = 'dynamic' >>> x = type(a) >>> x <type 'str'> >>> x.__name__ 'str' >>>
>>> isinstance('aaa', str) True >>> isinstance(123, int) True
>>> a = 1 >>> a = eval('a+1') >>> a 2
>>> exec 'a = a + 1' >>> a 3
>>> a = 1 >>> compiled_code = compile('a + 1', '<string>', 'eval') >>> a = 1 >>> for i in range(5): ... a = eval(compiled_code) ... >>> a 6compile() 3覯讌 語..