Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #10385

Re: How can I make a program automatically run once per day?

Date 2011-07-27 08:27 -0400
From Dave Angel <davea@ieee.org>
Subject Re: How can I make a program automatically run once per day?
References (1 earlier) <mailman.810.1310259664.1164.python-list@python.org> <54735121-6a94-4dcb-9f6b-e4fca4aad652@u42g2000yqm.googlegroups.com> <965707ba-5fe2-43cb-853d-f4041a3ba262@e40g2000yqn.googlegroups.com> <mailman.1522.1311733346.1164.python-list@python.org> <cca6b625-9f05-41c8-aaee-2c9a67403438@bl1g2000vbb.googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.1535.1311769675.1164.python-list@python.org> (permalink)

Show all headers | View raw


On 01/-10/-28163 02:59 PM, John Salerno wrote:
> On Jul 26, 9:22 pm, Andrew Berg<bahamutzero8...@gmail.com>  wrote:
>> On 2011.07.26 08:05 PM,JohnSalernowrote:>  Hmm, okay I'm finally trying Task Scheduler, but how do I set it to
>>> run a Python script? It seems to not work, I suppose because it's
>>> running the script but doesn't know how to find Python to run it
>>> properly.
>> Tell it to run the Python interpreter and pass the script as an argument.
>>
>> --
>> CPython 3.2.1 | Windows NT 6.1.7601.17592 | Thunderbird 5.0
>> PGP/GPG Public Key ID: 0xF88E034060A78FCB
> Thank you. I changed it as suggested so that now it runs C:
> \Python32\python.exe extract_songs.py but it still isn't working. A
> DOS prompt flashes real quick as it runs, but when I check the output
> file that is supposed to be written to, nothing new has been added.
> I'm not sure what the problem is now. I know the script itself works
> because I just ran it manually and the output was fine.
>
As Chris pointed out, you probably aren't getting the script's directory 
right.  After all, how can the scheduler guess where you put it?  The 
obvious answer is to use a full path for the script's filename.  Another 
alternative is to fill in the current directory in the appropriate field 
of the scheduler's entry.

I find it useful to only add batch files to the scheduler.  Those batch 
files can do any setup and cleanup necessary.  In this case, the batch 
file might simply set the current directory to the location of the 
script. But it can also pause at the end, so you can read the console 
before it disappears.   Or it could create another file, so you could 
check the timestamp to figure out when it was triggered.

DaveA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How can I make a program automatically run once per day? John Salerno <johnjsal@gmail.com> - 2011-07-09 17:26 -0700
  Re: How can I make a program automatically run once per day? Ben Finney <ben+python@benfinney.id.au> - 2011-07-10 10:40 +1000
  Re: How can I make a program automatically run once per day? Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-09 19:49 -0500
  Re: How can I make a program automatically run once per day? Alexander Kapps <alex.kapps@web.de> - 2011-07-10 03:00 +0200
    Re: How can I make a program automatically run once per day? John Salerno <johnjsal@gmail.com> - 2011-07-09 19:01 -0700
      Re: How can I make a program automatically run once per day? Rafael Durán Castañeda <rafadurancastaneda@gmail.com> - 2011-07-10 10:49 +0200
      Re: How can I make a program automatically run once per day? monkeys paw <monkey@joemoney.net> - 2011-07-14 13:00 -0400
        Re: How can I make a program automatically run once per day? Ian Kelly <ian.g.kelly@gmail.com> - 2011-07-14 11:13 -0600
        Re: How can I make a program automatically run once per day? baloan <baloand@googlemail.com> - 2011-07-27 01:41 -0700
      Re: How can I make a program automatically run once per day? John Salerno <johnjsal@gmail.com> - 2011-07-26 18:05 -0700
        Re: How can I make a program automatically run once per day? Ethan Furman <ethan@stoneleaf.us> - 2011-07-26 19:02 -0700
        Re: How can I make a program automatically run once per day? Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-26 21:22 -0500
          Re: How can I make a program automatically run once per day? John Salerno <johnjsal@gmail.com> - 2011-07-26 21:09 -0700
            Re: How can I make a program automatically run once per day? Chris Angelico <rosuav@gmail.com> - 2011-07-27 16:55 +1000
            Re: How can I make a program automatically run once per day? Dave Angel <davea@ieee.org> - 2011-07-27 08:27 -0400
            Re: How can I make a program automatically run once per day? Chris Angelico <rosuav@gmail.com> - 2011-07-27 22:35 +1000
              Re: How can I make a program automatically run once per day? Billy Mays <81282ed9a88799d21e77957df2d84bd6514d9af6@myhashismyemail.com> - 2011-07-27 08:58 -0400
                Re: How can I make a program automatically run once per day? John Salerno <johnjsal@gmail.com> - 2011-07-27 09:03 -0700
  Re: How can I make a program automatically run once per day? Paul Rudin <paul.nospam@rudin.co.uk> - 2011-07-10 11:21 +0100

csiph-web