Created
September 18, 2015 10:40
-
-
Save arslnb/a1a20bd11da288320671 to your computer and use it in GitHub Desktop.
Script to make log files for NIT Srinagar Internships 2015
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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