connect to sqlite database from python program -


I am getting a line from my device through line streaming data from a device. The data looks like this:

MSG, 4,0,08,868 C, 0,2015 / 01 / 22,14: 40: 15.815,2015 / 01 / 22,14: 40: 15.815, ,, 228.9212.5 ,,,, 1280 ,,,,, MSG, 4,0,0,80068c, 0,2015 / 01 / 22,14: 40: 28.722,2015 / 01 / 22,14: 40: 28.722,, 230.5,212.2 ,,, - 1920, ,,,, MSG, 8,0,0,80068c, 0,2015 / 01 / 22,14: 40: 34.284,2015 / 01 / 22,14: 40 : 34.284 ,,,,,,,,,,,,,, MSG, 8,0,0,80068c, 0,2015 / 01 / 22,14: 40: 35.144,2015 / 01 / 22,14: 40: 35.144, ,,,,,,,,,,,, MSG, 5,0,0,80068c, 0,2015 / 01 / 22,14: 40: 35.144,2015 / 01 / 22,14: 40: 35.144 ,, 5400 ,,,,,,, 0,0 msg, 3,0,0,80068 c, 0,2015 / 01 / 22,14: 40: 36.065,2015 / 01 / 22,14: 40: 36.065 ,, 5375 ,,,,,,,,,, MSG, 4,0,0,80068c, 0,2015 / 01 / 22,14: 40: 36.644,2015 / 01 / 22,14: 40: 36.644 ,,, 231.6, 211.7 ,,, - 1728 ,,,, MSG, 8,0,0,80068c, 0,2015 / 01 / 22,14: 40: 37.503,2015 / 01 / 22,14: 40: 37.503 ,, ,,,,,,,,,, MSG, 4,0,0,80068c, 0,2015 / 01 / 22,14: 40: 38.815,2015 / 01 / 22,14: 40: 38.815 ,,, 231.6, 211.7 ,,, - 1408 ,,,,,

Now I want to connect to the program from the sqlite database and each line is in the database in the CSV format I want to get right into Please help me

My Pyro code is given below:

< Div class = "snippet-code" before ADRR>
  from socket import * HOST = 'localhost' PORT = 30003 #our port = ( HOST, PORT) BUFSIZE = 4096 sock = socket (AF_INET, SOCK_STREAM) sock.connect ((ADDR)) def readlines (sock, recv_buffer = 4096, delim = '\ n'): buffer = '' data = true during data : Data = sock .recv (recv_buffer) buffer + = buffer.find (seelim) = = data while = 1: line, buffer = buffer. Redline (SOK) in the return line for the split ('\ n', 1) yield line.strip ('\ r \ n'): print line  
< / P>

Regards

Manoj


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -