title: Unable to write to file in python
body: <p>I'm trying to write user input to file in python but it's not working. Here's my code:</p>
  
  <pre><code>filename='guest_book.txt'
  while True:
      with open(filename,'a') as file_object：
          name=input('Please enter your name')
          file_object.write(name)
          file.object.write('visit the website')
          print('Hello')
  </code></pre>