Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'cpython': 0.05; 'suppose': 0.05; 'cleanup': 0.07; 'interpreter': 0.07; 'python': 0.08; 'okay': 0.09; 'properly.': 0.09; 'skip:\\ 20': 0.09; 'output': 0.11; 'wrote:': 0.15; '3.2.1': 0.16; 'filename.': 0.16; 'pause': 0.16; 'runs,': 0.16; 'thunderbird': 0.16; 'timestamp': 0.16; 'cc:addr:python-list': 0.16; 'pm,': 0.16; '>>>': 0.16; 'written': 0.17; 'script.': 0.19; 'working.': 0.19; 'work,': 0.20; 'appropriate': 0.20; 'seems': 0.20; 'figure': 0.21; 'cc:2**0': 0.21; "aren't": 0.22; 'file,': 0.22; 'pointed': 0.22; 'cc:no real name:2**0': 0.22; "doesn't": 0.22; 'header:In-Reply-To:1': 0.22; 'trying': 0.23; 'end,': 0.23; 'runs': 0.23; 'changed': 0.25; 'windows': 0.26; "i'm": 0.27; 'pass': 0.28; 'guess': 0.28; 'right.': 0.28; 'all,': 0.28; 'script': 0.29; 'fine.': 0.29; 'subject:skip:a 10': 0.29; 'problem': 0.29; 'id:': 0.29; 'cc:addr:python.org': 0.30; 'ran': 0.30; 'subject:per': 0.30; 'subject:?': 0.31; 'chris': 0.32; 'andrew': 0.32; 'necessary.': 0.32; 'header:User-Agent:1': 0.34; 'it?': 0.34; 'thank': 0.35; "isn't": 0.35; 'probably': 0.35; 'running': 0.35; 'supposed': 0.35; 'subject:How': 0.36; 'file': 0.36; 'useful': 0.37; 'but': 0.37; 'could': 0.37; 'another': 0.38; 'getting': 0.38; 'received:192': 0.38; 'subject:can': 0.38; 'subject:: ': 0.38; 'put': 0.38; 'case,': 0.38; 'run': 0.39; 'received:192.168.1': 0.39; 'manually': 0.39; 'might': 0.39; 'where': 0.40; 'setup': 0.40; 'you.': 0.62; 'john': 0.62; 'full': 0.63; '26,': 0.67; 'subject:program': 0.67; 'batch': 0.68; 'subject:day': 0.68; 'alternative': 0.70; 'header:Reply-To:1': 0.71; 'reply-to:no real name:2**0': 0.72; 'subject:make': 0.73; '02:59': 0.84; '08:05': 0.84; '5.0': 0.84; 'flashes': 0.91 Date: Wed, 27 Jul 2011 08:27:29 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 MIME-Version: 1.0 To: John Salerno Subject: Re: How can I make a program automatically run once per day? References: <54735121-6a94-4dcb-9f6b-e4fca4aad652@u42g2000yqm.googlegroups.com> <965707ba-5fe2-43cb-853d-f4041a3ba262@e40g2000yqn.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:p6a+NfZPMC4VkViR1ZQFCi4YQQ62CNsU/0jxN0XLYmJ WAkvsoVuFtS3TcboPxOyG+oSE1K/nCdnCK78LmGcrUAAXCo59/ SiLVNCE/e2WHcbew/rWElFaf0CPCJIvz+mo8p6sZWkempB9B/6 acCEvx/EEJ6P41QC6+NloacqAcyQUX8tquwkyh5zbgL1A46S3J /G2o00j2uytuV7Qaj6EAg== Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: davea@ieee.org List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1311769675 news.xs4all.nl 23943 [2001:888:2000:d::a6]:37431 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:10385 On 01/-10/-28163 02:59 PM, John Salerno wrote: > On Jul 26, 9:22 pm, Andrew Berg 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