Skip to content

Instantly share code, notes, and snippets.

View jmoragav's full-sized avatar
🐵
Soy ese

Joaquin Moraga jmoragav

🐵
Soy ese
  • @mentionUniversidad de Chile
  • Santiago, Chile
View GitHub Profile
@greglinch
greglinch / file-generator.py
Last active June 16, 2021 22:05
Python script to batch generate files based on a variable. Save this file in a new directory and make the desired modifications. Open terminal and cd into that directory. Type $ python ./file-generator.py to execute the script.
values = ['comma','separated', 'list', 'of','values', 'each', 'surrounded', 'by', 'quotes']
# for each item in the list of items
for value in values:
# construct the filename; prefix or suffix optional
filename = 'prefix-' + value + '.jpt'
# open the file to be written
fo = open(filename, 'w')