Skip to content

Instantly share code, notes, and snippets.

@mschuwalow
Created June 12, 2016 21:43
Show Gist options
  • Save mschuwalow/bd78ebd5304b84a492c3b58417a92256 to your computer and use it in GitHub Desktop.
Save mschuwalow/bd78ebd5304b84a492c3b58417a92256 to your computer and use it in GitHub Desktop.
"""
Fancy Script for generating bat files from every filename that comes in via stdin.
Pass the directory to write to as an argument.
Brought to you by unicorn magic!
Kawoooosh....
"""
import sys
if __name__ == "__main__":
print "Generating entries for:\n"
for elem in sys.stdin:
elem = elem[0:(len(elem) - 1)]
print elem
file = open(sys.argv[1] + "/" + elem + ".bat", "w+")
file.write("@echo off\n")
file.write("cmd.exe /c \"bash -c " + elem + " %1 %2 %3 %4 %5 %6 %7 %8 %9\"")
print "\ndone!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment