title: Customize fswebcam file name in python
body: <p>Is it possible to make the image names generated from fswebcam take a name from a variable in python? The idea is that I have a card swipe system that takes a webcam shot of whoever swipes their card and stores the image in a folder. I want to have the serial number of the card and time be the name of the image generated. Right now, I only found a way to get the time written in the name but not the serial number. Can anyone help me out?</p>
  
  <p>Card Swipe System Code:</p>
  
  <pre><code>import datetime
  import time
  import os
  import RPi.GPIO as gpio
  
  t = datetime.datetime.now()
  
  gpio.setmode(gpio.BOARD)
  gpio.setwarnings(False)
  
  while True:
      card = raw_input()
      f = open("Laptop Sign Out" + '.txt', 'a')
      f.write("Card Number: " + card[1:10] + " Time: " + t.strftime("%m-%d-%Y %H:%M:%S"))
      f.write('\n')
      f.close()
      time.sleep(1)
      os.system('fswebcam ~/Desktop/Photos/%H%M%S.jpeg')
      time.sleep(3)
  
  gpio.cleanup()
  </code></pre>