To inspect variables after running a .py file in an IPython session, you can follow these steps:

  1. Start IPython: Open your terminal and start an IPython session by typing ipython.

  2. Run the Python File: Use the %run magic command to execute your Python script. For example:
    %run your_script.py
    
  3. Inspect Variables: After running the script, all the variables defined in the script will be available in the IPython session. You can inspect them by simply typing their names. For example:
    print(variable_name)
    
  4. Use IPython Features: You can also use IPython’s built-in features like whos to list all variables and their types:
    whos
    

This approach allows you to interactively explore and debug your script’s variables.


This site uses Just the Docs, a documentation theme for Jekyll.