Richie Hindle wrote: > > [Florian] >> I've one problem using the csv module. >> The code: >> >> self.reader = csv.reader(f, delimiter = ",") >> >> works perfectly. But when I use a variable for delimiter: >> >> self.reader = csv.reader(f, delimiter = Adelimiter) >> >> I get the traceback: >> >> >> File "/home/florian/visualizer/ConfigReader.py", line 13, in __init__ >> self.reader = csv.reader(f, delimiter = Adelimiter) >> TypeError: bad argument type for built-in operation > > Is this your problem?: > >>>> Adelimiter = u',' >>>> reader = csv.reader(f, delimiter=Adelimiter) > Traceback (most recent call last): > File "<stdin>", line 1, in ? > TypeError: bad argument type for built-in operation >>>> print type(Adelimiter) > <type 'unicode'>
Yes, thats my problem. You mean that csv.reader can't work with unicode as the delimiter parameter? Sorry, I don't really get your point what you're saying... Florian -- http://mail.python.org/mailman/listinfo/python-list