Converting the long date into strings
#1
Hi guys,

I'm working on my python script to pull the data from the sqlite3 database.

I'm converting the data into strings so that the strings are no longer unicode and the long date but the long date are still showing the L strings which you can see it here:

Code:
11:02:51 T:3016  NOTICE: ('101 ABC FAMILY ', 'The Goonies',
20140520173000L, 20140520200000L)
11:02:51 T:3016  NOTICE: ('101 ABC FAMILY ', 'Pirates of the Caribbean: On
Stranger Tides', 20140520200000L, 20140520230000L)


When I use this:

Code:
#Pull the data from the database
channelList = list()
channel_db = xbmc.translatePath(os.path.join('special://userdata/addon_data/script.tvguide', 'source.db'))

if os.path.exists(channel_db):
   con.text_factory = lambda x: x.encode('ascii')
   cur.execute('SELECT channel, title, start_date, stop_date FROM programs WHERE channel')
   for row in cur:
        channel = row[0].encode('ascii'), row[1].encode('ascii'), int(row[2]), int(row[3])
        channelList.append(channel)
        print channel
   cur.close()


Do you know how I can removing the L strings when I pull the data from the sqlite3 database?
Reply

Logout Mark Read Team Forum Stats Members Help
Converting the long date into strings0