home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import IPython.ipapi as IPython
- ip = IPython.ipapi.get()
- import SocketServer
- PORT = 8099
-
- class IPythonRequestHandler(SocketServer.StreamRequestHandler):
-
- def handle(self):
- inp = self.rfile.read().replace('\r\n', '\n')
- ip.runlines(inp)
-
-
-
- def serve(port = PORT):
- server = SocketServer.TCPServer(('', port), IPythonRequestHandler)
- print 'ipy_server on TCP port', port
- server.serve_forever()
-
-
- def serve_thread(port = PORT):
- import thread
- thread.start_new_thread(serve, (port,))
-
-