In the preparation of Zn(Co1−xCax)2O4 thin films with doping content ratio Cax = 0.00–0.20, analysis shows that no impurity phase is formed in spinel-structure thin films, while doping calcium reduces the grain size of the thin films and the planarization of the surface microstructure. Increasing the doping content ratio of calcium will reduce the ability of the film to absorb blue and ultraviolet light, and reduce the characteristic absorption of ZnCo2O4. The energy gap of Zn(Co1−xCax)2O4 film increases from 2.46 eV at Cax = 0.00 to 2.51 eV at Cax = 0.15. Moreover, doping Ca+2 to replace Co+3 increases the conductivity and carrier concentration, for which the optimal doping ratio is Cax = 0.07. The film resistivity decreases from 270.5 Ω-cm (undoped) to 15.4 Ω-cm (Cax = 0.07) and the carrier concentration increases from 2.54×10e15 (undoped) to 6.25×10e17 cm−3 (Cax = 0.07). Under UV light irradiation and in an environment without any light source, the film exhibits anti–E. coli resistance as high as 99.94% and 99.99%. Thus, P-type Zn(Co1−xCax)2O4 films can be used for antibacterial and electronic components.