[Tutor] Stupid newbie question
James A Roush
jar@mminternet.com
Sun, 25 Feb 2001 10:26:57 -0800
Yes, that works. Thank you.
> -----Original Message-----
> From: Bar=FD=FE Metin [mailto:baris@gelecek.com.tr]
> Sent: Saturday, February 24, 2001 5:54 PM
> To: James A Roush
> Cc: tutor@python.org
> Subject: Re: [Tutor] Stupid newbie question
>
>
> Hello;
>
> You should use parantheses after upper like :
>
> site_list[web_site[0].upper()]=3D web_site[1]
>
> Because it is a built-in method
>
> -----
> Baris Metin
> -----
>
> On Sat, 24 Feb 2001, James A Roush wrote:
>
> > I have a piece of code, listed below, it runs fine except for the lin=
e I
> > commented out. The code reads a sequential text file, with two
> fields per
> > record, delimited by a tab. The two fields are placed in a
> dictionary. The
> > problem starts when I try to convert one field to uppercase. Any ide=
as?
> >
> > BTW, I'm new to Python but not programming in general.
> >
> > site_list =3D {}
> > SITELIST =3D open(sitelist_file, 'r')
> > for line in SITELIST.readlines():
> > web_site =3D line.split('\t')
> > print web_site[0],web_site[1]
> > # site_list[web_site[0].upper] =3D web_site[1]
> > SITELIST.close
> >
> >
> > _______________________________________________
> > Tutor maillist - Tutor@python.org
> > http://mail.python.org/mailman/listinfo/tutor
> >
>