#!/usr/bin/python import MySQLdb import sys import getopt import socket import os cdb = MySQLdb.connect(host="127.0.0.1", user="mythtv", passwd="mythtv", db="ncid") #log to logger? #log to db def main(argv): DATE=sys.stdin.readline().strip() TIME=sys.stdin.readline().strip() NUMBER=sys.stdin.readline().strip() NAME=sys.stdin.readline().strip() #print "start of line" #print DATE #print TIME #print NUMBER #print NAME #print "$$$$$$$$$$$$$$$$$$" ncursor=cdb.cursor() ncursor.execute ("""INSERT INTO cid (date,time,name,number) VALUES ('%s', '%s','%s','%s');""" %(DATE,TIME,NAME,NUMBER )) if __name__ == "__main__": main(sys.argv[1:])