error from terminal program:
./sqlite3_test.py: line 6: syntax error near unexpected token `('
./sqlite3_test.py: line 6: `connection = sqlite3(':memory:')'
john@sentry35:~$

version 2.7.12 (ubuntu 16,04 lts)

John




On 10/22/2017 08:07 PM, Igor Korot wrote:
Hi, John,

On Sun, Oct 22, 2017 at 9:59 PM, John R. Sowden
<jsow...@americansentry.net> wrote:
Since I am trying to learn sqlite3 (unlearning foxpro) I find that python is
the simpleist language, wfich allows me to focus on sqlite, I amtrying the
=guide just sent to the list.

I am getting a syntax error on line 5.  below is the program copied by hand
from the guide:
What is the exact error message you received?
Please copy and paste it here in reply?

Also, what python version do you have?

Thank you.

----------------------
#/!python
# sqlite3_test, a test of python and sqlite

import sqlite3

connection = sqlite3(':memory:')

# create a table
connection.execute('create table events(ts, msg)')

# insert values
connection.execute('insert into events values(?,?),
    [(1, 'foo'), (2,'bar'), (3,'baz') ] )

# print inserted rows
for row in connection.execute('select * from events'):
print(row)
-----------------------

can anyone tell me where i am missing something?

John

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to