Re: Python pring function with flush=True NVDA not reading the updated messages in Windows PowerShell


Quentin Christensen
 

Hi William,

You might get more responses for these Python questions in the NVDA developer group: https://groups.io/g/nvda-devel

Kind regards

Quentin.

On Sat, May 14, 2022 at 7:04 PM William <xsuper.sillyx@...> wrote:
Hello,

This question is partly related to NVDA and partly related to Windows
PowerShell.


Supposed I have the following python script and stored in a python file
'test.py', which print out a new string of text after every second.


import time

for i in np.arange(10):

     print('Sleeping', f"{str(round((i-1)/secs*100,
0)).removesuffix('.0')}%", end="\r", flush=True)

     time.sleep(1)

1. I open Windows PowerShell

2. type python test.py

3. the script starts running

I am expecting that NVDA can automatically speak out the new string of
text, but in my test, after the first 'Spleeping...' was spoken, NVDA
did not speak the updated messages.


What can I do to make NVDA speak the updated messages? Thanks.

William











--
Quentin Christensen
Training and Support Manager

Join nvda@nvda.groups.io to automatically receive all group messages.