1.查找定时任务的命令 crontab -l
2.编辑定时任务的内容 crontab -e
3.删除所有的定时任务 crontab -r
4.python生成的文件指定存储路径
def wfile(path,cur): sql = 'select * from parts_num ' cur.execute(sql) rows = cur.fetchall(); for row in rows: row0 = str(row[0]) row1 = str(row[1]) row2 = str(row[2]) filename = row0 + row1 +'.txt' if not os.path.exists(path): os.makedirs(path) if os.path.exists(path + filename): output = open(path + "/" + filename, 'a') output.write(row0+row1+row2+'\n') else: output = open(path + "/" + filename, 'w') output.write(row0+row1+row2+'\n') output.close() cur.close()

693

被折叠的 条评论
为什么被折叠?



