Questions tagged [python-interactive]

158 questions
2
votes
0 answers

Interactive plot with Matplotlib in web browser for anyone to run

I have made a script in Python to visualize the intersection of a line between two points and 2 circles. The code runs really well but I'd like to also be able to share this with people who don't have to install python or library to run it. Like in…
Chris Ze Third
  • 632
  • 2
  • 18
2
votes
2 answers

click event on network's node using pyvis on jupyter lab

I am working on a project in applied data analysis and was trying to add a click event to some precise nodes in the network G. I found some poor documentation on this topic and tried to implement this in my code. Here below is a simplified example,…
2
votes
0 answers

VSCode Version 1.60.0 Changed Interactive View to Epilepsy -- Old or Web view available?

Is there a way to revert back to the older versions Interactive View, or any Interactive view options I should be aware of? I work with python in interactive notebooks and the recent update in the last couple days to 1.60.0 has changed my…
John jt
  • 51
  • 6
2
votes
1 answer

Jupyter interact ipywidgets: several widgets for one argument

Is it possible to link several widgets to one argument? I have these three boolean widgets: import ipywidgets as widgets from ipywidgets import interact, fixed w1 = widgets.Checkbox(value=False, description='Widget 1') w2 =…
Colle
  • 154
  • 1
  • 11
2
votes
0 answers

How to make sure that a file is loaded into script

Is there any way to make sure that a csv, or just any file in general, is loaded into a script? I'm trying to make an interactive menu, and I want to make sure, that the menu options are only running when a valid file has been loaded to the script:…
2
votes
0 answers

python pickle.dump not activating?

Preface: I realize this code is finding Fibonacci numbers, not prime numbers. Question: For some reason, the savework() function is not working. When I run a python interactive session and repeatedly run get_next_prime(), it produces the next number…
2
votes
4 answers

Initialize interpreter with variables

How do I initialize the python interpreter such that it already has variables in its memory? For example, how could I initialize a[n i]Python interpreter, and type as my first input: In [1]: today Out[1]: '2015-05-05 17:49:32.726496' without first…
Walrus the Cat
  • 2,314
  • 5
  • 35
  • 64
2
votes
1 answer

ipywidgets StaticInteract plots all images combination

I am using iPython notebook to test interactive functionalities. The following example (from here) worked fine for me several months ago. However, if I run it now, it plots all the images from possible combinations. I am not sure if this is a…
giosans
  • 1,136
  • 1
  • 12
  • 30
1
vote
0 answers

How can I customize hvplot plotted from an interactive object?

I am trying to make interactive dashboards from my data. I use panel. I have tha scatter hvplot below and I want to add customization, like VSpan or VLine elements. My problem is I am working with interactive objects. My problem was that these…
1
vote
1 answer

plotly error: ValueError: The data property of a figure may only be assigned a list or tuple that contains a permutation of a subset of itself

I am simulating some data and trying to plot various samples of it using plotly and ipythonwidgets. I created dropdowns to let people choose the sample size and the number of samples that they want to collect from a population distribution generated…
1
vote
2 answers

How to close an open trade using API of Interactive brokers

everyone I'm trying to write a little code using the Interactive brokers API I opened a trade using the API of Interactive brokers and now let's say after it is profitable I want to sell it What code do I need to write in Python to sell the open…
1
vote
3 answers

Failed to start the Kernel. OSError: [WinError 123]

Since a few days I can't run my code (not even a simple print("Hello wolrd")) file in my python interactive window anymore. When I try to start the kernel I get the following message: Failed to start the Kernel. OSError: [WinError 123] Die Syntax…
1
vote
0 answers

Automatic quit of a python program in interactive mode

I'm writing a python (v. 3.9) program intended to be run in interactive mode. Program needs an argument to run properly. So, I try to check if the argument is present or if it is not in order to continue with the following lines: import sys if…
Carlos
  • 11
  • 2
1
vote
0 answers

Visual Studio - Execute Project in Python Interactive - Not working

In Visual Studio I'm trying to execute my script in the Interactive Window (Ctrl+Shift+F5), however I get either one of the following error messages (depending on whether I executed commands in the Interactive Window yet): The interactive window has…
SuperUser01
  • 199
  • 1
  • 13
1
vote
1 answer

Dynamically change the coordinates and the text of annotation with slider in Bokeh plot

I have a Bokeh plot in which I have a slider. I want to change the coordinates of the line drawn with the slider, as shown in the screenshot of the figure. When I change the slider, the line changes its coordinates. I tried using a slider widget…
brocktree
  • 15
  • 4
1 2
3
10 11