简体   繁体   English

从任务调度程序运行 python 脚本作为任务

[英]Running a python script as task from task scheduler

I have a python script which I am able to run it locally from my machine and works fine.我有一个 python 脚本,我可以从我的机器本地运行它并且工作正常。 I am using spyder for coding.我正在使用 spyder 进行编码。 This python script needs to run daily at a certain time so I created a basic task under task scheduler.这个python脚本需要每天在某个时间运行,所以我在任务调度程序下创建了一个基本任务。 The way I am doing this is in the action script I am putting my pythonw.exe and I am adding my python script as a action argument.我这样做的方式是在动作脚本中放置我的 pythonw.exe 并将我的 python 脚本添加为动作参数。

The thing is task scheduler triggers the task and script is not producing any outputs.问题是任务调度程序触发任务,脚本不产生任何输出。 I am reading a files from the shared drive in my native file.我正在从我的本机文件中的共享驱动器读取文件。

I also tried to create the batch file and run the batch file but same issue.我也尝试创建批处理文件并运行批处理文件,但同样的问题。 在此处输入图片说明

Not sure what is wrong.不知道出了什么问题。

Can anyone help me with this?谁能帮我这个?

I created the batch file and put that under the task sechduler and it worked fine.我创建了批处理文件并将其放在任务 sechduler 下,它工作正常。 It looks like I had an issues with the access permissions as I have two accounts on my laptop.看起来我的访问权限有问题,因为我的笔记本电脑上有两个帐户。 Thanks Everyone for the help.感谢大家的帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM