Questions tagged [python-interactive]

158 questions
1
vote
0 answers

PyQt5 window not showing properly in pycharm interactive console

I can't run qt interactively in pycharm 2021.3.2, which is quite annoying. For example, if I run in the pycharm console: from PyQt5.QtCore import * from PyQt5.QtWidgets import * app = QApplication([]) window = QWidget() window.resize(400,…
beesleep
  • 1,322
  • 8
  • 18
1
vote
1 answer

Is there a setting that effects #region #endregion collapsing for Python VSCode?

Last night the #region and #endregion were working fine in VSCode for .py (python) interactive notebook files. Today, the gutter (carrot left of #region) has disappeared ctrl+k,ctrl+0 no longer collapses between #region and #endregion. There's no…
John jt
  • 51
  • 6
1
vote
0 answers

VSCode python interactive window: fix nvidia gpu support for tensorflow / pytorch

I just want to give you the solution for my problem as it took me quite some time to solve it and like always, the solution was very simple. It also addresses this github issue which was closed without answer:…
1
vote
0 answers

Interactive plot with matplotlib

I'm trying to write a function that allows me to pick a point in my polygon and change its coordinates as follows: choose a point p(i) associate it with the coordinates of the mouse then draw the changement the second click stores these…
1
vote
1 answer

VSCode Python Interactive Window, variable explorer

I want a Spyder-like Console in VSCode for python, so I run code in Interactive Window and click vairables as other answers said. However, instead of editor area, the jupyter variables shows in the panel I can't move to the upper right. So can I…
LeonM
  • 23
  • 1
  • 6
1
vote
0 answers

How to create an interactive heatmap with Python?

I'm trying to create an interactive Heatmap in Jupyter : I want to be able to display a graph when double-clicking on the different cells. For instance when clicking on the cell corresponding to correlation between A and B I want to display a graph…
1
vote
1 answer

Pylance "Invalid Character in token" for !pip commands

I am running Python 3.9.5 in interactive mode on VSCode. My first cell looks like this: The error is Invalid character in token "" Pylance . The code still runs fine when I press Run Cell. How can I make Pylance ignore these commands or get rid…
1
vote
0 answers

How can I get all the stocks of each accounts in Interactive Broker IB API?

I have a Master Account which manages multiple accounts. How can I get the portfolio of each accounts? I've been trying the self.reqPositions() but it returns just the accounts with recent trades. for example I have 3 accounts and the I have…
1
vote
1 answer

Making Python Enums safe for interactive work in which one may execute the file multiple times

If I'm doing interactive work in Python and have an Enum that looks like this from enum import Enum class UnsafeColor(Enum): RED = 1 GREEN = 2 BLUE = 3 I may do [In]: socks = UnsafeColor.RED [In]: shoes =…
kuzzooroo
  • 6,788
  • 11
  • 46
  • 84
1
vote
0 answers

How to return value using interact_manual python

I have the following function, which plots UMAP, based on the number of clusters I've chosen, and returns series 'labels'. def UMAPplot_building(file_name, num_clusters): logr_file = pd.read_csv(file_name, sep='\t') projector =…
Sam
  • 11
  • 1
1
vote
0 answers

Initialising a python interactive plot to improve responsiveness

I'm creating an interactive plot which has some lines and annotations etc. A minimum working example is: def make_plot(scale_factor): fig = plt.figure(figsize=(8,8)) # create a figure object ax = fig.add_subplot(1, 1, 1) x =…
Robbie Mallett
  • 131
  • 1
  • 11
1
vote
1 answer

How to execute interactive .exe command with python3 on Windows

I want to invoke an exe on windows with python. The exe file so invoked processes something internally and then prompts for an input and once this is entered prompts for another input. Therefore, I want to keep the prompt inputs in a python list and…
codecrazy46
  • 275
  • 1
  • 5
  • 14
1
vote
1 answer

Matplotlib interactive mode won't work, no matter what I do

I'm using python 3.7.7 and matplotlib 3.3.1 on Pycharm community 2020.1 I want to draw a figure and let the user decide if he likes that figure, by giving some console input. That means I need matplotlib to work in the interactive mode. I tried the…
user46147
  • 232
  • 1
  • 16
1
vote
1 answer

How to get full interpreter startup banner

I am trying to get the startup banner info in Python, not just: f'''Python {sys.version} on {sys.platform} Type "help", "copyright", "credits", or "license" for more information.''' which results in: Python 3.8.3 (default, Jul 2 2020, 17:30:36)…
1
vote
1 answer

Update Holoviews Image interactively with Panel widget

I have a set of grayscale images (2D numpy arrays) and want to display several of them simultaneously according to the state of a holoviews.MultiSelect widget but can't get the images to update when a selection is made in the MultiSelect widget.…
alwaysCurious
  • 523
  • 5
  • 14