Let's think about it this way for a moment
Once you've written a Python script using a code editor (VS Code) on your computer, you can send that file over to the Pi with scp (from the Linux tutorial) — upload it in the form scp local-file.py pi@raspberrypi.local:/home/pi/. It's even more convenient with the VS Code Remote-SSH extension — it connects VS Code directly to the Pi over SSH, letting you edit/save files on the Pi as if they were local files (no more manual scp needed).
Let's connect it to a real scenario
For a small project (a script or two), scp is quick and simple. As a project grows (many files, frequent changes), consider rsync -avz (from the Linux tutorial) or Git (not covered in the Linux tutorial, but a different, distinct project workflow). VS Code Remote-SSH, meanwhile, can dramatically boost your development workflow's productivity.
Let's look at it together
# Upload a single file
scp led_blink.py pi@raspberrypi.local:/home/pi/
# Upload a whole project folder
scp -r ./my-project pi@raspberrypi.local:/home/pi/
# Sync (only changed files)
rsync -avz ./my-project/ pi@raspberrypi.local:/home/pi/my-project/After running the scp command, you should be able to ssh in and see the file/folder has landed in the Pi's home folder.5-minute try-it
Write a Python script (something like led_blink.py) on your computer and upload it to the Pi with scp (if you have a Pi).
A quick word of caution
If you run scp on public Wi-Fi (a café, say), remember the 'Network Security Basics' lesson from the Cybersecurity tutorial — scp/SSH is encrypted, but you still need to mind the trust level of the network as a whole.