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 -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -