我应用程序中的 ™ 符号不允许我使用 pywinauto 启动应用程序

The ™ symbol in my application is not allowing me to launch the application using pywinauto

我尝试了多种方式来启动我的应用程序。在某些情况下,我能够启动它但无法使用 print_control_identifier 或者在另一种情况下,我什至无法启动我的应用程序。我尝试了 pywinauto 0.6.2 入门文档中显示的这段代码。

# coding: utf-8
# -*- coding: utf-8 -*-
from subprocess import Popen
from pywinauto import Desktop
Popen('TRACE™ 3D Plus.exe', shell=True)
dlg = Desktop(backend="uia").TRACE™ 3D Plus
dlg.wait('visible')

现在,当我从命令提示符 运行 这段代码时,我得到了错误,

File "3d.py", line 6
dlg = Desktop(backend="uia").TRACE\ufffd 3D Plus
SyntaxError: invalid character in identifier

据我所知,在执行这段代码时,我的应用程序名称中的 ™ 符号没有被正确解释。

有什么想法吗?我可以做些什么来让它发挥作用?

提前致谢!

正如我们通过 Skype 发现的那样,以下方法适用于此应用程序:

import os
from pywinauto import Application

exe_folder = "C:\Program Files (x86)\Trane\TRACE 3D Plus"
executable = os.path.join(exe_folder, "TRACE\u2122 3D Plus.exe")

os.chdir(exe_folder)
app = Application(backend="uia").start(executable)

即使是 cmd.exe 也很难 运行 这个可执行文件。我们还必须将工作目录更改为可执行文件所在的文件夹。否则它会显示内部异常(似乎是应用程序问题)。