可能重複:
How do I determine if my python shell is executing in 32bit or 64bit mode?Python - 檢查系統是32位還是64位,以確定是否運行該功能?
我早些時候所作的一個問題是從來沒有得到答覆,但我有更具體的東西,現在,所以希望你能幫助。
基本上的SendKeys庫似乎只安裝我的Windows 32位系統上...
所以我想知道是否有做的方式,所以這個功能,我打算寫將只執行上一個32位系統?我意識到有一個platform.architecture()方法來檢查當前系統,但它返回字符串「('64bit','WindowsPE')」。
我想知道是否有一種方法來讀取此字符串的64位部分,以使此功能正常工作。
例如,僞碼:
checker = platform.architecture()
system = strip or read 64 bit from checker string somehow
if system == 64 bit
then warn system is 64 bit and won't run function
else run function
沿着該線。除非有一個更簡單的方法來檢查它 - 也許與所使用的Python版本(即32或64位)
希望我已經正確掌握了這一點 - 我對編程還很陌生。 :)
重複的http://stackoverflow.com/questions/1405913/how-do-i-determine-if-my-python-shell-is-executing-in-32bit-or-64bit-mode和http:/ /stackoverflow.com/questions/1842544/how-do-i-detect-if-python-is-running-as-a-64-bit-application和http://stackoverflow.com/questions/2208828/detect-64bit -os-windows-in-python這可能是最精確的重複。 – agf 2012-04-01 12:37:12
對不起剛剛意識到這一點。下面的答案似乎是迄今爲止最簡單的方法! – Semaj 2012-04-01 13:20:35