当前位置: 首页>>代码示例>>Python>>正文


Python _version.__version__方法代码示例

本文整理汇总了Python中_version.__version__方法的典型用法代码示例。如果您正苦于以下问题:Python _version.__version__方法的具体用法?Python _version.__version__怎么用?Python _version.__version__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在_version的用法示例。


在下文中一共展示了_version.__version__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: welcome

# 需要导入模块: import _version [as 别名]
# 或者: from _version import __version__ [as 别名]
def welcome():
  print("")
  print("**************************"+"*"*len(__version__))
  print("*** WELCOME to gFlex v"+__version__+" ***")
  print("**************************"+"*"*len(__version__))
  print("") 
开发者ID:awickert,项目名称:gFlex,代码行数:8,代码来源:gflex.py

示例2: get_cmd_args

# 需要导入模块: import _version [as 别名]
# 或者: from _version import __version__ [as 别名]
def get_cmd_args():
    """Get, process and return command line arguments to the script
    """
    help_description = '''
Smart Image Renamer

Rename your photos in bulk using information stored in EXIF.
'''

    help_epilog = '''
Format string for the file name is defined by a mix of custom text and following tags enclosed in {}:
  YYYY        Year
  MM          Month
  DD          Day
  hh          Hours
  mm          Minutes
  ss          Seconds
  Seq         Sequence number
  Artist      Artist
  Make        Camera Make
  Model       Camera Model
  Folder      Parent folder of the image file
  File        Current Filename

Examples:
  Format String:          {YYYY}-{MM}-{DD}-{Folder}-{Seq}
  File Name:              2014-05-09-Wedding_Shoot-001.JPEG
                          2014-05-09-Wedding_Shoot-002.JPEG

  Format String:          {YYYY}{DD}{MM}_{Model}_Beach_Shoot_{Seq}
  File Name:              20140429_PENTAX K-x_Beach_Shoot_001.JPEG
                          20140429_PENTAX K-x_Beach_Shoot_002.JPEG
    '''

    parser = argparse.ArgumentParser(description=help_description,
                                     formatter_class=argparse.RawTextHelpFormatter,
                                     epilog=help_epilog)
    parser.add_argument('-f', dest='format', required=True, type=str,
                        help='Format of the new file name')
    parser.add_argument('-s', dest='sequence', type=int, default=1,
                        help='Starting sequence number (default: 1)')
    parser.add_argument('-r', dest='recursive', default=False,
                        action='store_true',
                        help='Recursive mode')
    parser.add_argument('-i', dest='hidden', default=False,
                        action='store_true', help='Include hidden files')
    parser.add_argument('-c', dest='copy', default=False,
                        action='store_true', help='Copy file')
    parser.add_argument('-d', dest='destination', default="", type=str,
                        help='Copy to destination')
    parser.add_argument('-t', dest='test', default=False, action='store_true',
                        help='Test mode. Don\'t apply changes.')
    parser.add_argument('-V', '--version', action='version',
                        version='%(prog)s {}'.format(__version__))
    group = parser.add_mutually_exclusive_group()
    group.add_argument("-v", "--verbose", action="store_true")
    group.add_argument("-q", "--quiet", action="store_true")
    parser.add_argument('input', nargs='+',
                        help='Absolute path to file or directory')

    return parser.parse_args() 
开发者ID:ronakg,项目名称:smart-image-renamer,代码行数:63,代码来源:smart-image-renamer.py

示例3: main

# 需要导入模块: import _version [as 别名]
# 或者: from _version import __version__ [as 别名]
def main():
  # Choose how to instantiate
  if len(sys.argv) == 2:
    if sys.argv[1] == '--help' or sys.argv[1] == '-h':
      welcome()
      displayUsage()
      furtherHelp()
      return
    if sys.argv[1] == '--version' or sys.argv[1] == '-v':
      print("gFlex v"+__version__)
      return
    else:
      # Looks like it wants to be an configuration file!
      filename = sys.argv[1] # it works for usage (1) and (2)
      obj = WhichModel(filename)

  elif len(sys.argv) == 1:
    welcome()
    displayUsage()
    print("")
    sys.exit()
  else:
    welcome()
    print(">>>> ERROR: Too many input parameters provided; exiting. <<<<")
    print("")
    displayUsage()
    print("")
    sys.exit()
  
  
  ########################################
  ## SET MODEL TYPE AND DIMENSIONS HERE ##
  ########################################
  
  if obj.dimension == 1:
    obj = F1D(filename)
  elif obj.dimension == 2:
    obj = F2D(filename)

  obj.initialize(filename)
  
  if obj.Debug: print("Command line:", sys.argv)


  ############################################
  ##       SET MODEL PARAMETERS HERE        ##
  ## (if not defined in configuration file) ##
  ############################################
  # obj.set_value('method','FD') # for example

  obj.run()
  obj.finalize()

  obj.output() # Not part of IRF or BMI: Does standalone plotting and file output


  #####################
  ## GET VALUES HERE ##
  ##   (if desired)  ##
  ##################### 
  #wout = obj.get_value('Deflection') # for example 
开发者ID:awickert,项目名称:gFlex,代码行数:63,代码来源:gflex.py


注:本文中的_version.__version__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。