بنیاد پایتون کاران فارسی

#what
Канал
Образование
Технологии и приложения
Новости и СМИ
ПерсидскийИранИран
Логотип телеграм канала بنیاد پایتون کاران فارسی
@PSFarsiПродвигать
2,44 тыс.
подписчиков
453
фото
81
видео
610
ссылок
🔰 مقالات و اخبار مرتبط با پایتون فارسی 🎗 گروه رسمی بنیاد نرم افزار پایتون فارسی: @PyFarsi 🎗 گروه برنامه نویسی و امنیت شبکه: @Gozarit | @Gozaritch 🎗 گروه آفتاپیک: @PyFarsi_offtopic | @GozarITOfftopic 🎗 تبلیغات: @GozaritADS
Writing code that runs in the terminal or in your web browser is good fun. Writing code that affects the real world, however, can be satisfying on a whole other level. Writing this sort of code is called <strong>embedded development</strong>, and Python is making it more accessible than ever!<strong>In this tutorial, you’ll learn:</strong>What <strong>embedded development</strong> is and why you would use Python to do itWhat your <strong>hardware</strong> and <strong>software</strong> options are for running Python on an embedded systemWhen <strong>Python</strong> is a good fit for an embedded system and when it’s notHow to write a basic game on the BBC micro:bit with <strong>MicroPython</strong>This tutorial contains code snippets that allow you to build a simple game on the <a href="https://microbit.org/new-microbit/">BBC micro:bit. To access the full code and get a sneak preview on what you’ll be building, click the link below:<strong>Get Sample Code:</strong> <a href="https://realpython.com/bonus/embedded-python-code/">Click here to get the sample code you’ll use to learn about embedded development with Python in this tutorial.What Is Embedded Development?<a href="#what-is-embedded-development"><strong>Embedded development</strong> is writing code for any device that isn’t a general-purpose computer. This definition is a little bit ambiguous, so some examples might help:<strong>General-purpose computers</strong> include laptops, desktop PCs, smartphones, and so on.<strong>Embedded systems</strong> include washing machines, digital machines, robots, and so on.As a general rule of thumb, if you wouldn’t call something a computer, but it still has code running on it, then it’s probably an embedded system. The name comes from the idea of <em>embedding</em> a computer into a physical system to perform some task.Embedded systems tend to be designed to do a single task, which is why we refer to regular computers as “general purpose”: they are designed to do more than one task.In the same way that you need a computer to run regular code, to run embedded code, you need some kind of hardware. These pieces of hardware are usually referred to as <strong>development boards</strong>, and this tutorial will introduce you to a few designed to run Python.Python for Embedded Development<a href="#python-for-embedded-development">One of the best things about learning Python is that it’s applicable in so many places. You can write code that runs anywhere, even on embedded systems. In this section, you’ll learn about the trade-offs that come with using Python for your embedded project and some things to be aware of when starting out.Benefits of Using Python<a href="#benefits-of-using-python">The core benefit that Python brings when building an embedded system is development speed. Python has libraries available for most tasks, and this still mostly holds true for its embedded implementations. You can focus on building your system since many of the problems you’d encounter have been solved already.Since Python is <a href="https://en.wikipedia.org/wiki/High-level_programming_language">higher level than other common embedded languages, the code you’ll write will be more concise. This helps development speed, meaning you’ll write code faster, but it also helps keep your code understandable.Python is <a href="https://realpython.com/python-memory-management/">memory managed. C++, a common choice for embedded development, is not. In C++, you are responsible for freeing up memory when you’re done with it, something that is very easy to forget, leading to your program running out of memory. Python does this for you.Disadvantages of Using Python<a href="#disadvantages-of-using-python">While Python’s memory management is a big help, it does incur a minor speed and memory cost. The MicroPython docs have a good <a href="http://docs.micropython.org/en/latest/reference/constrained.html">discussion on memory issues.Another thing to consider is that the Python…