Python 3.x 从tkinter调用bash脚本
我有一个Python 3.x 从tkinter调用bash脚本,python-3.x,tkinter,Python 3.x,Tkinter,我有一个tkinter应用程序 当用户单击按钮时,我需要运行一些bash脚本并用状态更新scrollertext 我试着这样做: import subprocess self.scrollerTextStatus.insert(INSERT, "Starting...\n") cmd = "~/f1.sh" subprocess.run(cmd, check=True, shell=True) self.scrollerTextStatus.inser
tkinter
应用程序
当用户单击按钮时,我需要运行一些bash脚本并用状态更新scrollertext
我试着这样做:
import subprocess
self.scrollerTextStatus.insert(INSERT, "Starting...\n")
cmd = "~/f1.sh"
subprocess.run(cmd, check=True, shell=True)
self.scrollerTextStatus.insert(INSERT, "F1 Finished\n")
cmd = "~/f2.sh"
subprocess.run(cmd, check=True, shell=True)
self.scrollerTextStatus.insert(INSERT, "F2 Finished\n")
cmd = "~/f3.sh"
subprocess.run(cmd, check=True, shell=True)
self.scrollerTextStatus.insert(INSERT, "F3 Finished\n")
但是scrollertext
在运行t3.sh
结束时更新(在第一个和第二个脚本之后不会更新)
在每个bash脚本完成后,如何更新scrollertext
python 3.6.8
每次插入后调用self.scrollerTextStatus.update_idletasks()。