这是我的代码:
import ConfigParser
configuration = ConfigParser.ConfigParser()
configuration.read('timesheetconfig.ini')
username = configuration.get('internal','username')
password = configuration.get('internal','password')
url = configuration.get('internal','url')
browser = configuration.get('internal','browser')
我也试过替换: 配置.读取('C:\SikuliConfig\时间表配置.ini')
这是时间表配置.ini在
^{pr2}$你知道我为什么会这样吗???在
[error] script [ ScriptName ] stopped with error in line 4
[error] ConfigParser.NoSectionError ( No section: 'internal' )
因为某种原因配置.读取无法打开同一文件夹中的文件。我用Cygwin在Python中测试了相同的代码,它工作得很好,因此它与Sikuli有关。在
我通过在导入后添加ConfigParser来解决此问题:
那么
^{pr2}$在Sikuli文档中搜索"Another example: Importing from the same directory"
相关问题 更多 >
编程相关推荐