DFS writes:
> On 4/6/2017 10:54 AM, Python wrote:
>> Le 06/04/2017 à 16:46, DFS a écrit :
>>> On 4/5/2017 10:52 PM, Dan Sommers wrote:
On Wed, 05 Apr 2017 22:00:46 -0400, DFS wrote:
> I have a simple hard-coded check in place before even trying to
> connect:
>
> if dbtyp
Le 06/04/2017 à 16:46, DFS a écrit :
On 4/5/2017 10:52 PM, Dan Sommers wrote:
On Wed, 05 Apr 2017 22:00:46 -0400, DFS wrote:
I have a simple hard-coded check in place before even trying to connect:
if dbtype not in ('sqlite postgres'):
print "db type must be sqlite or postgres"
exit()
DFS writes:
> On 4/5/2017 10:52 PM, Dan Sommers wrote:
>> On Wed, 05 Apr 2017 22:00:46 -0400, DFS wrote:
>>
>>> I have a simple hard-coded check in place before even trying to connect:
>>>
>>> if dbtype not in ('sqlite postgres'):
>>>print "db type must be sqlite or postgres"
>>>exit()
>>
On Wed, 05 Apr 2017 22:00:46 -0400, DFS wrote:
> I have a simple hard-coded check in place before even trying to connect:
>
> if dbtype not in ('sqlite postgres'):
>print "db type must be sqlite or postgres"
>exit()
That's not doing what you think it is.
Hint: What is ('sqlite postgres
On Wed, 05 Apr 2017 14:56:12 -0400, DFS wrote:
> I split the database connection code and settings into a module, so
> the connection and setting values are available to other code modules
> I have.
Good work.
> dbset.py
> -
> import sqlite3, psyco
On Wed, 05 Apr 2017 10:54:29 -0400, DFS wrote:
> I have identical databases in sqlite and postgres. I want to run the
> same code against them, but am having a small issue.
>
> Current code below throws the dreaded:
>
> NameError: global name 'db' is not defined
>
> on line 12
>
> How do I f
In DFS writes:
> I have identical databases in sqlite and postgres. I want to run the
> same code against them, but am having a small issue.
> Current code below throws the dreaded:
> NameError: global name 'db' is not defined
> on line 12
> How do I fix it? I want to keep dbconnect() as
On Wed, Apr 5, 2017 at 11:09 AM, Python wrote:
> Le 05/04/2017 à 16:54, DFS a écrit :
>>
>> I have identical databases in sqlite and postgres. I want to run the
>> same code against them, but am having a small issue.
>>
>> Current code below throws the dreaded:
>>
>> NameError: global name 'db' i
Le 05/04/2017 à 16:54, DFS a écrit :
I have identical databases in sqlite and postgres. I want to run the
same code against them, but am having a small issue.
Current code below throws the dreaded:
NameError: global name 'db' is not defined
on line 12
How do I fix it? I want to keep dbconne