title: Posting a random image from directory to twitter
body: <p>So I'm working on a little mini project running off of a raspberry pi, of which the end goal is to have the pi running a python script to post a random image from a directory to twitter (a twitter bot).  I have this code so far, and I'm getting an error.  I'm assuming that the error is caused due to the fact that it is somehow not receiving the correct file type, but I'm not 100% sure.  A little help would be fantastic!</p>
  
  <pre><code>import os
  import random
  from twython import Twython
  #removed keys for privacy reasons
  CONSUMER_KEY = ''
  CONSUMER_SECRET = ''
  ACCESS_KEY = ''
  ACCESS_SECRET = ''
  twitter = Twython(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, ACCESS_SECRET)
  path = '/home/pi/DailyMeme/Memes/downloaded_images'
  count = 0
  file_list = []
  for filename in os.listdir(path):
          count = count+1
          file_list.append(filename)
  
  rnd = random.randint(0,count)
  photo = open('/home/pi/DailyMeme/Memes/downloaded_images/'+file_list[rnd]+'.jpg','rb')
  response = twitter.upload_media(media=photo)
  twitter.update_status(status='check out this random meme', media_ids[response['media_id']])
  </code></pre>
  
  <p>EDIT: I'm new to python so it would be great if you could explain to me solutions</p>
  
  <p>Error Message</p>
  
  <pre><code>File "random_meme.py", line 20
      twitter.update_status(status='check out this random meme' , media_ids[response['media_id']])
  SyntaxError: non-keyword arg after keyword arg
  </code></pre>