My code is as follows and I am working on a Linux machine
import time as t from os import path def createFile(dest): date = t.localtime(t.time()) ##Fileame = Month_Day_Year name = "%d_%d_%d.txt"%(date,date,date%100) if not(path.isfile(dest+name)): f = open(dest + name, 'w') f.write('\n'*30) f.close() if __name__ == '__main__': destination = "/home/user/projects/python/python1/" createFile(destination) print "done!!!"
Now it is creating a file intended in .txt format (why?) and how can I change that, say I want it to be a ,html file.
Edit: yeah, solved, I am an idiot.