def open_file(filename, mode='r'):
    "\n    常用文件操作，可在python2和python3间切换.\n    mode: 'r' or 'w' for read or write\n    "
    if is_py3:
        return open(filename, mode, encoding='utf-8', errors='ignore')
    else:
        return open(filename, mode)
常用文件操作，可在python2和python3间切换.
mode: 'r' or 'w' for read or write
def open_file(filename, mode='r'):
    "\n    常用文件操作，可在python2和python3间切换.\n    mode: 'r' or 'w' for read or write\n    "
    if is_py3:
        return open(filename, mode, encoding='utf-8', errors='ignore')
    else:
        return open(filename, mode)