2013-02-14 134 views

回答

2

當然,只是這樣做:

try: 
    import _winreg 
except ImportError: 
    import cygwinreg as _winreg 

或許

import sys 

if sys.platform == 'win32': 
    import _winreg 
elif sys.platform == 'cygwin': 
    import cygwinreg as _winreg 
else: 
    # non-windows support 
相關問題