Is there a Variable Explorer for PyCharm

前端 未结 11 686
旧巷少年郎
旧巷少年郎 2020-11-30 20:46

I recently changed from Spyder to PyCharm as a Python IDE. In Spyder I have often used the variable explorer feature (see picture). Is

相关标签:
11条回答
  • 2020-11-30 21:02

    I like Spyder for interacting with my variables and PyCharm for editing my scripts. Alternative Solution: use both simultaneously. As I edit in PyCharm (on Mac OS), the script updates live in spyder. Best of both worlds!

    0 讨论(0)
  • 2020-11-30 21:04

    Right-click on the file and click Run file in console. Everytime you run it, the variables will show in the console until you click the stop button.

    0 讨论(0)
  • 2020-11-30 21:04

    The question is vague so this might be helpful to someone.

    For me I managed to have the Console (so that printing in my script would be shown) AND the variable pane at the same time while in debug mode. For that I did this:

    1. Run code in debug mode
    2. Drag and drop the console into the debugger pane so that now both are together at the bottom pane.

    Visual explanation fo what I did:

    In (I assume default) debug mode:

    during drag and drop:

    and after finally I dropped it and it looks the way I want it:

    0 讨论(0)
  • 2020-11-30 21:04

    If you want to inspect numpy arrays, which are images, you can use OpenCV Image Viewer Plugin.

    https://plugins.jetbrains.com/plugin/14371-opencv-image-viewer

    Disclaimer: I'm an author of this plugin

    0 讨论(0)
  • 2020-11-30 21:09

    The variable list is available in the python console Tools --> Run Python Console... as shown in the screen shot below. Similar functionality for showing variables and watched variables is available in the debugger console.

    enter image description here

    0 讨论(0)
  • 2020-11-30 21:12

    The simple trick:

    put any dummy line at the end of your code, e.g.

    print('hi')

    and set break point at this line.

    Then, run your code in debug mode. Enjoy! The screenshots of editor and debug window are shown for your reference.

    0 讨论(0)
提交回复
热议问题