Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

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 April 4th, 2004, 11:55 PM
roypython roypython is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 71 roypython User rank is Lance Corporal (50 - 100 Reputation Level)roypython User rank is Lance Corporal (50 - 100 Reputation Level)roypython User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 h 20 m 49 sec
Reputation Power: 10
creating Http agent wrapped as windows service

Hi.
I want to write app for win32 , and I don't know which tools to use.
Basically the requirments are:
1. Platform - win2000
2. the app is loaded automatically when the OS starts,
2. The app contains simple Http agent, that is able to retieve info from
web site, and to check whether a certain information is contained in
the response.
3. The app should have an icon in the task bar.
4. The icon on the task bar is capable of opening windows when clicked
4. An install program for the app.

Now, I don't know much about tools in python, and for some it very hard to get documentation.
I thought of the following architecture:
1. Using win services in order to start the app automatically.
2. Using socket.py . ( Is there any way to use WinSock?)
3. I do not know which tool to use to create install program and
opening windows functinality.
I'll appreciate any direction / lead,
thank a lot
Roy

Reply With Quote
  #2  
Old April 5th, 2004, 03:08 AM
DevCoach DevCoach is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2004
Location: London, England
Posts: 1,585 DevCoach User rank is General 6th Grade (Above 100000 Reputation Level)DevCoach User rank is General 6th Grade (Above 100000 Reputation Level)DevCoach User rank is General 6th Grade (Above 100000 Reputation Level)DevCoach User rank is General 6th Grade (Above 100000 Reputation Level)DevCoach User rank is General 6th Grade (Above 100000 Reputation Level)DevCoach User rank is General 6th Grade (Above 100000 Reputation Level)DevCoach User rank is General 6th Grade (Above 100000 Reputation Level)DevCoach User rank is General 6th Grade (Above 100000 Reputation Level)DevCoach User rank is General 6th Grade (Above 100000 Reputation Level)DevCoach User rank is General 6th Grade (Above 100000 Reputation Level)DevCoach User rank is General 6th Grade (Above 100000 Reputation Level)DevCoach User rank is General 6th Grade (Above 100000 Reputation Level)DevCoach User rank is General 6th Grade (Above 100000 Reputation Level)DevCoach User rank is General 6th Grade (Above 100000 Reputation Level)DevCoach User rank is General 6th Grade (Above 100000 Reputation Level)DevCoach User rank is General 6th Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Weeks 4 Days 2 h 58 m 23 sec
Reputation Power: 1372
Quote:
Originally Posted by roypython
...
Now, I don't know much about tools in python, and for some it very hard to get documentation.
I thought of the following architecture:
1. Using win services in order to start the app automatically.

Yep. If you have Win32All or Activestate Python installed then you have full control over creating a Windows service. An alternative is to create a normal Python app and install a shortcut to it in the 'Startup' menu. This gives less control that an NT service, but will also work on Windows 95 & 98.

Quote:
Originally Posted by roypython
2. Using socket.py . ( Is there any way to use WinSock?)

The socket module calls WinSock directly, but is far too low level for what you want. Take a look at urllib and urllib2 in the standard library - they provide a high level API for downloading files over HTTP.

Quote:
Originally Posted by roypython
3. I do not know which tool to use to create install program and
opening windows functinality.
I'll appreciate any direction / lead,
thank a lot
Roy


For creating the windows and the icon in the task bar you could use the win32api and win32gui modules in Win32All, but that is hard going. Alternatively you could install and use wxPython, which provides a higher level interface. It is still a steep learning curve if you have never done any Windows programming before. Or you could possibly use TkInter which is a lot simpler, but I don't know if it has the ability to create the taskbar icon.

For the installation, you will need to compile you program into a stand-alone executable using py2exe, then you can use any of the myriad installers that are available.

Dave - The Developers' Coach

Reply With Quote
  #3  
Old April 5th, 2004, 03:39 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: 12
Send a message via MSN to Grim Archon
I recommend the following. (There is a lot of learning to do here):

You don't need to go so low level as socket.py - use httplib.

Gui - wxPython (using wxTaskBarIcon) but if you know MFC then Pythonwin might be a place to look.

To create a standalone executable application - use py2exe.

I distribute apps as a self extracting archive using PowerArchiver but there are many similar programs e.g. Winzip. I've not used it but, for a full Windows installer you could try Inno.

If you must make it a service then use Win32 extensions - specifically win32serviceutil.ServiceFramework Class. But why, what service does this application provide?

Have fun
Grim
__________________
*** Experimental Python Markup CGI V2 ***

Reply With Quote
  #4  
Old April 7th, 2004, 02:30 AM
roypython roypython is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 71 roypython User rank is Lance Corporal (50 - 100 Reputation Level)roypython User rank is Lance Corporal (50 - 100 Reputation Level)roypython User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 h 20 m 49 sec
Reputation Power: 10
Results..

Thanks.
That was excellent advices.
Creating simple HTTP agent is very simple with urllib.
Creating GUI ( even multi-platfrom!!) and task bar icons with wxPython is great.
As to your question Grim,
this http agent checks periodically (wxTimer) the web server for data for that specific client ( the http agent sends unique id that identifies him as a client), and if there is a new
msgs for that user, it opens a window(that contains wx.lib.iewin to show the msgs for that client)
Again, thanks a lot for your great help.
Roy

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > creating Http agent wrapped as windows service

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap