[Tutor] MemoryError

Jeff Shannon jeff at ccvcorp.com
Thu Dec 9 00:25:30 CET 2004

Liam Clarke wrote:

>>I'm not sure why you're getting the MemoryError, but it'd be easier to
>>figure out if you posted the entire text of the traceback.
> Traceback: <usual bit about in module..>
> Line 39: seg=codeSt[element:endInd+len(endStr]
> MemoryError
> Hehe. Helpful, no?

Actually, it was the "usual bit about in module" that might *be* 
helpful. ;)  Often, something can be determined by the sequence of 
function calls listed there.  Though I suppose, now that I think of 
it, that since your code is all module-level, there wouldn't be any 
function stack in this case...   Still, in general, when asking for 
help with something that throws an exception, it's always best to copy 
& paste the entire text of the exception.

One thing that I've noticed, which I thought was just a typo in your 
original email but which is duplicated again here (it's not present on 
the web page you linked to) -- you have a mismatched parenthesis in 
your len() call.  It's "[ ... len(endstr]" -- there's no ')' to close 
the function call.  Given that this typo isn't on the web page, I'm 
not sure whether it's actually there in the code you're running or 
not.  I'd have *thought*, however, that if it *is* present, you'd get 
a syntax error rather than a memory error, so it's probably not there 
but you should check it anyhow.  :)

Jeff Shannon
Credit International

More information about the Tutor mailing list