Created
January 20, 2017 07:36
-
-
Save blubberdiblub/f6cf2c5dd0b91aeb4f9ee877627799d3 to your computer and use it in GitHub Desktop.
Program producing some random output and errors in random intervals.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import random | |
import sys | |
import time | |
for i in range(1000): | |
time.sleep(random.betavariate(0.2, 1)) | |
if random.random() < 0.1: | |
print("Error #{}".format(random.randint(1, 99)), file=sys.stderr) | |
else: | |
print(random.randrange(1000000)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment