The evolution of the emission spectrum of C 2 molecules (Swan bands (0,0) and (1,1)) was studied with two different methods in two different comets: P/Schaumasse and P/Tempel 2. Comet P/Schaumasse was observed in February 1993 in imagery mode with the 1.20-m telescope of the Observatory of Haute-Provence (France). Three different interference filters were used, centered at 5125, 5160, and 5265 Å. The data processing consisted of computing the ratio of the first two filters (the third one being used to subtract the solar continuum and the sky background). The images obtained show the evolution of the excitation temperature of the C 2 molecules. Comet P/Tempel 2 was observed in spectroscopic mode in October-November 1988, with the 1.52-m Danish telescope of the European Southern Observatory (Chile). The results presented here consist of a reanalysis of these observations, focused on the evolution of the (0,0) C 2 Swan band with cometocentric distance. In both cases the C 2 spectrum reveals some important variations with cometocentric distances up to about 10,000 km for P/Schaumasse and 20,000 km for P/Tempel 2 (which was located further from the Sun during the observations). These observations confirm the interest of modeling the C 2 fluorescence spectrum in comets by taking into account the states of the molecules that are out of fluorescence equilibrium.