Questions tagged [interactive-mode]

59 questions
0
votes
1 answer

Python interactive mode: calling next without using return value does not advance iterator

If I execute, a = iter([1,2,3]) for x in a: print(x) if x==1: z=next(a) I get 1 3 which I expect, since the call to next advances the iterator and skips the 2. However in…
Saúl Pilatowsky-Cameo
  • 1,224
  • 1
  • 15
  • 20
0
votes
1 answer

Slurm interactive mode - run pre-specified command at beginning

On my cluster, I can get a shell for interactive mode if I run: srun -N 1 --ntasks-per-node=1 --gres=gpu:1 --pty zsh However, on this cluster, each node that is allocated has an empty $HOME directory (without the .zshrc), which is stored on a…
0
votes
1 answer

python:how to exit if block during interactive mode

just play with Python, a small question on interactive mode. steps: enter python interactive mode, following line shows detail on interactive mode List item >>>flag=True >>>if flag: . . .     print("flag is True") after above step, i WANT to…
Ben Xu
  • 1,279
  • 4
  • 13
  • 26
0
votes
1 answer

Python3 interactive mode on Linux launches the codes twice

I have written a chess program in Python 3.4.3 and I am running the Python 3 interpreter in the interactive mode as follows: python3 -i chess.py However, the code after the class definitions get invoked twice and I do not know why. My code is on…
Vesnog
  • 773
  • 2
  • 16
  • 33
0
votes
1 answer

Trying to make PLY work for the first time

I'm new to Python and I'm having some problems trying to make PLY works. For now, all I want is to successfully run the example from the PLY homepage. At first I tried to just download PLY-3.8, put the ply folder in the same directory I saved the…
0
votes
1 answer

How to pass commands to gdb from python

I have launched GDB using subprocess.call methond in python .Can any one help how to pass commands to gdb (like 'info threads') from python script.
chenna
  • 159
  • 1
  • 4
  • 14
0
votes
1 answer

Finding draw_if_interactive() in pyplot.py

There are multiple draw_if_interactive() expressions in the pyplot module but I can't find this function's definition anywhere in the module. From intuition and readings, it's an easy guess that the function enables on-demand plotting but where…
user3885774
  • 75
  • 1
  • 1
  • 5
0
votes
1 answer

Unix top command column selection from with another C program?

Is there any way to select the columns that the standard unix top command displays without entering interactive mode. I would like to be able to call the top command from within another C program.
JohnDoe
  • 77
  • 6
0
votes
1 answer

Plotting Serial data in Python how to pause matplotlib figure?

Basically I want to pause the live plot that I have setup here: import serial import numpy as np from matplotlib import pyplot as plt ser = serial.Serial('/dev/tty.usbmodemfa131', 9600) #Setting up the animated plot plt.ion() # set plot to…
sTr8_Struggin
  • 665
  • 2
  • 11
  • 27
0
votes
1 answer

Deleting Lines of a Plot Which has Plotted with axvspan()

I am doing some animating plots with ion()function. I want to draw and delete some lines. I found out axvspan() function, I can plot the lines and shapes with it as I want. But as long as I am doing an animation I also want to delete that lines and…
sema
  • 31
  • 6
0
votes
1 answer

How to disable a modified tclsh interpreter interactive mode?

Run tclsh command without any tcl file, the interpreter will go into interactive mode. Can I simply disable this feature by modifying the tclsh source code ?
zhangailin
  • 926
  • 2
  • 10
  • 20
0
votes
2 answers

Using SWI-Prolog Interactively - Output Taken off

I'm using SWI-Prolog interactively. When I run my query, I get a prefix of the output and the rest is taken off (marked using the string ...|...). Is this normal or should I go back and fix my program?
mrk
  • 3,061
  • 1
  • 29
  • 34
-2
votes
1 answer

How do I set my python command prompt to interactive mode?

I'm starting out with Python, I have installed the command prompt and IDLE. Version 3.7, 32 bits. I am having trouble setting Python to interactive mode. I have tried changing the environmental variable, through the following steps: Going to PC →…
Ani Q
  • 1
-3
votes
1 answer

ATOM function return value is wrong

I have the following code: def do_math(a, b, kind = 'add' ): if (kind=='add'): return a+b else: return a-b do_math(1, 2) I used this page, in order to convert ATOM into the interactive…
Yoel Zajac
  • 453
  • 1
  • 6
  • 11
1 2 3
4