Questions tagged [python-interactive]
158 questions
1
vote
2 answers
Python 3 dis.distb() assembly language code on interactive promt - Python Bytecode Disassembler
I am running code on my command-line interface with python 3. However, I am confused about why dis.distb() does not give me an assembly language code for an error in print("Hello World) with missing quotes.
C:\Users\jarvis>python
Python 3.7.2…

myverdict
- 622
- 8
- 24
1
vote
1 answer
Axis edits in interactive mode ion() in matplotlib are ignored - scope problem?
I would like to make a plot from a data array that grows in time. I found ion() to redraw my plot, adding new points. Now, adding a new point should erase an old one and to achieve that I had to add clf(). This again means I have to reset my axis…

Allison
- 11
- 3
1
vote
0 answers
Appending python class that uses interactive mode with user input?
I have a class which allows the user to create a region using the mouse. Now I want to create multiple regions by appending objects to a list.
However, when I try to append it just runs once and I get 2 copies of the same region. It seems that…

JR_smith
- 11
- 1
1
vote
4 answers
How to check logical value of an expression in the interactive shell?
Sometimes I want to check the logical value of an expression, so I type it in Python (or IPython) and get the result:
>>> a==3
True
But in other cases it doesn't work that way (here string is None):
>>> string
>>>
So I check the logical value like…

MaxGyver
- 428
- 7
- 21
1
vote
1 answer
Bokeh Plot in Jupyter Notebook not updating
I want to plot some data that has multiple features, and want to make an interactive 2d plot where the user can choose the axis from a list of features, to see how any two features are related. However, in the code I have, the plot does not update…

Jade
- 71
- 1
- 12
1
vote
1 answer
Tensorflow CPU (normal in python interactive shell, but coredump when run script)
I'm trying to learn Tensorflow on Single CPU mode. When I try to run some examples , such as [mnist_softmax.py] it seems that the whole code run correctly and output the expected answer, but shows [Segmentation fault (core dumped)] and generate a…

AcAhe
- 13
- 2
1
vote
1 answer
How to write a python script to interact with shell scripts
I encountered a problem in work. Here it is.
I have several scripts(mostly are shell scripts) to execute, and I want to write a python script to run them automatically. One of these shell scripts needs interactive input during it's execution. What…

leo_z
- 11
- 3
1
vote
1 answer
How to remain in python interactive interpreter after running program?
I am running python program from terminal
python -i abc.py >>
What is happening--
Output:
4 21
>>> >>>
Downloads:~$
Usually if we give…

hunch
- 329
- 1
- 2
- 10
1
vote
1 answer
How to run python interpreter in windows powershell ISE?
According Microsoft, we can't run interactive console like python in it's own powershell ISE console. According to some sources it runs in the background. Can we run the same python interpreter in foreground?

Karan Nadagoudar
- 434
- 1
- 5
- 10
1
vote
1 answer
jupyter notebook: update plot interactively - function has constants and keyword arguments
I want to have an interactive plot in jupyter (4.0.6) notebook using matplotlib (1.5.1). The thing is that the static plot is created with a function that has four variables, two of them are constants, two of them are keyword arguments, and I want…

Claus
- 4,409
- 4
- 19
- 16
1
vote
1 answer
Autocompletion and function definition in Python Interpreter
See the below GIF
How does the documentation for all the functions appear as you type in
the terminal?
I am already familiar with autocompletion and there are bunch to tutorials to do this but what about function definition? Currently I am…

python
- 4,403
- 13
- 56
- 103
1
vote
1 answer
twisted run asynchronous examples and make connections at Python prompt?
The ldaptor project has some example Twisted-based code at an interactive Python prompt. At one point [1], though, the example breaks if you actually try to follow along at the prompt because a function was deprecated--…

Carl
- 695
- 8
- 21
1
vote
1 answer
How to display string format specification help in interactive Python
I'm trying to find help for string formatting in Python. I have tried the following:
>>> help(''.format)
But the help I get is:
Help on built-in function format:
format(...)
S.format(*args, **kwargs) -> string
Return a formatted version…

Chris Snow
- 23,813
- 35
- 144
- 309
1
vote
1 answer
Python interactive after reading sys.stdin
I'm trying to write a small graph parser that reads from stdin and writes the processed output to stdout along the lines of:
# parser.py
G = defaultdict(list)
for line in sys.stdin:
node, neighbor = line.split()
…

SSACody
- 33
- 2
- 6
1
vote
2 answers
Why does list comprehension in my Python Interactive shell append a list of Nones?
I'm testing some Django functionality in my interactive shell
Here's my attempt to probe these objects, note the list of Nones at the end
>>> [print(foo) for foo in CharacterSkillLink.objects.all() if foo.speciality]
Streetwise (Street Countdown)…

AncientSwordRage
- 7,086
- 19
- 90
- 173