At present, there are still many problems in computer professional courses, such as the lack of close integration between Ideological and political education and professional content, and the imperfect assessment system on ideological and political education. In order to better carry out ideological and political education through computer professional courses, some principles and measures are put forward to solve the existing problems. Ideological and political elements should be integrated with professional knowledge of computer courses. Teaching through these courses are not only to cultivate the feelings of home and country, and establish a correct outlook on life and values, but also improve scientific literacy and cultivate a scientific and rigorous academic attitude. The key to effectively solve the above problems is to arrange the syllabus with ideological and political elements as the main line, improve the ideological and political assessment system of computer courses, and adopt flexible teaching methods to improve the quality of classroom ideological and political education.