[program-l] Re: Command line interface editing using python.

  • From: ntsiklauri2@xxxxxxxxx
  • To: program-l@xxxxxxxxxxxxx
  • Date: Sat, 1 Jun 2019 10:44:54 +0400

If you want to show text of test after the value of modify you can concatenate 
it. that would work as long as it is a string. if you are dealing with numbers, 
you can pass it to str function and concatenate it that way. see the code below.
x=input(“modify: ”+a)

for detecting keypresses in console, i don't exactly remember the function that 
lets you do that right now. i'll have to look through my projects and get back 
to you.
Hth.
Nick.
Sent from my iPhone

On Jun 1, 2019, at 07:22, <mhysnm1964@xxxxxxxxx> <mhysnm1964@xxxxxxxxx> wrote:

All,
I have a list (array) with pre-populated. I want to modify some of the 
elements via console using python. I have found the input() command  for 
python 3.7. But function does not allow me to insert a variable to be edited.
 
For example:
 
A = ‘test of text’
B = Input (‘Modify:’)
 
The above function does not allow you to show the following and modify:
 
 
Modify: test of text
 
Then I want to use the backspace, arrow keys, etc to change the “test of 
text” to something else and on pressing enter the new value is saved in a 
variable. This I want to do in the console. Not GUI.
 
 
 
 

Other related posts: