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 November 30th, 2004, 08:20 PM
ah new ah new is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 40 ah new User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 1 m 21 sec
Reputation Power: 5
Question py2exe cant work in services?

hello!

i was wrote some script in python (hello.py)
then, i was convert it into .exe file with py2exe (hello.exe)
then, i try to call the .exe inside a window service code with
os.system("hello.exe")
but i found that it doesnt work when i execute the service!

my question is what are the reasons that cause the "call exe" cant work?

i'm using py2.3 + winXP Pro

thanks for advice...
ah new

Reply With Quote
  #2  
Old December 1st, 2004, 04:40 AM
Grim Archon's Avatar
Grim Archon Grim Archon is offline
Mini me.
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2003
Location: Cambridge, UK
Posts: 783 Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)  Folding Points: 1488 Folding Title: Novice Folder
Time spent in forums: 3 Days 2 h 15 m 57 sec
Reputation Power: 8
Send a message via MSN to Grim Archon
From your cross post it looks like your service has failed to import the os module. Have you looked at the import os statement in your code.

My reference book suggests that services should only communicate using Windows NT Event log or via simple dialogs.

I'm guessing here but I don't think services will have stdout or stdin which means that printing and input will fail - any print statments before your import os command could cause you problems. This might also apply to sub-processes.

grim
__________________
*** Experimental Python Markup CGI V2 ***

Reply With Quote
  #3  
Old December 1st, 2004, 07:58 PM
ah new ah new is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 40 ah new User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 1 m 21 sec
Reputation Power: 5
the "import os" is the 1st line in my program ("hello.py")
the problem is seems all imported cant be load when i convert the file to .exe ("hello.exe")
any other ideas?

ah new...

Reply With Quote
  #4  
Old December 2nd, 2004, 04:42 AM
Konstandinos Konstandinos is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: Cape Town, South Africa
Posts: 131 Konstandinos User rank is Corporal (100 - 500 Reputation Level)Konstandinos User rank is Corporal (100 - 500 Reputation Level)Konstandinos User rank is Corporal (100 - 500 Reputation Level)Konstandinos User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 22 h 40 m 25 sec
Reputation Power: 7
Pasting the code would help.

It sounds like you're dealing with relatively simple programs. Why not just paste the code here, I'm betting there's a tiny bug somewhere waiting to be squished.

Cheers,
K

ps: don't forget to format the code properly in your post.

Reply With Quote
  #5  
Old December 2nd, 2004, 08:41 PM
ah new ah new is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 40 ah new User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 1 m 21 sec
Reputation Power: 5
yeah!
the problem been solve after i add the library zip file inside the dist folder to the sys path.
but another problem was come to surface...
the traceback...
File "xml\sax\sax2exts.pyc", line 37, in make_parser
File "xml\sax\saxexts.pyc", line 77, in make_parser
xml.sax._exceptions.SAXReaderNotAvailable: No parsers found
....
any ideas about it?
ps: i was installed PyXML..

thanks for advices ;-)

ah new ...

Reply With Quote
  #6  
Old December 3rd, 2004, 04:09 AM
Konstandinos Konstandinos is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: Cape Town, South Africa
Posts: 131 Konstandinos User rank is Corporal (100 - 500 Reputation Level)Konstandinos User rank is Corporal (100 - 500 Reputation Level)Konstandinos User rank is Corporal (100 - 500 Reputation Level)Konstandinos User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 22 h 40 m 25 sec
Reputation Power: 7
Howdy

I have no personal experience in the matter but I bet this will help:

http://www.oreillynet.com/cs/user/view/cs_msg/22143

Good luck,
K

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > py2exe cant work in services?


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 1 hosted by Hostway
Stay green...Green IT