Visual Studio Code for programming a Raspberry Pi
Lesser Detail
To wrap up the VS Code console tour, I'll describe some of the Activity Bar items not used. The magnifying glass icon represents the Search view, in which you can search for and optionally replace content within the current editor or across multiple files.
The Source Control view (the source tree icon) provides access to source control software that tracks and manages changes to code. Recall when first preparing the Raspberry Pi environment that you installed the Git software package. Git is the most commonly used version control system today. VS Code provides support for Git through the Source Control view.
If Git is established in the Source Control environment and the project being worked on is in a Git repository, then the view will show relevant Git information, such as how many files have been changed and which files have been changed and staged, and will even commit your changes.
Source Control is important even to the amateur developer, and it can be relied on as a form of code backup. After you have spent your time writing the code, it would be nice for it to stick around if your Raspberry Pi development environment were to fail. If Git is using a repository, then the code is safe.
The Run view (an arrow with a bug), the final Activity Bar item to be mentioned, establishes a Python debugging environment. When you select the Run view icon, the debugger needs the launch.json
configuration file. The file will be displayed with some default configurations. A .vscode
folder is created to hold this file.
VS Code debugging allows you to step through code line by line and fix problems. To stop code at a specific point, you can establish breakpoints and conditional breakpoints. Debugging also enables log points for coding [4].
Summary
VS Code provides a development environment that will make you a more efficient Raspberry Pi coder by taking over some of the tasks and freeing time for you to focus on what is important – writing code. Until next time, keep your Pi in that creative oven.
Infos
- Visual Studio Code: https://code.visualstudio.com/
- VS Code Raspberry Pi install: https://code.headmelted.com/
- PEP 8 style guide: https://www.python.org/dev/peps/pep-0008/
- Visual Studio Code for Python developers: https://www.lynda.com/Visual-Studio-tutorials/Visual-Studio-Code-Python-Developers/784291-2.html
« Previous 1 2 3
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.
-
Fedora 41 Beta Available with Some Interesting Additions
If you're a Fedora fan, you'll be excited to hear the beta version of the latest release is now available for testing and includes plenty of updates.
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.
-
Juno Tab 3 Launches with Ubuntu 24.04
Anyone looking for a full-blown Linux tablet need look no further. Juno has released the Tab 3.
-
New KDE Slimbook Plasma Available for Preorder
Powered by an AMD Ryzen CPU, the latest KDE Slimbook laptop is powerful enough for local AI tasks.