[Tutor] "Internal Server Error"

Jon Cosby jcosby@mindspring.com
Sun, 9 Sep 2001 10:19:33 -0700


Can somebody tell me why this works:

x = dict.items()
x.sort(paircomp)
for k, v in x:
	k = string.replace(k, dir + '/', url)
	k1 = string.replace(k, url, "")
	print '<a href=\"' + k + '\">'
	print '<b>', k1, '</b></a>&nbsp;', v, counter(v), 'matches<br>'
print '</body>'


But when I modify it slightly,


if len(dict) = 0:
	print '<h3>No matches found</h3>'
else:
	x = dict.items()
	x.sort(paircomp)
	for k, v in x:
		k = string.replace(k, dir + '/', url)
		k1 = string.replace(k, url, "")
		print '<a href=\"' + k + '\">'
		print '<b>', k1, '</b></a>&nbsp;', v, counter(v), 'matches<br>'
print '</body>'


I get an "internal server error"?


Jon Cosby

jcosby@mindspring.com
www.jcosby.com