Another example could be testing out a piece of code that we’re not familiar with but would like to see the results of immediately without creating a whole file associated with it. For example, if we want to validate that the “numpy” Python package has been installed, I can open up a Python shell and run an import command:įigure 1: Demonstration of import in a Python shellĪs you can see above, it looks like I do not have that module installed. Since Python has an interpreter it can also be used to test out code on the fly without any compilation necessary. With Python, types are a thing of the past, so variables are much easier to handle (albeit this can get you into trouble sometimes). Python is also not nearly as finicky of a language compared to C++. While compile code may run faster, interpreted code allows users to rapidly iterate and test out code very quickly since the compile stage has been removed. Python functions as an “interpretive” language, which means the code is interpreted and executed on the fly versus compiled code. What is MicroPython and why use it?įor those who are familiar with the Python language there is a very obvious benefit of using it over a compiled language such as Java or C++. In this article we will be looking at an overview of MicroPython and how to work with it on a Raspberry Pi Pico. In comes MicroPython, which is a programming language targeted for embedded devices such as the Arduino Nano 33 BLE, ESP8266 (e.g. This scripting language became extremely popular over the years due to its user-friendliness, being quick to learn, and immediate runtime through an “interpreter.” Over time, embedded engineers looked for that same, fast language without all the compiling baggage and strict language requirements. If you speak to almost any hardware or embedded engineer who dabbles in code, you’re most likely to discover that they have some (if not lots) of experience with the Python programming language.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |