Contributions
Re: Imports of unsupported third-party modules
import sys sys.path.insert(0, r"D:\package") #from lxml import etree #from pywinauto.application import Application import time import serial def a(): #获取本地的html文件,parse() Log.Message(sys.path) html = etree.parse(r"D:\fsdata\cyptube2017\machine.config") result = html.xpath("//MachineConfig/TripRecord/@LubricateTripX") Log.Message(result[0]) 已经insert了,还是不可以;并且第一次可以跑通,第二次报警。 请注意审一下题可以吗,看了下答案,你的回答中并没有说明,按照当前设置后,还是不行的解决方案。620Views0likes0Comments- 577Views0likes0Comments
pywinauto module cannot be used
pywinauto module cannot be used. After using it, it always reports that there is no win32api module. How to solve? def aa(): import sys sys.path.insert(0, r"D:\package") from pywinauto.application import Application Application().start(r"C:\Program Files (x86)\Friendess\TubePro\TubePro.exe") time.sleep(1) app = Application().connect(path = r"C:\Program Files (x86)\Friendess\TubePro\TubePro.exe") app['安全警示 Safety Warning!']['确定'].click() time.sleep(3) app['Warning']['OK'].click() Run to ‘from pywinauto.application import Application’, and the pop-up window reports an error.1.1KViews0likes3CommentsImports of unsupported third-party modules
Import using sys_path,there is no problem with the first execution, and the second execution will still report an error, lxml import. import sys sys.path.insert(0, r"C:\Program Files (x86)\SmartBear\TestComplete 15\x64\Bin\Extensions\Python\Python38\Lib") from lxml import etree def aa(): #获取本地的html文件,parse() html = etree.parse(r"D:\fsdata\cyptube2017\machine.config") result = html.xpath("//MachineConfig/TripRecord/@LubricateTripX") Log.Message(result[0])644Views0likes4Comments