MySQLdb - Tuples

Lajos Kuljo kuljo at freemail.hu
Tue Feb 1 17:36:36 EST 2005


Hallo,
ich bin voll neu im Python-Programming, deshalb ist mein Problem 
wahrscheinlich trivial:

Wenn ich die Script
#########################################33
#! /usr/bin/env python
import MySQLdb
db=MySQLdb.connect(host='localhost', db='photum_0_6_2', user='root', 
passwd='thkhgfgd')
c=db.cursor()
c.execute('select person from persons order by person')
tup=c.fetchall()
for a in tup:
   print a
################################################
ausführe, erhalte ich Dinge wie
('Dieter',)
('Hulda',)
....

Ich brauche die Klammern, Apostrphe und Kommas nicht (ich will nur die 
Inhalte) und kann ich sie nicht loswerden. Versucht habe ich u. a. print 
a[2:-3] was nur zwei Klammern bringt.
b=lstrip(a, "(") haut auch nicht hin.
Weiss jemand Rat?

P.S. Woher kommen diese Klammern und Apostrophen, vom MySQLdb?



More information about the Python-list mailing list