1. 程式人生 > >報錯記錄---001---os.system(‘ls’)無效時

報錯記錄---001---os.system(‘ls’)無效時

bsp txt print 情況 off color 外部命令 輸入 ima

報錯記錄:

情況:在運行Jupter 輸入lst=os.system(‘ls‘)時,返回1

在運行Anaconda Promote 輸入lst=os.system(‘ls‘)時,返回‘ls‘ 不是內部或外部命令,也不是可運行的程序

原因分析:沒有運行文件ls.bat

解決方法:

1.在d盤新建txt文件,輸入

@echo off
dir 

2.變更後綴為.bat,放回到windows下

3.再次運營代碼

測試結果:


技術分享圖片


報錯記錄---001---os.system(‘ls’)無效時