system cannot find the specified file python subprocess -


i trying run simple command in python:

from subprocess import *     check_output("ls") 

when run raises

error: windowserror: [error 2] system cannot find file specified 

ls doesn’t exist on windows; dir does. furthermore, may need pass shell=true, since it’s built in cmd.exe.

if it’s not test , want contents of directory, use os.listdir instead.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

python - Django-cities exits with "killed" -

python - How to get a widget position inside it's layout in Kivy? -