Created
October 20, 2019 15:54
-
-
Save rafaelnp/21f5bb3d6e84898d0881951f82885198 to your computer and use it in GitHub Desktop.
execute a desired commend N times, useful for quick tests and automations
This file contains hidden or 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 | |
""" | |
execute a command N times | |
""" | |
import os | |
import time | |
x = 10 | |
y = 0.5 | |
for i in range(x): | |
# if an invertal between executions is needed | |
time.sleep(y) | |
os.system("your_binary -args") | |
# print the iteration number in the same line if desired | |
print("execution number: {}".format(i), end = "\r", flush = True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment