INNER CODE UNIT · Python

done

Ershany/Arcane-Engine · Setup/ArcaneUtils.py:107

				done = int(50*extractedContentSize/zipFileContentSize)
				percentage = (extractedContentSize / zipFileContentSize) * 100
			except ZeroDivisionError:
				done = 50
				percentage = 100
			elapsedTime = time.time() - startTime
			try:
				avgKBPerSecond = (extractedContentSize / 1024) / elapsedTime
			except ZeroDivisionError:
				avgKBPerSecond = 0.0
			avgSpeedString = '{:.2f} KB/s'.format(avgKBPerSecond)
			if (avgKBPerSecond > 1024):
				avgMBPerSecond = avgKBPerSecond / 1024
				avgSpeedString = '{:.2f} MB/s'.format(avgMBPerSecond)
			sys.stdout.write('\r[{}{}] {:.2f}% ({})     '.format('█' * done, '.' * (50-done), percentage, avgSpeedString))
			sys.stdout.flush()
	sys.stdout.write('\n')

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…