hotnet 发表于 2018-8-15 11:58:08

Python编程模板

#!/usr/bin/env python  
#-*- encoding:utf8 -*-
  
#---------------------------------------------------------------------------------------
  
#         FILE:
  
#          USAGE:    Plog.py [-h]
  
#    DESCRIPTION:    Copy python style guide and coding standard .
  
#                  The default copy example is the current text .
  
#                  Dont.t find text on other directories .
  
#      OPTIONS:    see fuction 'usage' below
  
#         BUGS:    ---
  
#      VERSION:    1.0
  
#      PROJECT:    XXX
  
#      COPYRITHT:    Copyright(c)2002-2020 Python, All Rights Reserved
  
#---------------------------------------------------------------------------------------
  

  
# import python module
  

  
#---------------------------------------------------------------------------------------
  
#   define python import modules .
  
#---------------------------------------------------------------------------------------
  

  
#   Python Class comments
  

  
#========   CLASS   ====================================================================
  
#          NAME:
  
#   DESCRIPTION:    Display usage information for this script.
  
#PARAMETER1:    ---
  
#=======================================================================================
  

  

  
#   Python main comments
  

  
#---------------------------------------------------------------------------------------
  
#   define python main .
  
#---------------------------------------------------------------------------------------
  

  
if __name__ == "__main__":
  
    #格式化打印
  
    star="\033[1;33;40m=\033[0m"
  
    rx="\033[1;31;40m"
  
    ry="\033[0m"
  
    gx="\033[1;32;40m"
  
    gy="\033[0m"
  
    nowStamp = int(time.time())
  
    nowtime = datetime.datetime.now()
  
    agotime = nowtime - datetime.timedelta(seconds = 0)
  
    agoctime = str(agotime.ctime())
页: [1]
查看完整版本: Python编程模板