Spaces:
Running
Running
File size: 437 Bytes
e0d6c83 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import argparse
import random
import time
def random_values(failing: bool = False):
for i in range(10):
print(f"Value {i+1}")
time.sleep(random.uniform(0, 1))
if failing and i == 5:
raise ValueError("Failing!!")
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--failing", action="store_true")
args = parser.parse_args()
random_values(args.failing)
main()
|