Questions tagged [python-interactive]
158 questions
1
vote
0 answers
Can't get my self.button to work! Writing interactive function in Python.
Ok, so I am definitely new to Python so please bear with my ignorance.
I am writing a practice interactive function with PyCharm.
Basically, I want to generate an interactive window with two text input fields and two buttons.
One button (QUIT)…

Tom Anonymous
- 173
- 1
- 3
- 11
1
vote
5 answers
Analogue of devar in Python
When writing Python code, I often find myself wanting to get behavior similar to Lisp's defvar. Basically, if some variable doesn't exist, I want to create it and assign a particular value to it. Otherwise, I don't want to do anything, and in…

kuzzooroo
- 6,788
- 11
- 46
- 84
1
vote
1 answer
How to immediately execute AsyncHTTPClient() without server (using interactive interpreter)
I typed AsyncHTTPClient sample code from tornado's website in an interactive python interpreter but the asynchronous HTTP request is never executed.
def handle_request(response):
if response.error:
print "Error:", response.error
…

Afriza N. Arief
- 7,696
- 5
- 47
- 74
1
vote
3 answers
Disable automatic printing in Python interactive session
I am going to be holding a Python workshop to teach some beginner level programmers at my college Python.
I am looking for a way to modify the default behavior of Python interactive sessions so that expressions do not automatically print out…

WilHall
- 11,644
- 6
- 31
- 53
1
vote
2 answers
Read / Write simultaneously python subprocess.Popen
I have a simple C program which works the following way:
Ask for input
Print it
Ask another input
Print again
Now iam using python to call this program.
import subprocess
sobj = subprocess.Popen("./cprog", stdin = subprocess.PIPE, stdout =…

Murali
- 21
- 5
1
vote
0 answers
How do I properly redirect sub-processes' output?
I'm making a simple shell replacement for Windows called shellpy (for learning purposes). I obviously want the shell to be independent of the Windows CMD, so I'm redirecting all output to StringIO objects. So far it's working pretty well.
But I've…

Hubro
- 56,214
- 69
- 228
- 381
0
votes
0 answers
How to select multi items from a single Altair dropdown menu?
I want to select multiple items from a dropdown menu that I created as below:
clients_dropdown=alt.binding_select(options=clients, name=‘Exclude Client(s)’)
clients_selector=alt.selection_single(fields=[‘Client_Name’],…

ibuli23
- 1
0
votes
0 answers
Python Interactive Jupyter notebooks (".py") to HTML straight conversion
Is there any way to directly convert the ".py" files with cells as outlined here (https://code.visualstudio.com/docs/python/jupyter-support-py) to HTML?
Currently, I can first convert the ".py" to a normal ".ipynb", then from there I can export it…
0
votes
1 answer
Plot x value after a mouse click in Plotly
I would like to create a candle simulator where the next value is plotted after an event (mouse click or timer).
Instead of showing the whole plot, unshadow the next value on demand (aka append a new value).
The interactive plotly graph allows to…

Almodius
- 3
- 3
0
votes
0 answers
Create a pyspark kernel and interact via another python process
Dear fellow members of community.
I have spark 3.4.0 installed and set up. To run a pyspark terminal, I set up environment variables and it works fine.
I have a python microservice which receives a python code to run on pyspark terminal. How can I…
0
votes
0 answers
How do I make an interactive table in python, using Spyder?
At the end of a long script, I have some outputs that I would like to be able to visualize a number of ways. The following describes what I want and is inspired by similar functionality in Matlab that doesn't seem to be available in…

Alyssa H
- 1
0
votes
0 answers
Why the Shift + Enter shortcut does not send my Python code to the interactive window?
I am trying to write a Python Script in VSCode, and I want to use the interactive window comes with the Jupyter Extention in the process of writing.
I tried to use the Shift + Enter shortcut to run the selected code in the interactive window like…
0
votes
1 answer
How to hide >>> prompt in python3 interactive console? Is there a flag for this?
For copy and paste purposes, I wish to hide the >>> and ... Python prompts whenever I am in the interactive shell console. I have achieved this effect successfully with the command import sys, then sys.ps1 = "" (source). However that only hides >>>.…

Lucas de Assis
- 27
- 4
0
votes
0 answers
ginput() interactive inline plots using jupyter
Is there any way to get ginput() to work to plot inline interactive plots in jupter lab/notebook?
For example; something like:
pts = plt.ginput(2, show_clicks=True)
for p in pts:
plot_trajectory(ax, p[1], p[0], 0.1, 25000)
plt.show()
Would…
0
votes
0 answers
neovim: pwntools process automatically stops when trying to invoke interactive shell
I'm using python pwntools.
I'm using python 3.10.x
This line of code should open a shell for me:
io.interactive()
But while running this file from vim using
!./% it doesn't open the shell doesn't invoke as it was supposed to be. The process stops…

NobinPegasus
- 545
- 2
- 16