Questions tagged [python-interactive]

158 questions
0
votes
1 answer

How to switch between images in interactive way in Jupyter Notebook

If I write the following in my Jupyter Notebook Markdown cell, I get to see an image saved in my "Images" folder However, I want to switch between 3 images, T1.png, T2.png and T3.png saved in my Images folder…
0
votes
0 answers

Is there in Interact/Ipywidgets something similar to Streamlit Multiselect?

I need to query a Pandas DataFrame with a multiselection-like widget. It's pretty easy to do that with Streamlit (streamlit multiselect example) but I wish to obtain the same through Ipython widgets. Another point is that I have to deal with 184…
0
votes
1 answer

Interactive unexpected keyword argument

I am new to python, and I am working on code that displays the ball at the timestamps on a graph. I want to use interactive widget to display how the ball moves on the graph. def f(x): return…
Bennett567
  • 535
  • 1
  • 3
  • 18
0
votes
2 answers

How to get the python interactive shell output of a python code in a variable?

Suppose I have code = '2+3' I want to run this code in python interactive shell and get the output string in a variable. So the result of the execution of code would be stored in another variable called output In this case, the output variable…
aahnik
  • 1,661
  • 1
  • 11
  • 29
0
votes
1 answer

Click on Y axis value of interest to adjust color bars

I am trying to adjust a program, in order to add interactivity to my bar chart, so when I click on Y axis and choose a new value of interest, the color of the bars is adjusted accordingly. I appreciate any help on this as I am new to python and I…
0
votes
0 answers

Python interactive mode custom prompt, Zsh & escaping non-printing characters

I'm using Zsh. I'd like to have a custom prompt in Python interactive mode. Specifically, I'd like to add color. If I do in Python something like sys.ps1 = "\033[38;5;76m>>>\033[0m " then the prompt displays correctly, but the terminal seems to be…
Orius
  • 1,093
  • 5
  • 11
0
votes
1 answer

How to capture final output of an interactive python script within a bash script?

I created a command line interface with Typer to a client for an http server. This starts an interactive login that displays prompts for username, and then password. If valid, it echoes the authorization token to standard output. $ snappy…
Matt Leader
  • 133
  • 1
  • 8
0
votes
1 answer

Streamlit `altair_chart` chart not interactive

I am trying to plot an interactive financial chart, but it doesn’t turn dynamic when I use st.altair_chart (as is the default for altair charts). Here’s the code: base = alt.Chart(df).encode( alt.X('Date:T', axis=alt.Axis(labelAngle=-45)), …
0
votes
1 answer

Plot next image only after current window is closed

I have a bunch of satellite images that I am inspecting for errors and it is pretty tedious. I would like a way to do this efficiently in Python where I can look at an image, close the window when I'm done, look at the next image, etc. without…
la_leche
  • 423
  • 1
  • 7
  • 14
0
votes
0 answers

Pycharm can import dlib via ternimal and `Run` but failed to do so in interactive environment (Pycharm console and `Debug`)

I am confused about different behaviours of Pycharm console and Pycharm terminal. I installed a dlib package in a venv and can import it successfully in Pycharm terminal. No error raised. My console and terminal have the same environments variable…
F Bai
  • 103
  • 9
0
votes
1 answer

Matplotlib graph does not show in Python Interactive Window

The following is my code, but I can't get the plot to show on my Visual Studio Code even though I am running this on the Python Interactive Window, which should usually show a graph plot after running. The tables are showing just fine. I also do not…
0
votes
0 answers

readline fails in venv

The arrow keys don't work on my server, but only when running python from the virtualenv (see example below, where I press the left and right keys). I went over the answers in here: Seeing escape characters when pressing the arrow keys in python…
Hetzroni
  • 2,109
  • 1
  • 14
  • 29
0
votes
1 answer

Why does 'from file import function_name' fail in my interactive Python session but works in a script?

I am moving common functions shared between a couple of Python files in to a third common_commands.py file. To test the functions I imported a couple of functions using: from common_commands import func_one, func_two But got this error: ImportError:…
RTHarston
  • 429
  • 4
  • 13
0
votes
1 answer

how to use interact from ipywidgets more effectively to plot the data?

As I am working on the data science assignment and I want to plot data visualization better so I come across the python interact. I had used the interact previously but here I am stuck in the following code. import matplotlib.pyplot as plt import…
0
votes
0 answers

Jupyter notebook: Interactive plot 10x10 grid of squares and colouring based on slider

I have a dataframe that is 365 rows long, each row has up to 4 columns of values. Each value in the dataframe is between 1 and 100. I would like to plot an interactive graph. Slider for row number index: 0 to 364 Create a 10 x 10 grid of…