【发布时间】:2010-12-09 22:36:05
【问题描述】:
有没有可以这样运行的程序:
py2py.py < orig.py > smaller.py
其中 orig.py 包含带有 cmets 和 doc 字符串的 python 源代码,smaller.py 包含相同的、可运行的源代码但没有 cmets 和 doc 字符串?
最初看起来像这样的代码:
#/usr/bin/python
"""Do something
blah blah...
"""
# Beware the frubnitz!
def foo(it):
"""Foo it!"""
print it # hmm?
然后看起来像这样:
def foo(it):
print it
【问题讨论】:
标签: python comments code-formatting