f = open('textfile1.txt', 'w')
f.write('M5\nG90\nG21\n') 
f.write('This is our new text file') 
f.write('and this is another line.') 
f.write('Why? Because we can.') 
 
f.close() 
