56
I dont know if there is any better way instead this locking mechanism, but atleast it looks easy. I am also not sure if printing really isnt thread safe.
Edit: Okay tested it my self now, you are right, you can get really wierd looking output. And you dont need the future import, its just there, because i use Python 2.7.
from __future__ import print_function
from threading import Lock
print_lock = Lock()
def save_print(*args, **kwargs):
with print_lock:
print (*args, **kwargs)
save_print("test", "omg", sep='lol')