【发布时间】:2021-09-21 08:00:19
【问题描述】:
我有以下代码从python 脚本运行 SSMS(因为我希望它在我开始工作之前自动运行):
import os
run_line = ' '.join(['ssms.exe', '-S', server_name, '-U', user_name, '-P', my_password])
os.system('cmd /c ' + run_line)
其中server_name user_name my_password 保存ssms.exe 运行的参数。
它工作并使用用户名和密码启动 SSMS,但脚本在我关闭 SSMS 或手动关闭之前不会终止。
如何在不关闭 SSMS 的情况下自动运行程序并结束脚本?
【问题讨论】: