MRG.COM

2013-01-04 Thread M.gowtham M.gowtham
comp.lang.python
-- 
http://mail.python.org/mailman/listinfo/python-list


best .lang. python

2013-03-20 Thread M.gowtham M.gowtham
 Any ideas on what to do? 


Stop attempting to negotiate.  Contact your state insurance 
commission.  Be prepared to divulge the name of your insurer.  Keep 
detailed records of all your contacts. 
 - 

- gpsman 
website-->  http://www.win2job.info/
-- 
http://mail.python.org/mailman/listinfo/python-list


comp.lang.python

2013-04-22 Thread M.gowtham M.gowtham
Hi, 
  a few weeks back I posed a question about passing static data to a 
request server, and thanks to some useful suggestions, got it working. I 
see yesterday there is a suggestion to use a framework like Tornado 
rather than base classes. However I can't figure achieve the same effect 
using Tornado (BTW this is all python 2.7). The key point is how to 
access the server class from within do_GET, and from the server class 
instance, to access its get and set methods. 

Here are some code fragments that work with HTTPServer: 

class MyHandler(BaseHTTPRequestHandler): 

 def do_GET(self): 
 ss = self.server 
 tracks = ss.tracks 
. . . 
class MyWebServer(object): 
 def get_params(self): 
 return self.global_params 
 def set_params(self, params): 
 self.global_params = params 
 def get_tracks(self): 
 return self.tracks 
 def __init__(self): 
 self.global_params = "" 
 self.tracks = setup_() 
 myServer = HTTPServer 
 myServer.tracks = self.get_tracks() 
 myServer.params = self.get_params() 
 self.server = myServer(('', 7878), MyHandler) 
 print 'started httpserver on port 7878...' 
. . . . 
def main(): 
 aServer = MyWebServer() 
 aServer.runIt() 

if __name__ == '__main__': 
 main() 





Show trimmed content
website-->  http://www.win2job.info/
-- 
http://mail.python.org/mailman/listinfo/python-list