我正在编写一个python程序,该程序从用户那里获取输入,然后创建一个批处理文件并打开该程序,我希望如果未找到该程序,则将该错误返回给python并关闭弹出窗口
Windows cannot find 'room'. make sure you type correctly, and then try again.
和cmd。
我不知道如何解决这个问题。
def batch(text):
bat_file = open("hello.bat","w")
bat_file.write("start "+text)
bat_file.close()
os.startfile("hello.bat")
如上所述,我想关闭弹出窗口和cmd。