a compatible writing between python2 and python3