# Using Your Module in a Notebook: autoreload

A notebook can import functions from your own .py file, but the kernel keeps the version it imported first, so after editing the file you restart the kernel and run every cell, or turn on %load_ext autoreload and %autoreload 2 to load each saved change before every cell runs.

![Cheat sheet: Using Your Module in a Notebook: autoreload](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/bac275c095604fe5b46262ab389d2502.webp)

- Category: Data Analysis
- Level: Journeyman
- Tags: autoreload, import, Kernel (python), Magic Command, Module (python), python
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/data-module-in-a-notebook-cheat-sheet
