简体   繁体   English

如何使用python从GUI可执行文件导出数据

[英]How to export data from a GUI executable using python

Here is a programm I want to get a token from(allocated with red): 这是我要从中获取令牌的程序(用红色分配): 在此处输入图片说明

I'm trying to do it using subprocess module: 我正在尝试使用子过程模块:

import subprocess
sda = subprocess.Popen(r'C:\Program Files (x86)\SDA New\Steam Desktop Authenticator.exe', stdout = subprocess.PIPE)
outs = sda.communicate(timeout=15)[0]
print(outs)

it returns an emtry string. 它返回一个emtry字符串。 How can I get the token? 我如何获得令牌?

Solution: 解:

from pywinauto import application
from pywinauto import clipboard

app = application.Application()
app.start(r'C:\Program Files (x86)\sda 1.06\Steam Desktop Authenticator.exe',
          timeout=5)
sda = app.window_(title_re="Steam Desktop Authenticator")
time.sleep(2)
sda.Copy.Click()
code = clipboard.GetData()
sda.Close()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM