Search code examples
pythongithubjupyter-lab

How to run .py codes on jupyter lab?


How can I run .py files from jupyter lab? I have spent my all coding life using jupyter notebook and jupyter lab but replication codes of research papers are mostly in .py file format

For instance, this is a github repository for beta variational autoencoder. As you can see from the repository, these kinds of repositories are usually comprised of main.py, model.py, which looks a lot different from .ipynb format that I usually use.

Can someone share how to comfortably run these kinds of .py codeson jupyter lab? I would appreciate it a lot if someone tells me a video or an article explaining how to run these .py codes on jupyter lab comfortably.


Solution

  • There is a rather thorough discussion of how to interact with .py files from Jupyter notebook here: How to load/edit/run/save text files (.py) into an IPython notebook cell?

    (No terminal window is needed.)