我在Python中有一个非常简单的UI,我想在按下按钮时运行Powershell脚本。问题在于,脚本运行时没有按下按钮。
这是两个相关的功能:
{{1}}
顺便说一句:我正在使用Tkinter作为GUI框架
答案 0 :(得分:2)
问题在这里
self.setup = tk.Button(self, text="Bot Setup", command=self.powershell_setup())
它必须是(command
必须是可调用对象):
self.setup = tk.Button(self, text="Bot Setup", command=self.powershell_setup)