In STEAM education, Lego WeDo 2.0 robot kit is a well-known tool for introducing educational robotics in elementary schools. This kit teaches students the skills necessary for future success. It provides a wide array of educational opportunities across subjects, along with lessons and other digital resources. This article presents experimental commands/functions development in Python programming language through a Raspberry Pi, permitting a suitable connection to the Lego WeDo 2.0 robot based on Scratch WeDo 2.0 commands for STEAM robotics learning in advanced classes. The main reasons for developing the commands are that Scratch language is a novice programming, and students gain incorrect perceptions of programming behaviour. In contrast, Python is real-world programming, in which students can utilise the language in future careers, and students can also create dynamic programs in Python using WeDo 2.0. Additionally, in this study, some projects are presented using the constructed Python functions developed by us versus the same programs in Scratch as examples for activities in the STEAM classrooms using Lego WeDo 2.0 Robot Kit. The limitation of this study was the lack of testing functions in actual instructive practice for data collection about the effectiveness of Python WeDo 2.0 commands in the classroom. The contribution of this study lies in the novelty framework of the development of WeDo 2.0 Python functions, which can be utilised in STEAM robotics advanced classrooms for learning in the fields of science, technology, engineering, the arts and mathematics.