Is there a Variable Explorer for PyCharm
Solution 1
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.
Solution 2
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!
Solution 3
For your second question: you can also select your code and press shift + alt + E
to run a part of your script on to the python console
Solution 4
If you want to inspect variables that contain arrays or datasets, like Spyder and see them as a nice table, you can do bellow :
1- Put a breakpoint after the variable that you like to inspect ( in my case, it's dataset
) :
2- Run the debugger ( the little bug on the top-right side of pyCharm).
The debugger will then stop on the line and you'll see something like below in your debugger window at the bottom of the pyCharm.
3- Right click on the variable and select View As DataFrame
4- You then will be presented by a nice table like below :
Solution 5
PyCharm has SciView for exploring variables in almost exactly the same manner as Spyder. Simply execute the selection or cell in console, then click View as Array in the Special Variable pane. Special Variable Pane
Admin
Updated on July 12, 2020Comments
-
Admin almost 4 years
I recently changed from
Spyder
toPyCharm
as a Python IDE. InSpyder
I have often used the variable explorer feature (see picture). Is this feature also available inPyCharm
?I found this here, that "
Variable explorer in Python console (traff)
" should be included inPyCharm 3
, but I cannot find that. Maybe someone could tell me how to use that tool. -
Admin about 10 yearsGreat, is it possible to run an entire script in the python console? Or do I have to run line by line? Also, how would I access the debugger console?
-
andrewmo about 10 yearsYou can paste chunks of code into the console and it will execute. See this answer for how to set up debugging. stackoverflow.com/a/10240047/3435646
-
andrewmo about 10 yearsEven better than pasting code into the console, just select the code in the editor, right click and choose Execute Line in Console... Then open up the debugger console and see the results. You can also execute chunks of code in the Evaluate Expression... dialog. (One thing I discovered about this is that Print statements show up in the console, not in the expression dialog)
-
Rutger Hofste about 8 yearsJust switched from Spyder to pycharm as well. I can't find my assigned parameters in this huge list of variables. Is there a way to filter this? Or where can I find if I assign foo = 2 + 2 for example?
-
lppier almost 8 yearsI think the Spyder does a better job at being "Matlab" than PyCharm. The variable explorer in Spyder looks more useful, like how one would use it in Matlab.
-
Bagusflyer almost 6 years@lppier Agree. Although PyCharm looks better.
-
lppier almost 6 years@ZhouHao there is a new kid on the block, check out JupyterLab, I've been using it. I like how it is light on loading tables.
-
Mike_K over 5 yearsSince my Spyder permanently broke, I found this as a good enough work around. Thanks! shift + alt + E to excecute code makes PyCharm enough like Spyder for me.
-
Srinath Ganesh about 5 yearsmoving towards this! pycharm is more easy to code while spyder is better to understand data
-
Mudasir Younas almost 5 yearsThank you for pointing out, SciView feature of Pycharm will give you the same data visualization as Spyder, simply select the part of code you want to execute and press shift + alt + E to execute and then visualize in SciView by clicking on View as DataFrame.
-
Charlie Parker over 4 yearswhat I have is that in debugger mode there is both a console window and a debugger window but the debugger window does NOT show me what my print statements are printing. Which I find annoying. The ideal thing would be is both the debugger and the console in debug mode had the Variables watching panes. Is that not possible?
-
Charlie Parker over 4 yearsis there a way to google more information about this functionality? Like what is the name of this functionality? Or you have a link to share?
-
Charlie Parker over 4 yearswhat if I want to see what is being printed to the console AND the variables at the same time?
-
Charlie Parker over 4 yearswhat I have is that in debugger mode there is both a console window and a debugger window but the debugger window does NOT show me what my print statements are printing. Which I find annoying. The ideal thing would be is both the debugger and the console in debug mode had the Variables watching panes. Is that not possible?
-
Maulik Madhavi over 4 years@CharlieParker you can click to the "4:Run" and see the console stdout
-
TokyoToo about 4 years@SrinathGanesh My setup is Anaconda agnostic. Meaning 100% pyenv. But I'm thinking of installing miniconda so I can use Spyder and PyCharm together. Is there any risk of PATHs breaking when installing Anaconda since I already have pyenv/python 3.7 + 3.8 since Anaconda python is also 3.7? Can I just go ahead and install Anaconda?