Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
sys.stdout.writelines()
-
I was trying out an example from the Python 2.7 documentation. It used sys.stdout.writelines(). This method failed with the following exception:
'StdoutCatcher' object has no attribute 'writelines'
What is StdoutCatcher?
-
Thanks for noticing, this is a bug. <code>StdoutCatcher</code> is a class that is used internally to redirect output to the console UI in Pythonista. You normally don't have to worry about it.
The bug will be fixed in the next update. For now, you could replace the use of writelines in the sample code with something like this:
<pre>for line in lines:
sys.stdout.write(line + '\n')</pre>