I have made a dreadful error and am looking for your help!
I have set up my raspberry pi to run a python script at start up by editing the rc.local file. This would be fine except I have written my script to reboot the raspberry pi when it exits. Now I am stuck in an infinite loop and I can't edit anything. Every time my script ends it reboots the pi and starts again!
My program uses Pygame as a GUI and I have a Raspberry Pi 3 running the NOOBS OS that came with it. If you need anymore info please ask.
Any help stopping my script so I can access the pi without losing any data will be greatly appreciated.
Edit - What an amazing community. Thank you everyone for sharing your knowledge and time. I was in a bit of a panic and you all came to my assistance really quick. If you are reading this because you are in a similar predicament I found Ben's answer was the quickest and easiest solution, but if that doesn't work for you I think FrostedCookies' idea would be the next thing to try.
Probably the easiest way is to take out the SD card from your Pi, mount the SD filesystem onto another computer running linux and edit your rc.local script from there to remove the infinite boot loop. You can also backup your data that way incase something goes wrong.
Python script runs on boot then reboots at end - How to regain control?