windows - Python wont run with Task Scheduler but will run normally? -


For any reason, who completely kills my mind, I have a python program that works for me When I have to work the windows task scheduler run it. I have updated the program right now, and it went successfully before all time, now every time it fails.
The odd thing is that if I run the dragon script independent of the job planner, then it works fine!

The main difference between the old program and the new program is that the URLBreak is used old and runs with the new OpenOpen (), OSListDeeper, and OSPITH. When I run the program through it, the scheduler of the windows, the result on timeliness tells that (??? xx1) is a ???? And a Windows CMD window also says:

  traceback & lt; The most recent call is Last>: File: C: \ User \ User \ Document \ Python \ Test \ Customer \ Beige.pyĆ¢ € ™ , FileNotFoundError: [WinError3] The system can not find a specified path: a website website   

So, basically, the file name (file_Contact) for file name in (modules) os.listdir in line 16, When I run the program directly, it uses the external .txt file properly, but it does not work from the scheduler? I need help Anyone else has any experience with it?

(I know that I can only store a TDT file in a single directory, not a subdir, but I have another program in which the textile file can be modified day) < / P>

Ensure that you are using the full path in your program, and are not relative. Task Schedulers may be running your program from a different directory, and if your program has relative paths, then it is not able to find them. An easy way around it is to put the following line at the top of your program (assuming you have already imported os ):

  os .chdir ("c   

Now, all the commands given below are running from this directory, and the relative path should work. < / P>

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -