Skip to content

Instantly share code, notes, and snippets.

@arslnb
Created September 18, 2015 10:40
Show Gist options
  • Save arslnb/a1a20bd11da288320671 to your computer and use it in GitHub Desktop.
Save arslnb/a1a20bd11da288320671 to your computer and use it in GitHub Desktop.
Script to make log files for NIT Srinagar Internships 2015
import sys
names = ["name1", "name2"]
def write():
print('Creating log files...')
for name in names:
file_name = name + '.txt'
try:
file = open(file_name, 'a')
file.close()
except:
print('Something went wrong! Can\'t tell what?')
sys.exit(0)
write()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment