Your one-stop shop to starting a Python project with a Raspberry Pi for non developers! Follow this guide to prepare everything you are going to need to start coding, using and learning best practices that will allow your project to scale as you develop your project and skills!
- 1 - Flash Raspbian
- Learn How to flash Raspbian headless (a Linux based, command line based operating system that you can use to run any project you want, blank slate!) to a Raspberry Pi!
- 2 - Connect Through SSH
- Learn how to connect to your Pi remotely, from your main computer, so you don't need to get any extra hardware. No keyboard, mouse, or monitor required!
- 2.1 - Set up a permanent IP Address
- Learn how to set up a permanent IP for your Raspberry Pi, so you can connect to it reliably.
- 2.2 - Remote SSH (from anywhere)
- Learn how to set up your Pi, so you can connect to it from anywhere in the world (not just your house). You will be able to talk to it, and work on your project while on the go!
- 3 - Install Necessary Packages
- Learn how to install the basics you will need for almost any project in your Raspberry Pi! These are dependencies you will need to install most of the packages and libraries you will most likely use in your project.
- 4 - Install Project Specific Packages
- Install packages that you will need to manage a Python project effectively and with best practices.
- 5 - Create a git repository
- Create your first repository! A git repository is a project folder that is specifically designed to handle code development. This will make developing and sharing your code much easier, and it will give you the best commonly used framework for your project.
- 5.1 - Using GitHub
- Learn all you need to manage your code repository on GitHub. Make your code development streamlined by learning best practices on versioning, trialing, development branches, collaboration, and more!
- 5.2 - Set up a self updating local repository
- Learn to use GitHub Actions to set up a repository in your Pi that automatically updates every time you release an update. You won't even need to connect to your Pi, as it will start running new code as soon as you are ready to update it!
- 5.3 - Add a repo to self update
- Learn how to make a new repo self update once you have gone through the initial setup (previous step). The process of making a new repository self-update once you've already set up at least one self-updating repo is slightly easier.
- 6 - Set up your IDE (VSC)
- Learn how to set up VS Code in your main computer. VS Code is an IDE (Integrated Development Environment). It is a piece of software that will allow you to develop code in your project much more efficiently, through the use of various tools. Learn the most efficient way to manage your code repository straight from VSC.
- 7 - Use pyenv and poetry to set up and use your python environment
- Learn how to use
pyenv
andpoetry
to manage your python project's dependencies (packages and libraries you are going to use) in the easiest way. Bothpyenv
andpoetry
are widely used to streamline environment creation and managing.
- Learn how to use
I am a maker, with a mechanical engineering background. I know little to no programming. I tried making some Python scripts before, but often found that I did not know the basics, or "best practices", and my projects would end up suffering down the line. I decided to make this guide as a thought experiment to teach me the right way to start a project, and to remind me on how to start a project in the future should I ever need it.
You, like me, are a person that lacks a background and industry experience in software engineering, but is interested and curious about programming, and would like a comprehensive guide on how to get started, then this guide is for you!
You, like me, would like to learn programming, but fear you don't know where to start, or you need more of the basics and best practices, you might be suffering through one or more of the following:
- You know how to code a little, but you don't know where your code should be located or housed.
- You don't know where or how code is run "in real life".
- Do you run it by double-clicking a file in your computer? Through your terminal?
- Is there a way to run code from your computer at startup?
- How can I have a project going without it having to depend on my computer being online or making sure a python script is running?
- You've seen Raspberry Pis before, but you've never used them to start a coding project from scratch.
- You love GitHub, but you don't really know what it is for, but every developer keeps talking about it, and you are confused and curious.
- You think your code looks okay to yourself but deep down you know if someone who knew what they were doing looked at it he/she would most likely get an instant headache.
- Your code kinda works but is incredibly disorganized and suboptimal.
- You like programming but don't really know where to start.
- How do I go from here, to a point where I can start writing and running Python code?
- You have kind of winged it until now, but realized not knowing best practices, or the "right way" of doing things, or the way that "real developers" used to approach a new project, is setting you back.
- You think you could really benefit from a bit of structure around your development process.
- You need someone to explain you coding from the veeeeeery very beginning. Way before actually coding.
- You feel like you need a solid foundation from where to start, and no learning service online seems to be providing it for you.
If you, like me, have ever had one of these thoughts or any of these apply to you, then this guide is for you!
- Show you a procedure to set up everything you need to start coding.
- Improve your process for coding, from managing dependencies, to sending out automatic updates to computers running your code.
- Provide an easy-to-follow framework that you can refer to every time you need to start a new project.
- Set you up with a remote runner computer (Raspberry Pi) and a development environment in your main computer/laptop.
- Teach you how to code
- Teach you how to structure your code
- Give you best practices on actual coding
-
Jump straight in by learning how to flash Raspbian to your Raspberry Pi!
- Go to 1 - Flash Raspbian.