The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> Python Programming
|
creating Http agent wrapped as windows service
Discuss creating Http agent wrapped as windows service in the Python Programming forum on Dev Shed. creating Http agent wrapped as windows service Python Programming forum discussing coding techniques, tips and tricks, and Zope related information. Python was designed from the ground up to be a completely object-oriented programming language.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

April 4th, 2004, 11:55 PM
|
|
Contributing User
|
|
Join Date: Feb 2004
Posts: 71
 
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
|

April 5th, 2004, 03:08 AM
|
|
Contributing User
|
|
Join Date: Feb 2004
Location: London, England
|
|
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
|

April 5th, 2004, 03:39 AM
|
 |
Mini me.
|
|
Join Date: Nov 2003
Location: Cambridge, UK
|
|
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
|

April 7th, 2004, 02:30 AM
|
|
Contributing User
|
|
Join Date: Feb 2004
Posts: 71
 
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
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|