Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I run commands in PyCharm without having to run the whole script?

Tags:

python

pycharm

I have a Python script with several functions and would like to run different iloc and loc commands to test different things. Since I'm new to PyCharm, I'm not familiar with its different functionalities. How can I run single commands without having to run the whole Python script?

I assume it has to be directly in the Python console. I tried, but it doesn't work.

like image 677
Roger Steinberg Avatar asked Nov 23 '18 19:11

Roger Steinberg


People also ask

Can you run command line in PyCharm?

Use PyCharm features from the command line: open files and projects, view diffs, merge files, apply code style, formatting, and inspect the source code.

Can you run individual lines in PyCharm?

Run to cursor Also, you can Run to Cursor by clicking the line number in the gutter. You can configure whether you want Run to Cursor to work on clicking a line number in Settings/Preferences | Build, Execution, Deployment | Debugger. To skip any breakpoints on the way, use Force run to cursor.


1 Answers

PyCharm has an Execute Line in Console command, the shortcut for which is ALT + SHIFT + E. This will run the selected lines in the Python Console if you have it configured properly.

like image 132
Mihai Chelaru Avatar answered Sep 21 '22 01:09

Mihai Chelaru