errno [符号错误码]

    https://docs.python.org/2/library/errno.html#module-errno

    import errno

    try:
        fp = open("no.such.file")
    except IOError, (error, message):
        if error == errno.ENOENT:
            print "no such file"
        elif error == errno.EPERM:
            print "permission denied"
        else:
            print message
文档更新时间: 2018-11-21 17:38   作者:RuM