【发布时间】:2009-11-17 07:58:09
【问题描述】:
我想做这样的事情:
def main():
"""
Display Information about a Google Calendar
-u --user login Google Login
-p --pass password Google Password
-d --debug Set DEBUG = True
-h --help Display this help
"""
print(__doc__)
if __name__ == "__main__":
main()
但答案是:None ... 为什么?
【问题讨论】:
-
好的,我正在使用 getopt。但是为了这个目的 optparse 应该更好。
标签: python documentation-generation command-line-interface