I faced an annoying thing with PyCharm in the last couple of days. I'm trying to use ipdb to debug my program instead of pycharm debugger but I can only open it in thepycharm i/o console
or in the python console
.
Is there anyway that I can open the debugging session in the terminal window? or even in a new terminal window? I alos want to be able to open the session from the debugging button, and don't write any line like python src/main.py
by my self in the terminal
The main reason I want to do it so I can have an auto complete as I get from ipython
in the terminal, but I couldn't find a way to open the debugging session in terminal window, is there anyway to do it? and plugin that can help? the autocomplete that the python console gives me is very weak and not really helping me
Pycharm 2018.3
Centos 7 64bit
Passing Command-line arguments in PyCharm If you want to pass command-line arguments to a python program, go to “Run > Edit Configurations” and set the Parameters value and save it.
Press Alt+F12 to open terminal within PyCharm, then write in the command you wish to run and press enter. Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. Provide details and share your research!
In a given PyCharm project, I want to run separate independent Python scripts under separate 'run' tab. How do I do that in PyCharm ? As easy as it sounds. Just run your Python scripts and PyCharm will create a separate tab for each in Run tool window.
Click on the toolbar to start a new session in a separate tab. To run multiple sessions inside a tab, right-click the tab and select Split Vertically or Split Horizontally in the context menu. The Terminal saves tabs and sessions when you close the project or PyCharm.
With PyCharm, you can set up line separators (line endings) for newly created files, and change line separator style for existing files. Press Ctrl+Alt+S to open the IDE settings and select Editor | Code Style.
Here is a simple workaround that you can fork an open-source
project from git
and add a patch for persistent history. To install IPDB
you can use the following command to fork the latest version:
pip install git+https://github.com/gotcha/ipdb.git
To install git projects using pip, visit pip install from git repo branch. Just make sure that your IPython version is 6.0 or higher.
Implementation Info: can be found in these Articles. Visit references: Use of IPDB and IPDB Persistent History .
Otherwise, you can also use pudb instead. It enables getting to a real ipython shell
from the debugger and all the commands there are saved.
To launch Debugging Session
, go to Pycharm Windows-Tool-Bar
at the bottom and right click on terminal as follows:
To Open Terminal in Window Mode:
When terminal is open in window mode, then you can open multiple debugging sessions as given below:
At the end you can use the following command to launch debugging sessions using this command:
$
python -m ipdb /path/my_test.py
This will initiate your debugging session using IPDB in PyCharm terminal window.
Here is a test result:
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