Python语言本身是没有注释多行的支持的,如果需要注册多行,可以用一个取巧的方法,就是把需要注释的代码块用三个括号括起来,赋值为一个永远都不会使用的字符串变量,例如:

1
2
3
4
5
6
7
8
9
10
11
12
13
__devilcomment = '''
if bCmpLog == "True":
        self.appendAdsLogToCmpLog("")
 
if bCmpBinaryLog == "True":
        self.appendBinaryAdsLogToCmpLog(res)
 
if bCompareResp == "True":
    self.appendResponseToCmpLog(response_strs)
 
print "move new and debug logs"
self.tools.move (src_db,dst_db)
'''
Share and Enjoy:
  • RSS
  • Google Bookmarks
  • Digg
  • del.icio.us
  • Facebook
  • 豆瓣
  • 豆瓣九点
  • FriendFeed
  • LinkedIn
  • Live
  • Ping.fm
  • QQ书签
  • Twitter

Related posts:

  1. 用PDB库调试Python程序
  2. 《Software Testing》第十五章 – 自动化测试和测试工具