本文整理汇总了Python中properties.Properties.getImageHeight方法的典型用法代码示例。如果您正苦于以下问题:Python Properties.getImageHeight方法的具体用法?Python Properties.getImageHeight怎么用?Python Properties.getImageHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类properties.Properties
的用法示例。
在下文中一共展示了Properties.getImageHeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from properties import Properties [as 别名]
# 或者: from properties.Properties import getImageHeight [as 别名]
def main():
argparser = argparse.ArgumentParser()
argparser.add_argument('--type', action="store", dest="type")
argparser.add_argument('-n', action="store", dest="n", type=int)
argparser.add_argument('--width', action="store", dest="width", type=int)
argparser.add_argument('--height', action="store", dest="height", type=int)
argparser.add_argument('--fontsize', action="store", dest="fontsize", type=int)
argparser.add_argument('-l', action="store", dest="length", type=int)
options = argparser.parse_args()
if options.type == None and options.n == None and options.width == None and options.height == None and options.fontsize == None and options.length == None:
print "No params given, i will use settings.ini"
props = Properties("settings.ini")
props.load()
count = props.getNumber()
rand_word = RandomWord()
rand_str = RandomString(int(props.getWordLength()))
word_type = props.getWordType()
if word_type == "natural":
i = 0
while (i < int(count)):
i = i+1
print (rand_word.getFixedLengthWord(int(props.getWordLength())))
captcha=Captcha(rand_word.getFixedLengthWord(int(props.getWordLength())), int(props.getFontSize()), int(props.getImageWidth()), int(props.getImageHeight()))
captcha.saveImage()
elif word_type == "random":
i = 0
while (i < int(count)):
i = i+1
print (rand_str.shuffle(int(props.getWordLength())))
captcha=Captcha(rand_str.shuffle(int(props.getWordLength())), int(props.getFontSize()), int(props.getImageWidth()), int(props.getImageHeight()))
captcha.saveImage()
else :
print ("word type must be random or natural")
print ("Done, generated "+props.getNumber()+" captchas")
#TODO: сделать возможность часть параматров брать из settings.ini а часть из консоли
else:
rand_word = RandomWord()
rand_str = RandomString(options.length)
word_type = options.type
if word_type == "natural":
i = 0
while (i < int(count)):
i = i+1
print (rand_word.getFixedLengthWord(options.length))
captcha=Captcha(rand_word.getFixedLengthWord(options.length, options.fontsize, options.width, options.height))
captcha.saveImage()
elif word_type == "random":
i = 0
while (i < int(count)):
i = i+1
print (rand_str.shuffle(options.length))
captcha=Captcha(rand_str.shuffle(options.length, options.fontsize, options.width, options.height))
captcha.saveImage()
else :
print ("word type must be random or natural")
print ("Done, generated "+props.getNumber()+" captchas")