title: Writing variables with .write() Python 3
body: <p>I am trying to write a string + datetime to a text file with Python. I'm trying to make a basic logger, that will log the datetime in a format of; "Full weekday, day number, Full month name, full year, 12 hour format, minute, second, AM/PM, UTC". I read that file.write() can only take strings and not integers or dates etc. So how would I would I make this work to be written to the text file?</p>
  
  <pre><code>grab_date = datetime.datetime.now().strftime("%A %d, %B %Y %I:%M:%S %p %Z")
  firstline = "Log Created: ", grab_date, "/nLog deleted and recreated."
  f = open("gen-log.txt", "w")
  f.seek(0)
  f.write(firstline)
  f.close()
  </code></pre>
  
  <p>EDIT: not quite sure why but I read on one post that f.seek(0) did something and it worked for them. lol. I just left it in there. Sorry.</p>