[Tutor] Callable? Whats callable?
Sun, 26 Aug 2001 10:03:56 -0700
On Sun, 26 Aug 2001 09:54:07 -0700, Sheila King <email@example.com>
wrote about Re: [Tutor] Callable? Whats callable?:
:Traceback (most recent call last):
: File "C:\My Documents\temp.py", line 12, in ?
:TypeError: argument must be string or read-only character buffer, not
:The point is, y.write(text) isn't going to work, because y isn't a file,
:and .write() is a file method.
:Now, if you try
:at least out_file is a file. So this is a bit better. HOWEVER, text
:isn't a string. And when you try to write stuff to a file, it has to be
:I looked up the findall() command (since I'm not familiar with it) and
:it says that findall() returns a list of all non-overlapping matches of
:pattern in string. Well, there's a problem. text is a list, not a
Oops. I should have checked the compile() function from the re module.
In any case, text is an SRE object resulting from using compile().