python 2.7 如何从我的文件中获取密钥代码而不是字符串
我的文件是settings.ini
[Settings]
keycode = 0x36
这是我的代码部分
config = ConfigParser.RawConfigParser()
config.read('settings.ini')
key = config.get('Settings', 'keycode') # this is the key code i want ---> 0x36
例如
shell.sendkeys(key)
在这种情况下,senkeys会发送
>> 0x36
我希望它发送此
>> 6
重要的是我不需要字符串!