![](/img/trans.png)
[英]Cannot schedule a python script to run through Windows Task Scheduler
[英]Python Script not creating file when run through Task Scheduler
通過作業計划程序運行時,python腳本未在腳本目錄中創建文件(csv文件中的已抓取數據)。 TF-IDF運行完美,但是我找不到文件。
它可能與您的環境有關。 它以什么用戶身份運行? 您可以嘗試插入幾行,以查看它認為在哪里運行。
import os
# Print current working directory
print "Current working dir : %s" % os.getcwd()
或更進一步,然后在處理開始之前實際更改為所需的目錄。
# First go to the "/var/www/html" directory
os.chdir("/var/www/html" )
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.