通过实例学习python三引号制作doc文档,有需要的朋友可以参考下。
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# 三引号制作doc文档
class Help:
'''
This is a program for backup mysql.
It used for mysqlhotcopy.
If you have a ramdisk, you can use it.
And it will make your system!
'''
def Usage():
'''
Usage: backup [-P] [-L] [-h] [--local]
-P --passwd change your password.
-L --local backup database to local disk.
-h --help print this help message.
'''
print Help.__doc__
print Help.Usage.__doc__