- 2012.09.16
- PyCon JP 2012
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ./test 100 | |
module Main where | |
import System | |
main = do | |
max <- getArgs | |
print (test (read (head max)::Integer)) | |
test :: Integer -> Integer | |
test 1 = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from ginkgo import Service | |
from ginkgo.async.gevent import WSGIServer | |
from geventwebsocket.handler import WebSocketHandler | |
from flask import Flask, render_template | |
class WebSocket(Service): | |
def __init__(self): | |
self.add_service(WSGIServer(('127.0.0.1', 8001), self.handle, | |
handler_class=WebSocketHandler)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- encoding: utf-8 -*- | |
import sys | |
from optparse import OptionParser | |
def main(): | |
parser = OptionParser() | |
parser.add_option("-f", "--file", dest="filename", help="filename") | |
parser.add_option("-c", "--color", dest="is_color", action="store_true", default=False, help="color on") |