Inconsistency with split() - Script, OS, or Package Problem?
Ethan Furman
ethan at stoneleaf.us
Mon May 9 14:56:13 EDT 2011
James Wright wrote:
> Hello,
Howdy!
> def create_report_index(report): #Here we are creating a simple
> index.html file from data in a text file
> newfile = open(report + '.html', 'w') #Create the index file using
> report name
> for each_value in D4[report]:
> [clean_name, _] = each_value.split('_', 1)
> newfile.write('<a href="' + report +'//' + each_value +
> '/index.htm">' + clean_name + '</a><BR>\n')
Add the line
print("current each_value is: %s" % each_value)
just before the line
[clean_name, _] = each_value.split('_', 1)
I'm guessing you'll see a value with no '_' in it -- at that point you
can track down why.
~Ethan~
More information about the Python-list
mailing list