-2

I'm starting on Python development using PyCharm and I want not erase the variables content after execute de file, like do Spyder to iteracte over data on Python console.

Like can see on the print the variable resultado is not available on window to set content.

enter image description here

resultado is a pandas data frame, there are some way yo see the CSV table on macOS instead see it on terminal?

PS.: I'm using Python 3.9 on venv.

Augusto
  • 3,825
  • 9
  • 45
  • 93
  • You'd have to copy&paste the module into the console (or import) before using it. Another completely different thing is using the console during the debug sessions, in which case the variable would be available after a breakpoint (which isn't visible in your code). The variable needs to be declared and set before it's available in the console, either way. – bad_coder Jul 09 '21 at 23:59

1 Answers1

0

The „Python Console“ here is basically just your typical Python REPL. It doesn’t interact with the code you have written in the file; it’s basically an empty shell. That’s why it is unaware of your variabel. You could run your file from the shell so it’s in context. But most likely you want to run your file with the interpreter by using the little green arrow in the top right corner and the Python Shell tab on the bottom just for quick prototyping or to try stuff quickly as that’s more what it is intended to do.

Cerealz
  • 121
  • 9