1import os.path
2
3save_path = 'C:/example/'
4
5name_of_file = raw_input("What is the name of the file: ")
6
7completeName = os.path.join(save_path, name_of_file+".txt")
8
9file1 = open(completeName, "w")
10
11toFile = raw_input("Write what you want into the field")
12
13file1.write(toFile)
14
15file1.close()
1outFileName="F:\\folder\\folder\\filename.txt"
2outFile=open(outFileName, "w")
3outFile.write("""Hello my name is ABCD""")
4outFile.close()