I've just built a Raspberry Pi as a basic speed camera and want to make some tweaks to existing code. I've programmed before in various languages on and off for lots of projects, but not as a dedicated job.
The code that I'm using is this (it's quite long so I haven't posted it here):
https://github.com/gregtinkers/carspeed.py
I'd like to start by using line_profiler to help tweak the existing code where possible, slowly allowing me to make changes and learn how it works.
I've tried converting the existing script so that;
- The entire code is held within a 'main()' function, including the existing functions,
- Moving the code below the existing function definitions into a new 'def main():' function,
These result in me changing a lot of the existing code to get it to work, which it invariably doesn't and I end up getting lost!
I've followed various guides on using line_profiler and have it working with the existing defined functions, but I want to extend that to the rest of the code.
Am I missing a very easy method of doing this? How should I approach it?