From the reaction stoichiometry it is obvious that 1 mole produces 1 mole (or 2 moles) of other gas. Now there are two ways of looking at it. One is that from the Avogadro's principle under the same condition of temperature and pressure, equal volumes of all gases contain the same number of molecules - so if there was 1 mole of gas and 1 mole of gas is produced (and the temperature has not changed) pressure must be the same. The other way is to use PV=nRT - for example we know nO2=nCO2 (stoichiometry), VO2=VCO2 (volume of the vessel is constant), TO2=TCO2 (127°C) - it can be easily shown that the only way to keep these things identical is to have PO2=PCO2.
There is no substantial difference between these approaches, as Avogadro's principle was a stepping stone to the ideal gas equation.
Note that for a given vessel and temperature it can be generalized - number of moles of gas is directly proportional to its partial pressure (so if you have a mixture containing 1 atm of oxygen and 2 atm of hydrogen, they are mixed in 1:2 molar ratio).