IPython Autocomplete in PyCharm Run Window - ipython

I am coding in PyCharm Community Edition and making use of the IPython embed function to debug my code. When I run the code, the code stops on the line I have embed and the IPython interactive shell appears at the bottom of PyCharm in the "Run" window. I can inspect my variables and run commands, but all the IPython autocomplete (i.e. tabs) and up and down keys (to retrieve previous commands) don't work anymore. Does anyone know how to get this working from within PyCharm?
Thank you.

Related

Does VS code have variable explorer object like we have it in spyder?

I will post the picture of what exactly I am asking variable explorer in spyder
So do we have this feature in VS code?
I tried a lot to find it on google but was unhappy to not find it.
Open your .py script in vscode
Right click anywhere on the script > Run current File in interactive Window
In the toolbar of the interactive window click on the variable icon
You can now consult the values of variables created by your script
spyder is probably running a REPL (Jupyter is doing that also). From that python process they show the local and global variables, just like a debugger would do on a breakpoint.
If you use Python Interactive you have similar functionality with the Variables Explorer and Data Viewer or use Jupyter notebooks
You can now find all variables in a Jupyter Notebook in VS Code in the Output panel under Jupyter: Variables

How to replicate the following Spyder behavior in VSCode?

I'm new to coding Python in VSCode. Previously I used Spyder but decided to move to VSCode as the project management seems better in it (I could easily switch to other files/folders by clicking on the path, just like in PyCharm). But I really need this one workflow which I still have not managed to do it in VSCode.
write some codes like Selenium.
Click run (F5)
The selenium browser opens up.
I could use the Ipython terminal to access the code interactively (find the element in the browser etc) and send new command.
I would like to have this workflow in VSCode. Im also quite overwhelmed by the difference in these 2 IDEs, for example, in VSCode, you have integrated terminal, a debugging console and an output tab, while im used to have only one-for-all Ipython tab.
Ok, I figured out what I need. Basically I just need to right click on the python file that I want to run on the side bar. Then I have to select 'run current file in interactive window'. The only difference is on the Ipython console, I have to use shift+Enter to send my input instead of just clicking enter. But its not a big deal.

Line number of edit window not showing in interactive window using Visual Studio and conda enviroment

I created a python project with Visual Studio, expecting to develop with conda and ipython, so I set the enviroment to Conda, and made sure to check the ipython within it...
I am expecting the following result, which has references to line numbers in the interactive window:
Turns out that i am getting this (without the line number):
What am I missing to achieve the desired result?
For this walkthrough you should have the Anaconda environment installed, which includes IPython and the necessary libraries:
Open Visual Studio, switch to the Python Environments window (View >
Other Windows > Python Environments), and select an Anaconda
environment.
Examine the Packages (Conda) tab (which may appear as pip or
Packages) for that environment to make sure that ipython and
matplotlib are listed. If not, install them here. (See Python
Environments windows - Packages tab.)
Select the Overview tab and select Use IPython interactive mode. (In
Visual Studio 2015, select Configure interactive options to open the
Options dialog, then set Interactive Mode to IPython, and select
OK).
Select Open interactive window to bring up the Interactive window in
IPython mode. You may need to reset the window if you have just
changed the interactive mode; you might also need to press Enter if
only a >>> prompt appears, so that you get a prompt like In [2].
https://learn.microsoft.com/en-us/visualstudio/python/tutorial-working-with-python-in-visual-studio-step-01-create-project?view=vs-2019

How do you get the code in the canopy editor from the ipython console?

Is it possible to get the code in the currently open editor window in the Ipython console? I am interested in running an Ipython magic function that would grab the code in the current window, and send it to a website for analysis, and then show the response in the console. Any ideas?
Not exactly what you are asking for, but maybe the simplest approximation would be to run the ipython magic %history command and copy the output to clipboard.

Stop ipython pop-up docs

In the ipython qtconsole it automatically displays the documentation for a function when I type the opening parenthesis. For example, when I'm typing
plt.show()
the documentation for pyplot.show is displayed when I've typed
plt.show(
This documentation is displayed in a pop-up window that, much more often than not, blocks my view what I'm typing. Is there a configuration to stop the ipython qtconsole from doing this?
The feature to which you refer is calltips or more precisely IPythonWidget.enable_calltips and is documented at https://ipython.org/ipython-doc/dev/config/options/qtconsole.html. The only effective way I have found to disable it is by adding --IPythonWidget.enable_calltips=False as an argument to qtconsole that in turn an argument of ipython. A command line for all of this is:
ipython qtconsole --IPythonWidget.enable_calltips=False
I have verified this with IPython QTConsole 3.2.0 and believe it generally works for versions below 4, which I have not been able to install yet without breaking QTConsole. (I believe what some refer to as IPython 4 is also known as Jupyter 4. See below for information on Jupyter and disabling calltips in it.)
On Linux and Windows system, generating this command line can be automated using a bash alias. On Windows it can be automated by using it as the Target of an icon configured in its properties.
It is supposed to be possible to disable calltips by setting c.IPythonWidget.enable_calltips = False in the right configuraton file in which c = get_config() is set on the first line. I tried doing this on a Windows 7 system in ipython_qtconsole_config.py and ipython_config.py in ~.ipython\profile_default\ and several other locations, but could not get it to work.
Project Jupyter is the successor to the IPython project and began in 2014. Its website is http://jupyter.org and information about its Qt console is at http://jupyter.org/qtconsole/stable/index.html. In response to a question about disabling IPython calltips, which I submitted to https://github.com/ipython/ipython/issues, I received the following on how to disable calltips for Jupyter:
On the command line
jupyter qtconsole --JupyterWidget.enable_calltips=False
or add
c.JupyterWidget.enable_calltips = False
to
~/.jupyter/juptyer_qtconsole_config.py