[Tutor] threads and webpy

anil maran anilmrn at yahoo.com
Thu Aug 17 11:15:30 CEST 2006


hi like
your post about how to make it listen on one ip and then on two ips 
isnt this general python, can you please explain how to go about this, this would be very useful
thanks

 then show us your code and we'll tell you
how to make it into a class that listens on a single IP and how to
start two listen() methods of the class using threads, or maybe even
handling multiple IPs using a single class instance.
But just knowing that you are using 'web.py' isn't very helpful.
What actual code are you using to run the webserver?
(Or maybe web.py contains a simple webserver in the module when it's 
run 
as main?)
HTH,
-Luke


Luke Paireepinart <rabidpoobear at gmail.com> wrote: 
> yes - i will ask the webpy authors
>
> but i expected to fond out a way to start two (or more)
> scripts (web.py) in different threads from one puthon's
> scrypt. OR two pythons interpretators to execute the above
> scrypt ?
>   
Python is a programming language. It's not a question about whether it's 
possible;
rather, it's who will do it.  If all you really want to do is start 2 
web.py scripts
from one python script you'd do something like this:
# ---- (non-working code)
import subprocess
subprocess.Popen('python web.py')
subprocess.Popen('python web.py')
#-----
This may or may not work.  You may only be able to subprocess actual 
executable files.
This is probably not what you want to do, though.
You'll probably have to learn how to program in Python to do this.
 ... ... ... ... ... ...

I just looked at web.py.
It's not a webserver.  It's a toolkit you use to write your own webserver.
Why are you under the impression that it's a webserver?
Did you just google for 'web server in Python' and find this?
If you're using some code that you've written (or found) to handle web 
requests
using the 'web.py' module, then show us your code and we'll tell you
how to make it into a class that listens on a single IP and how to
start two listen() methods of the class using threads, or maybe even
handling multiple IPs using a single class instance.
But just knowing that you are using 'web.py' isn't very helpful.
What actual code are you using to run the webserver?
(Or maybe web.py contains a simple webserver in the module when it's run 
as main?)
HTH,
-Luke

> cheers
> e.
>
>
> -----------------------------
>
> Êîëèòå. Ñàìî â êèíàòà îò 4 àâãóñò.
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>   

_______________________________________________
Tutor maillist  -  Tutor at python.org
http://mail.python.org/mailman/listinfo/tutor


 				
---------------------------------
Do you Yahoo!?
 Next-gen email? Have it all with the  all-new Yahoo! Mail Beta.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060817/544a4e12/attachment.htm 


More information about the Tutor mailing list