PyCharm Run command does not print, python console does

Answered

Hello, 

When I run my code using the "Run" green arrow in the PyCharm IDE, nothing prints and it returns an exit status 0. However, copying and pasting the code into the Python Console produces the desired print statements. What could be the cause? 

See attached screenshots.

Thanks for any help, 

Joshua 

 

 

RUN WITH ARROW: 

 

RUN IN PYTHON CONSOLE:

4 comments
Comment actions Permalink

If you look at the first line of the run console output, you may notice the wrong file is being run. Please create a new run configuration for the file that opened in the editor.

https://www.jetbrains.com/help/pycharm/creating-and-editing-run-debug-configurations.html

3
Comment actions Permalink

That was it, thanks for helping me understand the IDE a little more!

-Joshua

1
Comment actions Permalink

Without getting pulled into constructing failing examples from my code, wheher pycharm prints or does not print is pretty random. E.g. i cant get pstats.Starts().print_stats() to print, sometimes it prints logs but not print statements, the option emulate terminla in output consoloe has no efffect (at least not in the pstats case) ...

0
Comment actions Permalink

Please file a ticket to our issue tracker https://youtrack.jetbrains.com/issues/PY and provide code + steps for reproducing the problem.

0

Please sign in to leave a comment.