[Tutor] How to write server which listens to specific port
Dear All, Greetings I have developed an application in Python 2.4.2, TurboGears 1.0, cherryPy 2.3.1. Now, I have to develop a server, which listens to a specific port (104) and save the file to a specific location (/tmp/myDir) on RHEL 4/5. Guide me how to do that. what all packages I have to use. Thanks in anticipation. Shiv _ The new Windows Live Messenger. You don’t want to miss this. http://www.microsoft.com/india/windows/windowslive/messenger.aspx___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] How to write server which listens to specific port
Thanks Alan for reply. I have to implement HL7 in my existing application. so, I have to send/receive messages which are in a text file (not implementing v3.0, in which the messages are in xml format) I found tutorial on socket programming and trying from that. By importing socket. I am not sure about how to send the files. (not yet) How can we configure in TurboGears to send and receive files? The protocol I want to use is TCP/IP v4 Operating system is RHEL 5 Regards, Shiv > To: tutor@python.org > From: alan.ga...@btinternet.com > Date: Fri, 10 Apr 2009 09:23:36 +0100 > Subject: Re: [Tutor] How to write server which listens to specific port > > > "ShivKumar Anand" wrote > > > I have developed an application in Python 2.4.2, TurboGears 1.0, cherryPy > > 2.3.1. > > Well done. > > > Now, I have to develop a server, which listens to a specific port (104) > > and save the file to a specific location (/tmp/myDir) on RHEL 4/5. > > Does this server have anything to do with your TurboGears application? > Or is it something brand new? Turbo gears can be configured to use > any port using the config files. > > If its new, what protocol are you using? Is it http or tcp/ip or raw IP > or something else? > > > Guide me how to do that. what all packages I have to use. > > At the most basic level you can use the socket module and do it all > from scratch, but if its a higher lervel protocol there may be higher level > modules already written that will help. > > We need to know a lot more about the problem and the > environment - what kind of computer/OS etc. > > > -- > Alan Gauld > Author of the Learn to Program web site > http://www.alan-g.me.uk/ > > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor _ Twice the fun—Share photos while you chat with Windows Live Messenger. http://www.microsoft.com/india/windows/windowslive/messenger.aspx___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] How to write server which listens to specific port
Thanks Kent for this valuable information. My problem is I dont know how to send/receive a file using socket. How to get the filename specifically. Thanks Shiv > Date: Fri, 10 Apr 2009 06:56:34 -0400 > Subject: Re: [Tutor] How to write server which listens to specific port > From: ken...@tds.net > To: shiv_...@hotmail.com > CC: tutor@python.org > > On Fri, Apr 10, 2009 at 4:59 AM, ShivKumar Anand wrote: > > > I have to implement HL7 in my existing application. > > so, I have to send/receive messages which are in a text file (not > > implementing v3.0, in which the messages are in xml format) > > Googling "python hl7" finds a couple of hints for the server and a > message parser: > http://mail.python.org/pipermail/python-list/2007-March/600733.html > http://pypi.python.org/pypi/hl7/0.1.0 > > > How can we configure in TurboGears to send and receive files? > > > > The protocol I want to use is TCP/IP v4 > > I don't think you can use TurboGears / CherryPy to create a server > that is not HTTP-based. For that look at socketserver or > asyncore/asynchat in the std lib or Twisted. > > Kent _ How fun is this? IMing with Windows Live Messenger just got better. http://www.microsoft.com/india/windows/windowslive/messenger.aspx___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] installing Turbogears without using Internet
hello Tutors, I want solution to my problem. I want to install Turbogears and Cherrypy without using internet. means that locally is i have eggs. how it is possible? Shiv Kumar _ Palate Teasers: Straight from Master Chef! http://content.msn.co.in/Lifestyle/Moreonlifestyle/LifestylePT_101106_1530.htm___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] ImportError: No module named _apache
dear all, I am trying to implement a text from mod_python manual. the code is: from mod_python import apache def handler(req):req.content_type ="text/plain\n\n" req.send_http_header()req.write("Hello World!!!")return apache.ok and the conf file of apache is having AddHandler mod_python .py PythonHandler SoapTest PythonDebug On I am getting this error message: Traceback (most recent call last): File "C:\Python24\exp\Web\SoapTest.py", line 1, in ?from mod_python import apache File "C:\Python24\lib\site-packages\mod_python\apache.py", line 28, in ?import _apacheImportError: No module named _apache where as i have mod_python installed and there is apache.py file also in the mod -python dir. Pls give me solution. Thanks Shiv _ Sign in and get updated with all the action! http://content.msn.co.in/Sports/FormulaOne/Default___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] PythonHandler mpcp: AttributeError: 'module' object has no attribute 'argv'
dear all, I am trying to run turbogears application using Apache on windows and the start_prj.py is from os.path import *import sys #if len(sys.argv) > 1:#update_config(configfile=sys.argv[1], modulename="wiki30.config") sys.argv[0]="d:/web/Wiki-30"sys.argv[1]="d:/web/Wiki-30/dev.conf" if exists(join(dirname(__file__), "setup.py")): cherrypy.config.update(file=join(dirname(__file__),"d:/web/Wiki-30/dev.cfg"))else: cherrypy.config.update(file=join(dirname(__file__),"d:/web/Wiki-30/prod.cfg")) from wiki30.controllers import Rootcherrypy.root =Root()if __name__ == "__main__": cherrypy.server.start() def mp_setup(): pass if __name__!="__main__":#ie imported this from apacheimport kid kid.path.insert(dirname(__file__))#or:#kid.path.insert("D:\\") # or whatever= The Apache httpd.conf settings are like this: ServerName 'localhost' PythonPath "['D:/web/wiki-30/'] +sys.path" SetHandler mod_python PythonHandler mpcp PythonOption cherrysetup startwiki30::mp_setup and when I am trying to access the page from http://localhost it is giving PythonHandler mpcp: AttributeError: 'module' object has no attribute 'argv' pls help to come out of this. Thanks Shiv Kumar _ The idiot box is no longer passe! http://content.msn.co.in/Entertainment/TV/Default.aspx___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Image Matching
Hello!! Everyone, I have to match two images and tell how much identical they are. I am trying with Python Imaging Library 1.2.6, but not able to do it I am using ImageChops.difference(im1, im2).histogram() and trying to achieve. regards Shiv Kumar _ Searching for the best deals on travel? Visit MSN Travel. http://msn.coxandkings.co.in/cnk/cnk.do___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] unable to import Image module from my application
I am using Python Image library on windows and it is running well. I am using RHEL E4 on another machine and when I installed "python-imaging-1.1.6-2.el4.rf.i386.rpm", still i am not able to call the Image and ImagOps modules from my application on this Linux machine. After that --I manually added Imaging1.1.4 folder in /usr/lib/Python2.4/site-packages and added entry in easy_install.pth. After that, I am able to import the modules from python prompt, but still I am not able to import from my application. I am not able to figure out the exact reason for this. Kindly guiide me. Thanks in anticipation. Shiv _ Search for videos of Bollywood, Hollywood, Mollywood and every other wood, only on Live.com http://www.live.com/?scope=video&form=MICOAL___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor