Re: [weewx-user] Reading weewx.sdb file with Python program
I won't write nothing ... except TNX :-) On Monday, February 6, 2017 at 3:25:52 PM UTC+1, Tom Keffer wrote: > > Simple typo. > > *con = lite.connect('weewx.sdb')* > > -tk > > -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [weewx-user] Reading weewx.sdb file with Python program
Simple typo. *con = lite.connect('weewx.sdb')* -tk On Mon, Feb 6, 2017 at 3:10 AM, Janez Kranjskiwrote: > Noob question - I copied weewx.sdb file to temp folder on my Linux (so it > is not opened or accessible). > Then I tried simple Python program: > > *#!/usr/bin/python* > > *import sqlite3 as lite* > *import sys* > > *con = lite.connect('weeex.sdb')* > > *with con:* > * cur = con.cursor()* > * cur.execute("SELECT * FROM archive;")* > > * print(cur.fetchall())* > ** > > But unfortunately I get an error: > *Traceback (most recent call last):* > * File "preberi.py", line 10, in * > *cur.execute("SELECT * FROM archive;")* > *sqlite3.OperationalError: no such table: archive * > > I can open the same file with SQLiteDatabaseBrowser and I can see records > and tables (also table "archive"). > > Any idea what is wrong? > > -- > You received this message because you are subscribed to the Google Groups > "weewx-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to weewx-user+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[weewx-user] Reading weewx.sdb file with Python program
Noob question - I copied weewx.sdb file to temp folder on my Linux (so it is not opened or accessible). Then I tried simple Python program: *#!/usr/bin/python* *import sqlite3 as lite* *import sys* *con = lite.connect('weeex.sdb')* *with con:* * cur = con.cursor()* * cur.execute("SELECT * FROM archive;")* * print(cur.fetchall())* ** But unfortunately I get an error: *Traceback (most recent call last):* * File "preberi.py", line 10, in * *cur.execute("SELECT * FROM archive;")* *sqlite3.OperationalError: no such table: archive * I can open the same file with SQLiteDatabaseBrowser and I can see records and tables (also table "archive"). Any idea what is wrong? -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.