first problem: easy fix just remember that len() returns the actual
number of items in the list but that list is indexed starting at 0 so
just replace your line of
pick = len(names)
with:
pick = len(names) - 1
and for problem #2:
just use string formating... like for example instead
My personal opinion (with whatever limited weight that has on this list
since I've only answered a few questions - and probably half of them I've
accidentally only sent to the op)/how I read it is that RFC 2822 actually
allows lists to set reply-to header; by my view the list software is
forwarding
because python process the expression on the right side of the assignment
first.
ie d *= 3+4 basically is the equivalent of writing (2) * (3+4).
Hope that explains it.
Nick
On Thu, Jan 31, 2013 at 10:36 AM, heathen wrote:
> why is this:
>
> >>> d = 2
> >>> d *= 3 + 4
> >>> d
> 14
>
> not this:
quite easy to do; just use enumerate - as so:
myString = "The String"
with open('largeFile', 'r') as inF:
for index, line in enumerate(inF):
#myString = "The String" ##Not here because otherwise this gets run
for every single line of the large file (which is nasty waste of resources)
I'd suggest having the newfile open after outfile is defined also a close
statement on newfile - or use it with 'with' such as:
... and replace the last line like so:
with open(outfile, 'w') as newfile:
main(mystring, infile, newfile)
(and looking muchly improved, well done)
Nick
On Fri, Fe