作为一些自动化的一部分,我尝试使用python连接到大型机,在那里我可以访问大型机文件并创建一个 报告。就像使用大型机文件作为DB for python程序一样。在
要登录到大型机-我们需要提供主机详细信息(xyz.host.com网站) 接着是地区详情(h123p),然后是我们的证书。在
我发现我们可以使用python包py3270来实现这一点,并尝试这样做,但是得到了错误。在
from py3270 import Emulator
# or not (uses s3270)
em = Emulator()
em.connect('xyx.example.com')
em.fill_field(3, 1, 'xxxx',5)
em.send_enter()
em.fill_field(2, 1, 'xxxxxxx', 7)
em.send_enter()
em.fill_field(8, 20, 'xxxxxxxx', 8)
em.send_enter()
# if your host unlocks the keyboard before truly being ready you can use:
em.wait_for_field()
# maybe look for a status message
if not em.string_found(1, 2, 'login succesful'):
abort()
# do something useful
# disconnect from host and kill subprocess
em.terminate()
错误:
^{pr2}$
根据您看到的错误消息,我怀疑您在缺少/未找到x3270/s3270库方面遇到了问题。在
上述情况表明库正在尝试启动Ws3270,即x3270的windows版本,但无法启动。在
确保所需的库在您的路径中并且在python中可见。在
相关问题 更多 >
编程相关推荐