This isn’t specific to PYNQ. The PYNQ image is based on Ubuntu.
You can web search for solutions on how to do this on Ubuntu. e.g. this should work:
https://websofttechs.com/tutorials/how-to-setup-python-script-autorun-in-ubuntu-18-04/
For reference, if you want to do this at boot:
Cathal