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


Python Builder.get_number_of_images方法代码示例

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


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

示例1: main

# 需要导入模块: from builder import Builder [as 别名]
# 或者: from builder.Builder import get_number_of_images [as 别名]
def main():
	global debug
	if (len(argv) == 2) and argv[1] == "--debug":
		debug = True
	else:
		debug = False
	
	print "\r"
	print "******************************************************************"
	print "Instagram downloader v0.5 \t author: Černý Jan \t 2016-2017"
	print "******************************************************************"
	
	user = raw_input('user account: ').strip()

	#internet connection test
	if test_connection():
		pass
	else:
		exit("app down")

	#account exists test
	if account_exists(user):
		pass
	else:
		exit("Account does not exist")

	url = "https://www.instagram.com/" + user + "/media/"
	
	start_time = timeit.default_timer()

	ib = Builder(user, debug)
	ib.set_images()

	if debug:
		print "found " + str(ib.get_number_of_images()) + " photo(s)"
	
	w = Worker(ib.get_images(), user, debug)
	w.work()

	elapsed = round((timeit.default_timer() - start_time), 2)

	path = user
	print "\nTotal: " + str(len([f for f in os.listdir(path)if os.path.isfile(os.path.join(path, f))])) + " photo(s) " + "in " + str(elapsed) + " seconds"
	exit("--successfully finished--")
开发者ID:cernyjan,项目名称:Instagram-downloader,代码行数:46,代码来源:instagramdownloader.py


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