I have a very simple python script that should scan a text file, which contains lines formatted as id=\'value\' and put them into a dict.
Because you did from os import *, you are (accidenally) using os.open, which indeed requires an integer flag instead of a textual "r" or "w". Take out that line and you'll get past that error.
from os import *