本文整理匯總了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("")
示例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()
示例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