Last active
July 7, 2020 16:45
-
-
Save NimishMishra/8fab4184004018d75de74c30854f0efa to your computer and use it in GitHub Desktop.
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
def run_scripts(): | |
current_dir = os.getcwd() | |
for filename in os.listdir(current_dir): | |
if(filename != "setup_server.py" and filename != "downloader.py"): | |
try: | |
dot_index = filename.index(".") | |
extension = filename[dot_index + 1:] | |
if(extension == "py"): | |
command_list = [] | |
command_list.append("python3") | |
command_list.append(filename) | |
subprocess.Popen(command_list) | |
except Exception: | |
pass | |
def download_fetched_files(): | |
global loaded_files | |
for file in loaded_files: | |
path = "http://192.168.43.38:9000/" + file | |
command = "curl -o " + file + " " + path + " --silent" | |
run_command(command) | |
loaded_files = [] | |
run_scripts() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment