[Tutor] Stupid newbie question

Barış Metin baris@gelecek.com.tr
Sun, 25 Feb 2001 03:54:10 +0200 (EET)


Hello;

You should use parantheses after upper like :

site_list[web_site[0].upper()]= 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 line 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 ideas?
> 
> BTW, I'm new to Python but not programming in general.
> 
> site_list = {}
> SITELIST = open(sitelist_file, 'r')
> for line in SITELIST.readlines():
>     web_site = line.split('\t')
>     print web_site[0],web_site[1]
> #    site_list[web_site[0].upper] = web_site[1]
> SITELIST.close
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>