Ive got a python script that runs fine when I go to the file and hit run. However the script fails when the scheduler runs it. What could be causing this?
This is my script:
import timeimport osimport shutilimport statfor i in os.listdir(): if os.path.isdir(i): shutil.rmtree(i)This is the error I get when it is ran by scheduler
Traceback (most recent call last): File "filepath/myscript.py", line 7, in <module> for i in os.listidir():TypeError: listdir() takes exactly 1 argument (0 given)2017-01-25 17:10:12 -- Completed task, took 0.00 seconds, return code was 1.Im confused why this works when I manually run it but not when the schedule runs it.
- docs.python.org/2/library/os.html#os.listdirhashcode55– hashcode552017-01-25 17:41:09 +00:00CommentedJan 25, 2017 at 17:41