用python调用.bat或者.exe文件时,一般调用 方式如下:

os.system("C:\Windows\System32\osk.exe")

对吧,这样就会因为调用了系统shell而出现黑框。

解决方法是:

os.popen("C:\Windows\System32\osk.exe")

这样就把程序作为后台调用了,而且能根据popen的返回结果来获得程序的返回值

相关文章:

  • 2021-05-27
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
  • 2021-04-01
  • 2022-12-23
  • 2021-05-01
猜你喜欢
  • 2021-08-03
  • 2021-12-25
  • 2021-12-31
  • 2021-08-29
  • 2021-11-20
  • 2021-10-03
  • 2021-10-09
相关资源
相似解决方案