# How to work with pure python file (.py)

**URL:** <https://discourse.jupyter.org/t/how-to-work-with-pure-python-file-py/4443>\
**Category:** JupyterLab\
**Created:** [May 18, 2020, 6:11pm UTC](https://discourse.jupyter.org/t/how-to-work-with-pure-python-file-py/4443 "2020-05-18T18:11:23Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [May 18, 2020, 6:44pm UTC](https://discourse.jupyter.org/t/how-to-work-with-pure-python-file-py/4443/4 "2020-05-18T18:44:29Z")

</div>

> [@Anirban\_Chatterjee](#):
>
> I have many execution points in .py file, creating a notebook for each would take up time, Is there a way to just load the .py file and ‘run’ it like one can run a cell? Basically, trying to see if I can go without using an IDE for .py.

You may want to look into the `%load` command which works in a notebook too, see [here](https://stackoverflow.com/a/23549245/8508004) and [here](https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-load).

Plus, in a cell you can do `import <name of script>` to import it into the notebook namespace. (Note you don’t need the `.py`).

As a different route, you may also be interested in Jupytext, see related answer [here](https://stackoverflow.com/a/60251378/8508004).

( **Note:** I had typos in my second item listed in my first answer. They’ve been fixed now).

---

_[View the full topic](https://discourse.jupyter.org/t/how-to-work-with-pure-python-file-py/4443)._
