Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Logging Benchmarks
#!/usr/bin/python
# Print N integers have M digits.
#
# Usage: print_random_ints.py digit-count count
import random
import sys
digit_count = int(sys.argv[1])
if digit_count == 1:
ints = range(0, 10)
else:
ints = range(10 ** (digit_count - 1), 10 ** digit_count)
for i in range(0, int(sys.argv[2])):
print(random.choice(ints))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment