This file contains hidden or 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 | |
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE | |
# Written by Nathan Hamiel (2010) | |
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler | |
from optparse import OptionParser | |
class RequestHandler(BaseHTTPRequestHandler): | |
def do_GET(self): |
This file contains hidden or 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
# -*- coding:utf8 -*- | |
u""" | |
函数apply的时候,传入的数据叫做arguments | |
arguments分为两种传入方式,按位置positional,按关键字keywords | |
函数define的时候,指定的参数列表叫做params,对这个列表的描述,叫做params spec,简称spec | |
""" | |
import inspect |
This file contains hidden or 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
# -*- coding:utf8 -*- | |
from functools import wraps | |
from time import sleep | |
from random import random | |
import logging | |
from curry import curry | |
logger = logging.getLogger('retry') | |
error_logger = logging.getLogger('retry.error') |
This file contains hidden or 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 | |
# -*- coding:utf8 -*- | |
import re | |
import click | |
@click.command() | |
@click.argument('movie') | |
@click.option('-S', '--split-file', 'split_file') |
This file contains hidden or 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 thread | |
def thread_func(cls): | |
a = cls() | |
# do something with a .... | |
def work(): | |
class DefineClass: | |
pass | |
print id(DefineClass) |