how to save variables in one notebook to be imported into another?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 12:24 PM
Say, I have a list of values, dictionaries, variable names in `notebook1.ipynb` that I'd like to re-use / import in another `notebook2.ipynb`.
For example, in `notebook1.ipynb`, I have the following:
var1 = "dallas"
var_lst = [100, 200, 300, 400, 500]
How do I save this to disk and read / import in `notebook2.ipynb` ?
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2023 06:09 PM
You can use %run ./notebook2 after defining variables in notebook1
So notebook2 will use the variables defined in notebook1

