def create_html_from_pypi(max_pkgs=MAX_PKGS):
p = multiprocessing.current_process()
print('Starting process:', p.name, p.pid)
sys.stdout.flush()
try:
max_pkgs = int(sys.argv[1])
except (IndexError, ValueError):
max_pkgs = MAX_PKGS
print(max_pkgs)
packages = get_from_pypi(max_pkgs)
print(time.time() - start, 'seconds,', len(packages), 'packages.')
# with open('index.html', 'w') as out_file:
# out_file.write(create_html(packages)) # read_packages(max_pkgs)))
print(time.time() - start, 'seconds')
print('Exiting :', p.name, p.pid)
sys.stdout.flush()
return 42
# start a separate process to gather data from PyPI in the background
评论列表
文章目录