# First set a variable with information
the_text = 'This information will be stored in a file'
the_file = open('the_file.txt', 'w')
the_file.writelines(the_text)
the_file.close()
If you run this. A new file called "the_file.txt" should be created with the contents from the "the_text" variable.