Please go easy on me, its my first days trying to use python
and I already have problem with setting up enviroment.
When I use IDLE
with code:
import pandas as pd
column_names = ["a,b"]
dataset = pd.read_csv('abdataset', names = column_names, index_col = False)
dataset
shows the whole dataset in quite good way.
Whenever when I try same code on PyCharm
and go RUN
on the console I can only see
Process finished with exit code 0
Is there any way to configure run console to show output like IDLE
do?
It is really not PyCharm specific behavior.
Python is an interpreted language, i. e. it executes every command immediately as you write it and confirm it with the Enter key. One command after the other.
But - as in other interpreted languages - you have another option: Write in advance all your commands into a text file and then ask Python to perform them as a batch - again one command after the other, but very fast.
In the first case - execution immediately after pressing the Enter key, it is comfortable to find of the value of a variable (or of an expression) by simply writing them - and Python display it in the standard (sometimes ugly) form. It is performed in the Python console environment, available in PyCharm IDE, too (e. g. from menu View | Tool Windows | Python console
).
In the second case (the batch processing of commands) it would be not so comfortable, as commands are executed in a very fast sequence and you are generally not able to tell which output value corresponds to which variable, moreover if you often don't see your commands on your monitor. So in this case (launching a .py
or .pyc
file) this approach is not used and you have print them explicitely with the print
command (Python 2) or print()
function (Python 3). In PyCharm IDE you perform this action as you did: By running the appropriate Python file from your project.
So you have 2 possibilities in PyCharm:
print
command / print()
function.Note:
In the IDLE you have the same 2 possibilities with the same behavior:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With