Salman Asmat
Salman Asmat

Reputation: 44

Python Script not creating file when run through Task Scheduler

Link for python code running successfully through task scheduler

Image link for job detail on scheduler

When running through job scheduler, python script is not creating file in script directory (Scraped data in csv files). TF-IDF is working perfect but I can't find files.

Upvotes: 0

Views: 992

Answers (1)

Cody Stevens
Cody Stevens

Reputation: 414

It is probably related to your environment. What user is it running as? You may try putting in a few lines to see where it thinks it is running.

import os

# Print current working directory 
print "Current working dir : %s" % os.getcwd()

or go one step further and actually change to the dir you want before processing begins.

# First go to the "/var/www/html" directory
os.chdir("/var/www/html" )

Upvotes: 1

Related Questions