Please note I am a very old newbie.
I intend to make an simple burglar alarm but want to start at the beginning to try to understand coding.
I have a Python code that is triggered by pressing a push button and prints "Button was pressed". (Code 1)
I also have a code that flashes an LED and starts by pressing F5 on keyboard or "Run" in Thonny Python. (Code 2)
Q1. How do I make Code 1 trigger Code 2?
Q2. How do I get Code 1 (or Thonny) to start at Pi Startup so that it is waiting for the button to be pressed without any extra input from me?
Thanks in anticipation from an old newbie.