Skip to content

Instantly share code, notes, and snippets.

@kylelk
Created October 27, 2013 22:26
Show Gist options
  • Save kylelk/7188625 to your computer and use it in GitHub Desktop.
Save kylelk/7188625 to your computer and use it in GitHub Desktop.
import subprocess
import os
file_list = subprocess.check_output('ls *.c', shell=True)
names = [file for file in file_list.split("\n")] # file.split(".c\n")
name_list = [file.split(".")[0] for file in names]
for name in name_list:
os.system("gcc -o "+name+" "+name+".c")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment