Python Shell改变当前路径 判断Python是32位还是64位

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位

 

posted @ 2015-04-22 15:22  LizSep  阅读(270)  评论(0编辑  收藏  举报