Python: C++ style cin, cout in Python

Ready to bring some flavor of C++ into python? If you like cout, cin in C++ and also a python programmer, you’d definitely like this snippet.
import sys
class ostream:
def __init__(self, file):
self.file = file

def __lshift__(self, obj):
[...]

Python: Working in Unicode

While working on unicode based characters in python, you’ll often come across this type error message (this cost me a while to fix).
UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 0-3: ordinal not in range(128)
This will happen if you do not set your character encoding in your python file to UTF-8. First you need to [...]