Connecting widgets to Databases

DeepBleu DeepBleu at DeepBleu.org
Wed Jan 23 09:38:18 EST 2002


Connecting widgets to DatabasesLet us say that you are using mxODBC or DCOracle2 (or some other database driver for this matter).
The first thing to know is how are you getting your database query.
For example, DCOracle2 stores the result of a query in a list.
Say you have the list Query_List.
With fetchall():
You access its individual items in the regular way:  Query_List[0][0], Query_List[0][1] etc...etc....
These ARE the values that you want to impart to the values of a Label or Text widgets.
Say you have Label1
Then
Label1.value=Query_List[0][0]
for example.
You can loop over values etc... etc.....
DeepBleu (Blue with a difference)
  "Alves, Carlos Alberto - Coelce" <calves at coelce.com.br> wrote in message news:mailman.1011782553.17025.python-list at python.org...
  Hi all, 
  Let's imagine we have make an GUI using Tkinter module. 
  So, how can we connect an widget (such as a label, text entry etc) to one field of a Database, in the way we can access/show the data stored in that field.

  Any hint would be appreciate. 

  Carlos Alberto 
  COELCE/DPRON-Departamento de Projetos e Obras Norte 
  Fone: 677- 2228 
  e-mail: calves at coelce.com.br 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20020123/235d7ea6/attachment.html>


More information about the Python-list mailing list