Spaces:
Running
Running
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() | |