Design and Implementation of an Online Python Teaching Case Library for the Training of Application- Oriented Talents

Based on the features of Python and the situation of case-based teaching, this paper develops and implements a complete online Python teaching case library. The teaching contents of a Python programming were divided into ten parts: basic knowledge, three basic structures, functions and modules, object-oriented thinking, file and database programming, network and multithreading programming, image programming, web crawling, as well as data analysis and visualization. Each part was provided with several basic teaching cases. Following the idea of software engineering, our case library was designed based on ChaoXing, a famous online learning platform in China. The designed case library offers a clear path from data acquisition, data storage, data processing, to data visualization. It also provides a wealth of up-to-date and extensible contents, enabling learners to apply the knowledge to practice. Through application of the proposed case library, the students all achieved excellent performance, published innovative academic papers, and selected suitable topics for graduation thesis. The library also greatly promotes the abilities of students in computational thinking, programming level, and solving complex engineering problems. Keywords—Python, case-based teaching, case library, teaching practice


Introduction
as mechanics, biology, management, mathematics, and accounting, etc. [6]. Even some open Python courses to support the frontier teaching of the subject in the fields of social sciences and journalism. Case-based teaching is one of the effective methods for teaching language [7][8][9]. In order to stimulate students' interest, Huang and Song [7] presented the Python case in a graphical way, and proposed a graphical case-based teaching plan. Zhao [8] put forward a program design teaching mode integrating general education and professional education for the inter-disciplines, and introduced the case teaching methods related to the material major based on the teaching practice of this major. Song and Huang [9], based on the full computing ecosystem of Python, gave a few interesting and useful teaching cases, greatly enriching the system and content of case teaching. Compared with other completed case libraries of program language constructed for a long time [10][11][12][13][14], the online case-based Python teaching methods and effects have been mostly studied [15][16][17], but there are relatively few studies on the construction of related case library and a lack of case resources.
Introducing the idea of software engineering into the Python programming course, this paper decomposes the solution of large-scale project cases into several basic cases, explains the realization process separately, and then combines them to construct a problem-driven, step-by-step teaching process, thereby improving students' analysis of problems and the ability to solve problems using Python programming. In the teaching process, a mind map [18] was used to explain technical principles, the context of knowledge, and the process of realization.

The Content of Python Courses
Through careful study of various teaching materials related to Python programming [19][20][21][22], it is determined that the teaching content of the Python programming language mainly consists of 10 parts as follows: 1. Basic knowledge of Python, mainly including the basic grammar, and basic data types such as lists, tuples, dictionaries, sets, and string operations. 2. Three basic structure. The sequence is relatively simple; the focus is on the application of selection and loop. 3. Functions and modules. It mainly includes the design and use of functions in practice, how to realize complex functions and code reuse through modular programming, and the installation, introduction, and application of common modules. 4. Object-oriented thinking, mainly referring to the main ideas of oriented object and class, through practice to understand class encapsulation, inheritance, and polymorphism, and realize class reuse. 5. File programming, i.e., the access and operation of files and folders, especially the reading and writing of txt, csv, excel files, to prepare for data access. 6. Database programming, i.e., the realization of the addition, deletion, modification, and checking functions of SQLITE and MySQL databases, and the application as a background data storage function.
7. Network programming and multithreading, mainly including TCP and UDP programming, the realization of email service applications, and the multi-thread programming in the operating system. 8. Image programming, i.e., the application of Turtle, Graphic and Tkinter packages to realize the design of graphical interface and the generation of interesting images. 9. Web crawling. It mainly refers to the principle of web crawler, through the introduction of Urllib2, Requests, BeautifulSoup, Scrapy packages to achieve network data crawling, especially the application of regular expressions. 10. Data analysis and visualization, that is, the application of Numpy, Pandas and Matplotlib packages to realize data analysis and visual representation, and improve the interpretability of analysis results.

Python Teaching Case Library Design
For traditional programming courses, the experimental teaching is synchronized with the content of the textbooks, which limits the experimental content and students' thinking. Especially when the students have the foundation of C language programming and basic programming thinking, stereotyped content structure in ordinary textbooks should be discarded when learning the Python language. It should spend less time teaching and practicing basic grammar and basic structure, but focuses on the later application development.
The case library was designed based on ChaoXing, a famous online learning platform in China. The courses were conducted according to the ten parts of the content in the syllabus. Each part is provided with basic teaching cases, and those with high designability and comprehensiveness. The case library should be designed based on the following principles:

Gradual improvement and clear path
Considering that the students have certain programming thinking and experiences, the teaching content is developed in accordance with their professional cognition, and the thinking of teaching practice should be changed, i.e., clarifying the research ideas of various problems for students from the perspective of software engineering. Thus, for the engineering practice problems raised, the students can perform scientifical analysis independently or through cooperation by group, actively learn relevant knowledge and technology to explore solutions to problems, and achieve the optimization. On this basis, the case library specifically includes 6 modules: basic case, data acquisition, data storage, data processing, data visualization, and user interaction, as shown in Figure 1, which offers a path for comprehensive teaching cases.
The content of teaching practice includes not only basic cases for realizing single knowledge for each module, but also comprehensive application cases with strong comprehensiveness and designability. They include the calculation of PI value of the training loop structure and the calculation of the butterfly effect reflecting the compound interest effect, and so on. The function module includes the classic program of the Tower of Hanoi and the man-machine tic-tac-toe game, and so on. The student management system is still retained in the information system training. In the crawler practice, there are basic cases such as Chinese university ranking crawlers, Baidu image crawlers, social platform network comment crawlers, and campus network search engines. The base case is the cornerstone of the comprehensive case.
The comprehensive case was developed in the execution process of engineering practice. It's gradually implemented and improved following the process of data acquisition, data storage, data processing, algorithms and applications, and data visualization. Thus, a comprehensive project case with higher requirements is finally completed based on the development experience of basic case in each module.

Fig. 1. Python case-based teaching path
In the comprehensive practical case of "sentiment analysis of a certain product user satisfaction on an e-commerce platform", it's necessary to first crawl all the comment information of users who have purchased the product on the e-commerce platform through crawler technology, and then preprocess the comment data, that is, the text deduplication, text cleaning, word segmentation, and removal of stop words. Afterwards, sentiment orientation analysis was performed on the pre-processed data. Finally, the model was continuously optimized to achieve the best results, which were displayed and fed back. Different word segmentation algorithms can be used, such as string-matching algorithms, hidden Markov models, etc. Besides, dictionary-based sentiment analysis methods were used and LDA topic models were constructed, to finally obtain users' positive and negative evaluation of the product, and then feedback to the producers and sellers to improve the quality and services.

Applying the acquired knowledge to practice and keeping up with the times
The goal of application-oriented talent training is to apply. The training concept of new engineering education is to be student-centered and output-oriented for continuous improvement. Only by student development as the prerequisite, and applying the knowledge acquired to engineering practice, the students can make progress, keep pace with the times and seek innovation.
An important research content in text mining is word frequency statistics, which is visually represented in the form of word clouds, and used in many applications. In this case, the famous American writer Henry David Thoreau's work Walden was selected for the analysis of word frequency statistics. The statistical results were compared with the Chinese word segmentation in the above example to learn the similarities and differences in word segmentation between English and Chinese. The word cloud diagram in Figure 2 shows that the frequency words in the novel is meaningless. It includes the nonsense conjunctions, articles and other function words. At this time, it's necessary to remove stop words to solve the problem. The method is also used Chinese word segmentation. Finally, the students take the initiative to think and practice, thereby generate a new cloud map of the word frequency statistics of notional words. The teaching case design should keep up with the topics that students are interested in and social hot spots, that is, the content reflects the times. Web crawling case analysis can be performed from Douban Critic's Operation Red Sea and Hello Mr. Billionaire to the latest My Motherland and Me, which crawls netizen comments and text mining, focusing on hot spots, attracting students' attention, and invoking students to learn Interest, while controlling network public opinion and spreading positive energy.
In addition, this paper also used the cherry blossom blooming case for Wuhan Fighting made by a student of Wuhan University during the outbreak of COVID-19 pandemic. In this case, OpenCV and PIL packages were applied, and the cherry blossom video was taken as the source video. After extracting pixel information frame by frame, a new picture of "Wuhan Fighting" was added, that is, replace all the pixels of the original picture with the new picture with colored text, and finally re-assemble the new video. The new cases combining Internet hotspots and advancing with the times can enrich students' cognition, stimulates their enthusiasm for learning, applies the knowledge in daily life, and cultivates a sense of social service.

Rich content and strong extensibility
The teaching case library should be constantly innovated and updated in the teaching process (Figure 3). The innovation cases of teachers and students should be increased, which not only reflects the deep connotative construction of computer science courses, but also highlights the extensional construction of computer technology in other disciplines to enhance students' sense of professional identity and social service awareness.

Fig. 3. Online Python teaching case library
Case library cover the full computing ecosystem of Python programming, mainly including K12 programming, computer rank test NCRT (Python language), data structure and algorithm, other online courses, programming contest, Website development, machine learning, artificial intelligence, and enterprise applications and competition.
Since the major of computer science and technology in our university is a teachertraining major, students also have the responsibility to teach in K12. In order to cultivate the ability of computational thinking of the primary and middle school students, programming education courses in primary and secondary schools have been gradually opened. And Python courses are set in higher grades. In this context, we added interesting and useful cases, set up graphic and game application cases to cultivate students' STEAM academic ability and innovation. The case-based teaching and game teaching methods can improve the computational thinking ability of young people [23][24].
In the process of knowledge learning, examinations and competitions are effective means to promote and test the effect of learning. The case library covers the contests of Python from easy to difficult, namely the NCRT, the Programming Competition, and the competition for the actual problems of the enterprise. Due to the low requirements, the computer rank exam NCRT has a high pass rate, which mainly examines the basic grammatical rules of the Python language and reading programs. So, it's enough to understand the third-party packages in the Python computing ecosystem and master at least two. The case of the programming competition mainly involves the exam questions and simulation questions in Hebei Trial of the Blue Bridge Cup Programming Competition and the National College Student Programming Competition. This type of competition puts forward higher requirements on students' computational thinking and programming ability, and focuses on the examination of data structures and algorithm part. Such case is representative. The competition cases involving the enterprise engineering practice mainly refer to the cases of past exam paper in the Teddy Cup Data Mining Challenge and other mathematical modeling and big data competitions. Such cases are designed to solve practical problems in production and living. They not only need to consider the realization of functions at higher accuracy and efficiency, but also need to write documents. It is important to train the ability of solving complex engineer.
Finally, case library also includes certain practical projects in Python-based follow-up courses such as Web site design, machine learning, and artificial intelligence. These cases are mainly for students who have spare time to practice and innovate. They can call related packages to implement [25,26], or implement complete algorithms in their own code. These courses are scheduled for follow semesters. If one wants to participate in the competition in the freshman year and sophomore year, they need to understand the related knowledge in advance in the case library, and prepare for the competition with teacher guidance and self-study. Although these cases are somewhat difficult, they are indeed an indispensable part of building a complete picture of the Python computing ecosystem.

Case-Based Teaching Practice
Case-based teaching was conducted in the Python programming courses for the 2015 software engineering majors and the 2016 and 2017 computer science and technology majors. Students learned the basics of Python language through the flipped classroom, and extended from the basic cases to comprehensive cases. In the class, they were issuing the questions, analyzing and then solving problems step by step. Then must pay attention to problem expression and focusing on document writing.
In case-based teaching, students' computational thinking ability and innovation consciousness are also cultivated. A group of practice cases of outstanding student have emerged. They presided over and participated in some innovative projects, and published related papers based on the results of practical training (Table 1). Li et al. [27] discussed the characteristics of unstructured databases, the MongoDB database and its advantages of retrieval, and demonstrated the connection of Mon-goDB. The experiment proved that MongoDB's MongoClient connection is more convenient and faster, the Python-based connection is easier than Java connection. When using Gridfs storage, large files are easy to display. It is recommended to use when storing large files.
Zhao et al. [28] researched, analyzed and sorted out the comments of Baidu Post bar which is from 20 universities in the Beijing-Tianjin-Hebei Region, then applied the Single-pass algorithm, used the IK Analyzer word segmentation toolkit to calculate the text similarity and perform the repeated matching to complete the text mining of all comments. This shall help to find students' concerns, which is convenient for universities to strengthen public opinion analysis and management, and improves school management, and strengthens system construction.
Feng Shilong et al. described a public opinion analysis method based on self-media video platforms in an accepted paper, crawled the comment data in the current mainstream self-media video platforms such as Bilibili and TikTok using web crawlers, and performed sentiment and significant analysis for the keywords after Chinese word segmentation. This can reflect the public opinion of the self-media video platform, propose the meaning and methods of public opinion analysis, and can better assist the government cultural department to monitor public opinion on the Internet.
Zhao Zihua et al. designed a smart dressing APP in an accepted paper. First, she builds a database of users and clothing, and used a user-based collaborative filtering recommendation algorithm to mine and recommend similar users' wearing preferences. Then, she crawled the weather data to perform a new recommendation. The last recommendation effect is more accurate when combining with the weather conditions of the day. Finally, the clothes that are not in the database were linked to the shopping platform and completed a high-quality private exclusive service, which fully satisfied the individual needs of different users for smart dress.
Also, in the selection of the graduation project for the senior year students, Python language also is regarded as their first choice. They can conduct in-depth research on cases in the course teaching. A word analysis system based on the original corpus made by a student applied the Word2Vec model to Chinese and English respectively through the deep learning Ten-sorFlow framework, converted the words into vectors, and input them into the recurrent neural network. In this way, the neural network was trained and finally generated the more readable text. The students collected a piece of Linux code and a piece of English dialogue from the Internet and set the training times of 100, 1,000, and 10,000 rounds respectively for verification. The training effect is shown in Figure 4 and 5. Based on the running log of each training result, the change of experimental loss value was found, as shown in Table 2. Experiments show that as the number of training increases, the loss value gradually decreases, that is, the model training result is closer to the true value; at the same time, as the amount of training text increases, the training effect is better.  The topic of another student's graduation thesis was community discovery. It found the CORPA and SLPA algorithms through the overlapping community discovery LPA algorithm on the Karate and Dolphin data sets, and another LFM algorithm based on local expansion. EQ and ENMI indicators were analyzed to evaluate the pros and cons of community discovery algorithms. The case results are shown in Figure 6 and Figure 7. The study found that the SLPA algorithm has higher requirements for the selection of parameters and it is not easy to choose the termination conditions; the COPRA algorithm is not as sensitive to parameters as SLPA, and the accuracy of this algorithm is better than the SLPA algorithm in small-scale networks. There are also some students who selected topics with highly engineering value such as the sentiment analysis of the barrage in self-media platform and complexity analysis of public transportation network, which shows a good effect. Through continuous tracking of student development and interviews, students all expressed their preference for case-based teaching methods. Especially for complex engineering project cases, their programming level has been improved, no longer afraid of complex problems, and the function analysis of graduation design is more comprehensive, accurate, smooth, and objective-oriented.

Conclusion
Case-based teaching is a commonly method used in programming language teaching. Students can understand algorithm thought and solve practical problems through cases education. For students with programming foundation, they apply the flipped classroom teaching mode to learn Python language, learn basic knowledge after class, analyze basic cases and comprehensive cases in class, explore knowledge points, decompose functions, and gradually implement and test the code, which can increase student participation, and enhance their interest.
The existing teaching case library is designed in accordance with the principle of gradual improvement and clear path, applying the acquired knowledge to practice and keeping pace with the times, and rich content and high extensibility. Due to the limited of class hours, students can learn cutting-edge cases they are interested in by themselves, and prepare for various competition, innovative projects, and graduation design in advance. Through the feedback of teaching practice, it can be found that students are satisfied with the cases, get more motivated to learning, and have a more in-depth understanding of knowledge application and higher programming ability. They achieved good experience in projects, competitions, and graduation theses.
Next, the design of case library should be still students-centered, and enriches the resource library, especially by increasing the engineering practice cases with high designability and comprehensiveness, which is specifically reflected in the following aspects: 1. Focus on extensively developing personalized teaching and interdisciplinary training, then share professional resources with various disciplines such as sociology, bioinformatics, e-commerce, intelligent transportation, network communication, intelligent education, literature, and art, etc. The aim is to strengthen the extensional development of computer technology in various application fields. 2. Strengthen the echelon construction of the team of teachers, and enhance the teaching research by combining the scientific research results of the teachers with teaching cases to improve the level of the cases, and increase the difficulty of challenges. 3. Explore the cases of Python language-based programming education and artificial intelligence education in primary and secondary schools, and increase the duties and capabilities of the social service, which shall provide resources for information technology teaching of these schools.

8 Authors
Shunye Wang is a teacher (Master, Associate Professor) who works in the Department of Electronic Information Engineering, Langfang Normal University. Her research interests include graph theory and its application in social network and intelligent transportation, youth artificial intelligence education and educational data mining. E-mail: shunyew@163.com Dayong Liu is a teacher (Ph.D., Associate Professor) who works in the Department of Electronic Information Engineering, Langfang Normal University. His research interests include Artificial Intelligence and applications, and Wireless Sensor Networks. E-mail: 1270360813@qq.com Ning Wang is a teacher (Master, Assistant) who works in the Department of Electronic Information Engineering, Langfang Normal University. Her research interests include computer vision and Internet of Things applications. E-mail: wnbright567@sina.com Yanxiang Yuan is a teacher (Master, Lecturer), who works in the Department of Mathematics and Statistics of Qiannan Normal University for Nationalities. Her main research interests include Differential Equations and Dynamical Systems. E-mail: yanxiangyuan12@163.com Article submitted 2020-09-02. Resubmitted 2020-10-12. Final acceptance 2020-10-12. Final version published as submitted by the authors.