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

  • From: <mhysnm1964@xxxxxxxxx>
  • To: <program-l@xxxxxxxxxxxxx>
  • Date: Wed, 12 Jun 2019 22:42:59 +1000

All,

 

I have not tried CMD. Readline module does not work under windows at all. 
Cursers also is not supported. PySimpleGUIWx is a simple GUI python module for 
creating GUI interfaces. This works quite well and is very simple to use. I 
have created some GUI dialogs and they are accessible. The PySimpleGUI uses TKD 
(I think that is the correct name) which is from Linux. It is not accessible. 
This is the default and what most Python GUI is built in from my investigation. 
Another module is PySimpleGUIQt for the Qt environment. The documentation is 
very good and provides example. All you need to do is switch the imported 
module and the code should work.

 

 

From: program-l-bounce@xxxxxxxxxxxxx <program-l-bounce@xxxxxxxxxxxxx> On Behalf 
Of Jim Homme
Sent: Monday, 10 June 2019 2:48 AM
To: program-l@xxxxxxxxxxxxx
Subject: [program-l] Re: Command line interface editing using python.

 

Hi,

Unsure if this will help, but check out the cmd module in the Python Standard 
Library.

 

Thanks.

 

Jim

 

 

==========

Jim Homme

Digital Accessibility 

Bender Consulting Services

412-787-8567

https://www.benderconsult.com/our%20services/hightest-accessible-technology-solutions

 

 

From: program-l-bounce@xxxxxxxxxxxxx <mailto:program-l-bounce@xxxxxxxxxxxxx>  
<program-l-bounce@xxxxxxxxxxxxx <mailto:program-l-bounce@xxxxxxxxxxxxx> > On 
Behalf Of juanhernandez98@xxxxxxxxx <mailto:juanhernandez98@xxxxxxxxx
Sent: Wednesday, June 5, 2019 10:56 AM
To: program-l@xxxxxxxxxxxxx <mailto:program-l@xxxxxxxxxxxxx
Subject: [program-l] Re: Command line interface editing using python.

 

Did you figure out an answer for your issue?  I am looking for a similar 
solution.  Readline isn’t platform independent.  I think its just a Linux/unix 
library.

 

Best,

 

From: program-l-bounce@xxxxxxxxxxxxx <mailto:program-l-bounce@xxxxxxxxxxxxx>  
<program-l-bounce@xxxxxxxxxxxxx <mailto:program-l-bounce@xxxxxxxxxxxxx> > On 
Behalf Of mhysnm1964@xxxxxxxxx <mailto:mhysnm1964@xxxxxxxxx
Sent: Saturday, June 01, 2019 1:48 AM
To: program-l@xxxxxxxxxxxxx <mailto:program-l@xxxxxxxxxxxxx
Subject: [program-l] Re: Command line interface editing using python.

 

It isn’t an exercise. I have a list of values that I want to modify by hand. I 
can write them to a file. But I want to have it interactive. Easygui which is 
an easy GUI module is not accessible. I was hoping for Win32. But I cannot 
install it using my version of python. Looks Like I might try and different 
distribution and hope it includes win32.

 

 

From: program-l-bounce@xxxxxxxxxxxxx <mailto:program-l-bounce@xxxxxxxxxxxxx>  
<program-l-bounce@xxxxxxxxxxxxx <mailto:program-l-bounce@xxxxxxxxxxxxx> > On 
Behalf Of Dzhovani
Sent: Saturday, 1 June 2019 6:38 PM
To: program-l@xxxxxxxxxxxxx <mailto:program-l@xxxxxxxxxxxxx
Subject: [program-l] Re: Command line interface editing using python.

 

Hi,

  You can emulate key presses to fill in the text to be edited on the console. 
After the program is done typing it, you can apply your edits and send them 
with enter. However, unless it is some kind of exercise, most likely you can 
just use a command line editor like vim.

 

On 1.6.2019 г. 10:58, mhysnm1964@xxxxxxxxx <mailto:mhysnm1964@xxxxxxxxx>  wrote:

Nick,

 

I am going down the path of GuI. I only need a simple box popping up with the 
value already populated. Cursors I cannot install under windows and I have just 
found out it is not reliable. I am having issues with installing win32gui 
module. Saying the version is not supported. Someone has recommended another 
module which I will check out. 

 

 

I really need to look at the book which was posted a couple of days ago for GUI 
programming. But I don’t have bookshare access at this point of time. I might 
need to check other sources.

 

From: program-l-bounce@xxxxxxxxxxxxx <mailto:program-l-bounce@xxxxxxxxxxxxx>   
<mailto:program-l-bounce@xxxxxxxxxxxxx> <program-l-bounce@xxxxxxxxxxxxx> On 
Behalf Of ntsiklauri2@xxxxxxxxx <mailto:ntsiklauri2@xxxxxxxxx
Sent: Saturday, 1 June 2019 4:45 PM
To: program-l@xxxxxxxxxxxxx <mailto:program-l@xxxxxxxxxxxxx
Subject: [program-l] Re: Command line interface editing using python.

 

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 <mailto:mhysnm1964@xxxxxxxxx> > 
<mhysnm1964@xxxxxxxxx <mailto: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: