write(path,content), open.write replacement. python2 and python3 compatible