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 python2.7 | |
#-*- coding: utf-8 -*- | |
""" | |
用形如(father, child)的一组 tuple 来描述结构 | |
本程序会输出其可视化的树状结构 | |
有 pprint 和 tprint 两种格式的输出 | |
示例输入: |
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
#-*- coding: utf-8 -*- | |
""" | |
给定集合 test_case | |
输出其所有子集 | |
""" | |
def getsubs(father, size): | |
"""获取集合 father 的 | |
指定长度 size 的所有子集合""" |
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 python2.7 | |
#-*- coding: utf-8 -*- | |
""" | |
多线程模拟用户请求 | |
向本地端口1234 POST JSON格式数据 | |
""" | |
from urllib import urlopen, quote_plus | |
from threading import Thread |
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 python2.7 | |
#-*- coding: utf-8 -*- | |
""" | |
删除 C 语言源文件中的注释 | |
并统计每个文件中包含注释的行数 | |
能够处理被续行符分割开的特殊情况: | |
CASE 1: |