Solved fcntl import and changed print statements