usr bin env python import os import sys sys path insert home piranha d

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python
import os
import sys
sys.path.insert(0, '/home/piranha/dev/web/yield/ypy/src/py')
#from ypy.platform.sockets.socket_server_admin import yield_; SocketServerAdmin = yield_.SocketServerAdmin
#SocketServerAdmin.SetTraceSocketIO( True )
import ypy
from ypy.wsgi import make_server
def application(environ, start_response):
start_response('200 OK', [('Content-type', 'text/plain')])
return ['Hello here']
try:
port = int(sys.argv[1])
except:
port = 8080
make_server('localhost', port, application)
ypy.run()