Molecular orbital (MO) theory is one of the most important theories to understand the electronic structure and microscopic properties, and it is also the key and difficult point in the teaching of inorganic chemistry and theoretical chemistry for undergraduate and graduate students. Since there is lack of the intuitive and quantitative diagrams for the formation of molecular orbitals from the atomic orbitals, as well as thes-p orbital mixing and the energy level crossing in the present textbook, students have difficulty in understanding the MO theory. In this paper, we introduce the computational chemistry into the teaching of the MO theory. Based on the theoretical results calculated by Gaussian 03 program, the images and energy levels of molecular orbitals for F2, O2, N2, HF and CO are obtained and analyzed, which makes the abstract theory quantitative, intuitive, and easily to understand. Correspondingly, the rules of molecular orbital bonding and electron filling are well explained, which helps students to better understand the MO theory, especially for the s-p orbital mixing and the energy level crossing of σ2pz and π2p orbitals. According to the molecular orbital analysis of F2, O2, N2, HF and CO, the electronic configuration of CO2 is analyzed by using MO theory. On the basis of the teaching practice above, the students' initiativity and enthusiasm are greatly improved, and the effective learning of MO theory is realized.