title: Writing list of objects to csv file
body: <p>I am writing a python program that loops through reddit submissions, pulls data, and stores it as an object in a list.  However I am having trouble writing that list to a csv file. The file is created but it just gives some kind of id tag for the objects. How should I change the csv code?</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>import praw
  from datetime import datetime
  import pandas as pd
  
  class Submission:
      def __init__(self, time, score, title, text, ofReddit, serious):
          self.time = time
          self.score = score
          self.title = title
          self.text = text
          self.ofReddit = ofReddit
          self.serious = serious
  data = []
  
  reddit = praw.Reddit(client_id=id, client_secret=secret,
                       user_agent='testscript by /u/SilentButtDeadlies')
  subreddit = reddit.subreddit('AskReddit')
  for submission in subreddit.new(limit=50):
      time = datetime.utcfromtimestamp(submission.created_utc).hour
      score = submission.score
      title = len(submission.title)
      text = len(submission.selftext)
      if 'of reddit' in submission.title.lower():
          ofReddit = 1
      else:
          ofReddit = 0
      if '[serious]' in submission.title.lower():
          serious = 1
      else:
          serious = 0
      data.append(Submission(time, score, title, text, ofReddit, serious))
  df = pd.DataFrame(data)
  filename = 'AskRedditData' + str(datetime.now()) + '.csv'
  df.to_csv(filename, index=False, encoding='utf-8')
  </code></pre>
  
  <p><strong>CSV File</strong></p>
  
  <pre><code>0
  &lt;__main__.Submission instance at 0x1118f6ef0&gt;
  &lt;__main__.Submission instance at 0x1118f68c0&gt;
  &lt;__main__.Submission instance at 0x1118f6950&gt;
  &lt;__main__.Submission instance at 0x1118c3758&gt;
  &lt;__main__.Submission instance at 0x11239c638&gt;
  &lt;__main__.Submission instance at 0x11239c5f0&gt;
  &lt;__main__.Submission instance at 0x112398908&gt;
  &lt;__main__.Submission instance at 0x112398998&gt;
  &lt;__main__.Submission instance at 0x112398878&gt;
  &lt;__main__.Submission instance at 0x1123989e0&gt;
  &lt;__main__.Submission instance at 0x112398c68&gt;
  &lt;__main__.Submission instance at 0x11239fe18&gt;
  &lt;__main__.Submission instance at 0x11239fe60&gt;
  &lt;__main__.Submission instance at 0x11239fea8&gt;
  &lt;__main__.Submission instance at 0x11239fef0&gt;
  &lt;__main__.Submission instance at 0x11239ff38&gt;
  &lt;__main__.Submission instance at 0x11239ff80&gt;
  &lt;__main__.Submission instance at 0x11239ffc8&gt;
  &lt;__main__.Submission instance at 0x112404050&gt;
  &lt;__main__.Submission instance at 0x112404098&gt;
  &lt;__main__.Submission instance at 0x1124040e0&gt;
  &lt;__main__.Submission instance at 0x112404128&gt;
  &lt;__main__.Submission instance at 0x112404170&gt;
  &lt;__main__.Submission instance at 0x1124041b8&gt;
  &lt;__main__.Submission instance at 0x112404200&gt;
  &lt;__main__.Submission instance at 0x112404248&gt;
  &lt;__main__.Submission instance at 0x112404290&gt;
  &lt;__main__.Submission instance at 0x1124042d8&gt;
  &lt;__main__.Submission instance at 0x112404320&gt;
  &lt;__main__.Submission instance at 0x112404368&gt;
  &lt;__main__.Submission instance at 0x1124043b0&gt;
  &lt;__main__.Submission instance at 0x1124043f8&gt;
  &lt;__main__.Submission instance at 0x112404440&gt;
  &lt;__main__.Submission instance at 0x112404488&gt;
  &lt;__main__.Submission instance at 0x1124044d0&gt;
  &lt;__main__.Submission instance at 0x112404518&gt;
  &lt;__main__.Submission instance at 0x112404560&gt;
  &lt;__main__.Submission instance at 0x1124045a8&gt;
  &lt;__main__.Submission instance at 0x1124045f0&gt;
  &lt;__main__.Submission instance at 0x112404638&gt;
  &lt;__main__.Submission instance at 0x112404680&gt;
  &lt;__main__.Submission instance at 0x1124046c8&gt;
  &lt;__main__.Submission instance at 0x112404710&gt;
  &lt;__main__.Submission instance at 0x112404758&gt;
  &lt;__main__.Submission instance at 0x1124047a0&gt;
  &lt;__main__.Submission instance at 0x1124047e8&gt;
  &lt;__main__.Submission instance at 0x112404830&gt;
  &lt;__main__.Submission instance at 0x112404878&gt;
  &lt;__main__.Submission instance at 0x1124048c0&gt;
  &lt;__main__.Submission instance at 0x112404908&gt;
  </code></pre>