Cannot read from file opened with mode "x" in Python

Mode “x” is write only, to also read from file, use mode “x+”.