Jupytext [1] has been a good option to keep scripts alongside notebooks. The advantage is that it also keeps both versions synced so you can edit whichever you want (just not at the same time, as the browser will not live update cell contents for you).