Tecnical question to devs.


Gabriele Battaglia
 

Hello.

I apologize to those who aren't interested. Here is a tecnical question specific to developers or to those of you who have programming skills.


As you may know, I like programming some small tools with Python3.

My script run on console only, at least for the moment, :)


I'm always searching for a non-blocking input method which allows me to monitor the keyboard while the script is doing something else.


Before I wanted to create cross-platform applications, so I couldn't use solution from Microsoft. But now that I'm more and more disappointed from VoiceOver on MacOS, I'm dismissing my iMac computer and rebuilt my home station back on Windows again. So I can use MS solution even though I won't be able to give my script to those blind friend who continue to use MacOS on their computers.


What I need is called msvcrt, with its functions kbhit (a boolean value true when a key is pressed and getwch which reports that key). There would be also getch but I don't still know exactly what it is for.


The problem with NVDA is for instance,

if I wrote this:


import msvcrt

print("Gimme a character: ",end="")
while True:
    if msvcrt.kbhit:
        choice=msvcrt.getwch()
        break
print(choice)

NVDA speaks out the output but I have nothing on my Braille display.

On the other hand, if I import sys also and I call sys.stdout.flush() after the print() statement, I can read the output normally as it happens with a simple print() statement.


Now, 4 questions:

1. Why this happens on my Braille Display?
2. What is flush and what it does?

3. Is there some, more elegant :) way to fix this problem?

4. Do you know some library, simple to use, for a non-blocking input pourpose?


Many, many thanks to all.

Gabe.


 

Gabe,

You are highly unlikely to get an answer to your queries (which are good ones) on this group since it is almost entirely composed of end users and is focused on end users of NVDA.

You really need to be asking this on a blind developer list, of which there are many.  One of the most recently recommended is the Program-I List for Visually Impaired Developers on freelists.org.  If Jackie and Joseph Lee both like it, that's recommendation enough for me.  I would strongly suggest you join and start asking away there, as the community is dedicated to just these sorts of questions.
--

Brian - Windows 10, 64-Bit, Version 21H2, Build 19044  

The instinctive need to be the member of a closely-knit group fighting for common ideals may grow so strong that it becomes inessential what these ideals are.

       ~ Konrad Lorenz (1903-1989)

 


Devin Prater
 

That's an L, not an I. :) the URL is:


On Wed, Jan 12, 2022 at 12:51 PM Brian Vogel <britechguy@...> wrote:
Gabe,

You are highly unlikely to get an answer to your queries (which are good ones) on this group since it is almost entirely composed of end users and is focused on end users of NVDA.

You really need to be asking this on a blind developer list, of which there are many.  One of the most recently recommended is the Program-I List for Visually Impaired Developers on freelists.org.  If Jackie and Joseph Lee both like it, that's recommendation enough for me.  I would strongly suggest you join and start asking away there, as the community is dedicated to just these sorts of questions.
--

Brian - Windows 10, 64-Bit, Version 21H2, Build 19044  

The instinctive need to be the member of a closely-knit group fighting for common ideals may grow so strong that it becomes inessential what these ideals are.

       ~ Konrad Lorenz (1903-1989)

 


 

Devin,

Thanks.  Though I will say that the link I gave was correct, taken directly from the Freelists subscription page.

Why in heaven's name they didn't use either a capital 'L', to make that clear, or a font that differentiates lowercase 'l' from uppercase 'I' I do not know.  I thought it was someone's catchy idea for not spelling out 'eye'.

But when you are actually reading that page the 'l' after the "program-" and the "I" in "V.I." are visually indistinguishable.
--

Brian - Windows 10, 64-Bit, Version 21H2, Build 19044  

The instinctive need to be the member of a closely-knit group fighting for common ideals may grow so strong that it becomes inessential what these ideals are.

       ~ Konrad Lorenz (1903-1989)

 


Gabriele Battaglia
 

Thank you.

I just posted there too.

Ciao.

Gabe.


Steve Nutt
 

Hi Brian,

 

It’s program-l, not program-i.

 

All the best


Steve

 

--

To subscribe to our News and Special Offers list, go to https://www.comproom.co.uk/subscribe

 

Computer Room Services

77 Exeter Close

Stevenage

Hertfordshire

SG1 4PW

T: +44(0)1438-742286

M: +44(0)7956-334938

F: +44(0)1438-759589

E: steve@...

W: https://www.comproom.co.uk

 

From: nvda@nvda.groups.io <nvda@nvda.groups.io> On Behalf Of Brian Vogel
Sent: 12 January 2022 18:51
To: nvda@nvda.groups.io
Subject: Re: [nvda] Tecnical question to devs.

 

Gabe,

You are highly unlikely to get an answer to your queries (which are good ones) on this group since it is almost entirely composed of end users and is focused on end users of NVDA.

You really need to be asking this on a blind developer list, of which there are many.  One of the most recently recommended is the Program-I List for Visually Impaired Developers on freelists.org.  If Jackie and Joseph Lee both like it, that's recommendation enough for me.  I would strongly suggest you join and start asking away there, as the community is dedicated to just these sorts of questions.
--

Brian - Windows 10, 64-Bit, Version 21H2, Build 19044  

The instinctive need to be the member of a closely-knit group fighting for common ideals may grow so strong that it becomes inessential what these ideals are.

       ~ Konrad Lorenz (1903-1989)

 


Steve Nutt
 

I think it was the text you added to the link when inserting it.

 

All the best


Steve

 

--

To subscribe to our News and Special Offers list, go to https://www.comproom.co.uk/subscribe

 

Computer Room Services

77 Exeter Close

Stevenage

Hertfordshire

SG1 4PW

T: +44(0)1438-742286

M: +44(0)7956-334938

F: +44(0)1438-759589

E: steve@...

W: https://www.comproom.co.uk

 

From: nvda@nvda.groups.io <nvda@nvda.groups.io> On Behalf Of Brian Vogel
Sent: 12 January 2022 19:05
To: nvda@nvda.groups.io
Subject: Re: [nvda] Tecnical question to devs.

 

Devin,

Thanks.  Though I will say that the link I gave was correct, taken directly from the Freelists subscription page.

Why in heaven's name they didn't use either a capital 'L', to make that clear, or a font that differentiates lowercase 'l' from uppercase 'I' I do not know.  I thought it was someone's catchy idea for not spelling out 'eye'.

But when you are actually reading that page the 'l' after the "program-" and the "I" in "V.I." are visually indistinguishable.
--

Brian - Windows 10, 64-Bit, Version 21H2, Build 19044  

The instinctive need to be the member of a closely-knit group fighting for common ideals may grow so strong that it becomes inessential what these ideals are.

       ~ Konrad Lorenz (1903-1989)