Dan in CA
I was going to suggest that if you are running the newest version of ospi.py you could put your code into a plugin as a separate file in the plugins directory. It looks like you already figured out how to make it work.
Your English is good. No need to apologize.