Python > Ruby

This commit is contained in:
Toidinamai 2007-11-14 20:26:39 +00:00
parent fbe364d506
commit 6b2a2119e9
1 changed files with 23 additions and 1 deletions

View File

@ -1,4 +1,26 @@
[[Category:Ruby]]
[[Category:Ruby]] [[Category:Python]]
=Python=
<source lang="python">
#!/usr/bin/env python
import sys
from twisted.internet import reactor
from twisted.web import server, static
if len(sys.argv) != 3:
print "Usage: %s <port> <dir>" % (sys.argv[0],)
sys.exit()
root = static.File(sys.argv[2])
site = server.Site(root)
reactor.listenTCP(int(sys.argv[1]), site)
reactor.run()
</source>
=Ruby=
<source lang="ruby">
#!/usr/local/bin/ruby