1 improt os 2 os.getcwd(); #get current dir 3 os.chdir("Target dir"); #change current dir to target dir
根据字符串所对应的长度,判断电脑所安装的Python是32位还是64位
1 import struct 2 3 print struct.calcsize("A") 4 5 # 打印的结果是4,则为32位,否则为64位