【发布时间】:2022-08-22 17:15:59
【问题描述】:
有没有办法打开命令提示符并拥有诸如dir/s 或tree 之类的命令?
import os
os.system(\'start /wait cmd /k \"color a & dir/s\"\')
这可行,但它不会显示所有dir/s 和tree 不起作用,就好像您以正常方式打开命令提示符,它会在dir/s 中显示更多信息。
标签: python
有没有办法打开命令提示符并拥有诸如dir/s 或tree 之类的命令?
import os
os.system(\'start /wait cmd /k \"color a & dir/s\"\')
这可行,但它不会显示所有dir/s 和tree 不起作用,就好像您以正常方式打开命令提示符,它会在dir/s 中显示更多信息。
标签: python
import os
os.popen("Start cmd")
Python: Start new command prompt on Windows and wait for it finish/exit 更多信息。
【讨论】: