python中调用os.system("ls")报错无法识别ls指令,是什么原因呢?
执行
import os
os.system(“ls”)
窗口显示结果
‘ls’ is not recognized as an internal or external command,
operable program or batch file.
关于 LearnKu
你是不是在 Window 系统中调用 Linux 的
ls命令 ? 如果是这样你应该要使用dir如果你想在 Windows 下使用 ls, 那就在你的路径下, 建立一个
ls.exe,ls.com或ls.bat就可以了.比如
ls.bat,