Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 31st, 2004, 06:43 PM
karlovac karlovac is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 40 karlovac User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Running a win32 com Python script from Cygwin cron

I'm trying to run a Python script from a Cygwin cron job. Here's my Python script:

Code:
import win32com.client, time
ie = win32com.client.Dispatch( "InternetExplorer.Application" )
time.sleep( 3 )
ie.Visible = 1


And here's the command I run:

Code:
/cygdrive/c/Python22/python.exe c:\\Laszlo\\sandbox\\antun\\opener.py 2>&1 > /tmp/smelly


I can run the above command with no problems from the Cygwin Bash shell. The Internet Explorer window opens up.

However, when I run it from a cron job, the iexplore.exe service does start (I can see it in the Windows Task Manager), but the window never becomes visible. The /tmp/smelly file (which should contain any output) is empty.

Any ideas?

Thanks,

Antun

Reply With Quote
  #2  
Old June 24th, 2004, 12:50 PM
moiseyo moiseyo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 1 moiseyo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 sec
Reputation Power: 0
Exclamation I ran something like this successfully fro Windows scheduling

use like

my.cmd

-----------------------------------------------
REM My.cmd file
c:\cygwin\bin\bash -login ~/bin/mysript.sh param1 param2
----------------------------------------------------

It runs from you user directory,

I'd but this cmd file in my widows job

Runs perfectly

Moisey o.

Reply With Quote
  #3  
Old August 6th, 2004, 04:54 PM
karlovac karlovac is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 40 karlovac User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Thumbs up

Thank you! That worked. I know it's been a while, but I had shelved this project, and have only just found the time to implement it. It's working perfectly now.

-Antun

Quote:
Originally Posted by moiseyo
use like

my.cmd

-----------------------------------------------
REM My.cmd file
c:\cygwin\bin\bash -login ~/bin/mysript.sh param1 param2
----------------------------------------------------

It runs from you user directory,

I'd but this cmd file in my widows job

Runs perfectly

Moisey o.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Running a win32 com Python script from Cygwin cron


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT