나는 파이썬에 관한 15 세 이상의 책에서 발견 한 다음 코드를 사용하고 싶습니다 (우리는 현재 파이썬 2.7을 사용하고 있기 때문에 백 포트 문제 때문에 파이썬 3에 갈 것입니다. 주요 프로젝트).파이썬 - 찾을 수 없습니다 fcntl.FNDELAY
import os, popen2, fcntl, select
def makeNonBlocking(fd):
fl = fcntl.fcntl(fd, fcntl.F_GETFL)
try:
fcntl.fcntl(fd, fcntl.F_SETFL, fl | fcntl.O_NDELAY)
except AttributeError:
fcntl.fcntl(fd, fcntl.F_SETFL, fl | fcntl.FNDELAY)
'fcntl.FNDELAY'특성을 찾을 수 없다는 것이 문제입니다. 1 시간 넘게 인터넷 검색이 끝났습니다. 에 NULL 문을 사용하여 코드를 교체하는 것은 리눅스 민트 17.3
가능한 복제본 [python의 fcntl 모듈의 위치는 어디입니까?] (https://stackoverflow.com/questions/7723571/where-is-the-location-of-the-fcntl-module-of- python) – Robin