Pywinauto TypeError: start() missing 1 required positional argument: 'self'

血红的双手。 提交于 2019-12-11 18:26:27

问题


Hello I faced a problem:

import pywinauto
from pywinauto.application import Application
app = Application.start(cmd_line="C:\Folder\Wow.exe")

Traceback (most recent call last):
  File "<input>", line 1, in <module>
TypeError: start() missing 1 required positional argument: 'self'

What shall I add to code?


回答1:


You need to instantiate the Application object and call start on that, not on the class. As the documentation shows:

app = Application(backend="uia").start('notepad.exe')

In your case I guess you need the win32 backend, so:

app = Application(backend="win32").start(cmd_line="C:\Folder\Wow.exe")



回答2:


app = Application().start(cmd_line="C:\Folder\Wow.exe")



来源:https://stackoverflow.com/questions/51705452/pywinauto-typeerror-start-missing-1-required-positional-argument-self

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!