[Tutor] best approach to db-api imports and cursor calls

Christian Witts cwitts at compuscan.co.za
Thu Aug 13 14:56:31 CEST 2009


Serdar Tumgoren wrote:
>> But most folks find multiple cursors easier to manage in the same way that
>> they find multiple variables easier than reusing a minimal number.
>>
>>     
> That makes sense. I think I'll try using a global import/connect, and
> then create cursors inside each method.
>
> Thanks to you both for the advice!
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>   
You can also pass the connection object around from your __main__ so you 
can call .commit() and .rollback() when you need without polluting globals.

-- 
Kind Regards,
Christian Witts




More information about the Tutor mailing list