While executing a Python program, if you get this message “TypeError: an integer is required” , check which modules are imported. In fact, there are two methods for open(). One is a built-in function whereas the other is part of the os module.
So, if you do an import of all the methods of the os module like this way “from os import *“, then your program will not use the open() built-in fonction. It will use os.open() instead.
Be careful !