An overview of the NVDA Python Console

By Unregistered User (not verified), 3 June, 2024

Forum
Windows

The NVDA Python Console provides an interface within NVDA where users can write and execute Python code. It is intended for developers and technically inclined users who want to:
1. Debug and Test NVDA Code: Developers can use the console to test and debug their code snippets in real-time.
2. Extend NVDA Functionality: Users can create custom scripts or plugins to add new features or modify existing ones.
3. Access NVDA Internals: The console allows access to NVDA's internal objects and states, enabling advanced customization and control.

With the NVDA Python Console, users can:
1. Inspect NVDA Objects: Examine the properties and methods of NVDA objects to understand their behaviour.
2. Manipulate UI Elements: Interact with and control UI elements programmatically.
3. Automate Tasks: Write scripts to automate repetitive tasks, improving efficiency and workflow.
4. Customize User Experience: Create custom commands or modify how NVDA announces information to better suit individual preferences.

Examples of What People Have Done with the NVDA Python Console:
1. Custom Announcements: Users have written scripts to customize how NVDA announces certain elements, such as specifying different speech patterns for different types of content.
2. Enhanced Accessibility Features: Some have developed plugins that introduce new accessibility features, like more advanced text navigation or improved handling of complex web content.
3. Debugging and Profiling: Developers often use the console to debug issues in NVDA itself or in third-party applications interacting with NVDA.

Current and Future Possibilities:
• Improved User Scripts: Users can tailor NVDA to better meet their specific accessibility needs.
• Community Contributions: Developers can share their scripts and plugins, enhancing NVDA for the broader community.
• Education and Training: The console is a valuable tool for learning about screen reader development and accessibility programming.

Future Possibilities:
• Advanced AI Integration: As AI technology progresses, there could be potential for integrating more advanced AI-driven features directly through custom Python scripts.
• Greater Customization: Enhanced support for customization could allow for even more personalized user experiences.
• Expanded Plugin Ecosystem: The ease of developing and sharing plugins could lead to a richer ecosystem of extensions and tools for NVDA.

The NVDA Python Console opens up a world of possibilities for customizing and enhancing the functionality of the NVDA screen reader, making it a powerful tool for developers and users alike. You can file and ignore this information, secure in the knowledge that if you find yourself with a problem with an application you absolutely must use, there could be a solution with the NVDA Python Console.

Options

Comments

By The Tetris monster on Friday, May 31, 2024 - 17:26

I’m sorry, but this feels as though it was written with ChatGPT or another large language model. If this isn’t the case, then I apologise.

By Brad on Friday, May 31, 2024 - 17:26

I understand you're excited about AI but copying and pasting what you find here and making it into posts like this might get you a warning.

This doesn't really add to a discussion forum, perhaps you could try something like r/openAI or something along those lines.

By Brad on Friday, May 31, 2024 - 17:26

That post actually had a setup, something to talk about.

You basically coppied and pasted what chat gpt said and then left it, there was no lead up or anything.

Perhaps if you had wrote something like, hey, I wrote a prompt in chat gpt 4o describing the NVDA python console, let me know what you think of the output, you'd get better engagement.

As for the prompt, I don't really want to focus on that, we both know it's good, I'd rather focus on you writing better posts so that everyone can understand where you're coming from.

By OldBear on Friday, May 31, 2024 - 17:26

And I have also attempted to do things with Python, though not with that particular screen reader. It could have been useful. My train of thought falls apart in the process though, and I never quite get things correct. I did read a thread somewhere about the AI generating code. Maybe that will help with these things in the future. I just don't have the energy to do it on my own.
And to the subject of chat bots making posts... Is it coming to the point that we have to accuse each other of posting AI content if the post is well organized and clear? I suppose I should be glad I never had tight enough screws to think and write clearly.

By Brad on Friday, May 31, 2024 - 17:26

What was well organised and clear about that post?

It would be like me just asking chat gpt to write me a cake recipe then posting it on applevis with no explonation as to why I was posting it.

By Mlth on Friday, May 31, 2024 - 17:26

I'm not loving the LLM generated post. It's somewhat wrong and vague in certain areas, and I'd really like to discourage posting tutorials that are purely written by LLM's with no post-generation fact checking without a clear disclaimer first.

By Brad on Friday, May 31, 2024 - 17:26

This isn't a tutorial.

By the title you'd think it was but it isn't.

By OldBear on Friday, May 31, 2024 - 17:26

I didn't assume the first post was generated by an LLM when I read it. It seemed like Lottie took some time and wrote a guide for people new to NVDA and having a little experience with Python. It still seems that way, though I've reread all the posts a few times.

By Brad on Friday, May 31, 2024 - 17:26

That's so interesting, maybe @lotty tidied up the post a bit but nah, it's deffinetly written by chat gpt.

By Brad on Friday, May 31, 2024 - 17:26

Ah no, I was talking about your original post.

I'm sorry but you can really really tell it was written by chat gpt and if you're in univercity you might want to try and hold back when using those tools.

I can't explain exactly what it is but you can tell when somethings written by chat gpt, it's almost to over the top and very eager to please.

I hope this doesn't offend you, it's just that there's a lot of people trying to use chat gpt to write their own papers and stuff like that and I'd think you'd not want to put in all that efort into uni just to get a lower grade because your teachers can see you're using AI.

By AppleVis on Friday, May 31, 2024 - 17:26

Member of the AppleVis Editorial Team

Hi everyone,

We wanted to chime in and remind members that our site posting guidelines already address the use of AI tools like ChatGPT when composing content to be posted on AppleVis. Specifically, Section 5 states:

"When contributing articles, guides, reviews, or other written content to AppleVis, we request community members refrain from relying solely on AI tools like ChatGPT to generate this content. While these tools can be useful for some tasks, the generated text often contains inaccurate, misleading, or impractical advice when discussing accessibility tools and features. By writing original content based on your own perspectives grounded in lived experiences with visual impairments and Apple products, your articles will provide reliable and practical advice to readers. If you do choose to utilize AI tools as part of your writing process, please make sure to verify the accuracy of any instructions or technical details generated."

Lottie has already clarified that she wrote the original post in this thread herself. The AI-generated version she posted later was only shared after the originality of her post was questioned, and was intended to demonstrate how the same content might have looked if generated solely by an AI tool.

With that matter resolved, let's please bring the discussion back to the main topic and purpose of Lottie's original post.

By Brian on Friday, June 7, 2024 - 17:26

Melodrama aside, I personally love the versatility and overall ease of access, no pun intended, of the NVDA screen reader. I am also a fan of the Python programming language, having about a year of academic experience with it. While I can "use" NVDA very fluently, especially within the Windows 11 environment, I absolutely fail at writing code these days; it has just been too long, and I am too lazy to re-learn a programming language this late in the game.

having said that, I think it is ingenius that the developers of NVDA included a python console to build upon the foundation of, what is in my oppinion, one of the best screen readers currently available for Windows. Period.

I have said this before, and while slightly outside the scope of this thread, it bears mentioning how wonderfully awesome it is to take a thumb drive with a portable copy of NVDA (add-ons and preferences included), plug said thumb drive into any given PC running Windows, and that PC is not only accessible to the person in question, but they can use a brand new PC comfortably, and without even installing any actual software.

In closing I will say that NVDA really was designed with thought and functionality in mind, and while I personally will not do much, if anything, with the Python console, it is undoubtedly a very welcome feature of the screen reader. 🙂

By Brad on Friday, June 7, 2024 - 17:26

@lotty SO you wrote your first post to see if people like me would accuse you of it being AI even though you wrote it?

If so; you've done a very very good job of emulating chat gpt.

As for what "chat gpt" wrote, I think it, you,, gave a very good description of the NVDA python console window.

By Brad on Friday, June 7, 2024 - 17:26

Well i'll apologise, I still do think you should have added a little intro and the question you'd wanted answered in the first post but I shouldn't have been so quick to rush in.

By Brad on Friday, June 7, 2024 - 17:26

So now we've hashed that out, let's continue.

Keep in mind i've never written a script but I have a question if you want to continue this, what do you think about the fact NVDA beeps for indents/spaces?

I think you'd get used to it but it would be a bit irritating in the beginning.

By Travis Roth on Friday, June 7, 2024 - 17:26

Well, at this point I am not sure anyone will read this far down the comments. I'll throw out a couple points nonetheless.
* I agree it is ingenious and quite useful to have the Python Console in NVDA, it is an advantage running NVDA on an interpreted language such as Python provides.
* I would advise the post to acknowledge the NVDA Python Console is strictly intended for developers and development use. That is where I felt the post kind of had a breakdown, implying it can or is regularly used to run code and scripts to quickly do things by all users. That isn't its intent nor what it actually does well. It is for exploring and experimenting and checking causing and effect. It actually freezes a snapshot of the UI at the point it is open, so if you think you will be clever and browse the web in real time via coding commands, it doesn't quite work out. Anyway what I'm trying to say is for the non developer they should probably be best served by curbing the enthusiasm for the NVDA Python Console.
* I should emphasize about the running of scripts the post discusses in hopes of clearing up confusion: NVDA supports addons and there is a rich library of them now in the NVDA Store. However, the user does not use the NVDA Python Console to use these addons.

Disclosure: I have used the NVDA Python Console.

By SeasonKing on Friday, June 7, 2024 - 17:26

Contrary to some perspectives, as echoed by numerous commenters before and likely in the future, the choice between a MacBook with Voiceover and a comparable Windows laptop with NVDA isn't straightforward.
When presented with both options, a new user might lean towards Windows with NVDA due to its perceived simplicity and user-friendly interface. Computers should prioritize serving humans, not the other way around. If a MacBook demands grappling with complex concepts, many of which may be challenging to explain even to sighted colleagues or classmates, the appeal of Windows becomes evident. Its navigation is significantly streamlined, facilitating smooth internet browsing. Moreover, the availability of multiple browser options and screen reader alternatives enhances flexibility and reliability. In the event of one failing, the likelihood of another stepping in seamlessly is high.
Even for seasoned users, this simplicity is invaluable, particularly in collaborative settings. Whether interacting with classmates or colleagues, the compatibility of NVDA allows for effortless collaboration without needing to adjust screen reader settings. NVDA seamlessly integrates with users' interactions, enabling smooth utilization of touchpad and keyboard functionalities. This harmony fosters mutual understanding and productive collaboration, enhancing overall user experience and efficiency.

By Mlth on Friday, June 7, 2024 - 17:26

@Lottie My apologies if my tone came off a bit snippy in the last post.
Travis raised all the right points, and I definitely think it would be a great idea to amend the initial post to clarify the purpose of the NVDA python console at least.

Best
M

By Enes Deniz on Friday, June 7, 2024 - 17:26

Can anyone make a Python script, or an add-on, to provide an exact audio representation of a document, table, presentation or even graph through beeps? It might not even require any additional keyboard commands to work; something making NVDA beep as you navigate around a page/table could be handy in certain situations. You know, just like the following setting: "Play audio coordinates when mouse moves", but within the document/presentation/table itself, so that one can get a better overview of its visual layout.

By Brad on Friday, June 7, 2024 - 17:26

@Enes Deniz if you ask on them you'll probably get better support.

I don't know of any though so can't help there but typing in NVDA maling lists should bring up some stuff.

@lotty, I do think taking this post down might be a good idea, then, you could make another one with a clear goal in mind because for now you say you were trying to proove NVDA is a powerful screen reader but if I just read your first post, i'd have no idea what so ever that you were trying to do this.

By Enes Deniz on Friday, June 7, 2024 - 17:26

I've not subscribed to any such mailing lists or groups or whatever they're called.

By Travis Roth on Friday, June 7, 2024 - 17:26

I don't understand what you want to be honest, sorry. You want sounds for objects as they're encountered instead of speech, e.g., a sound instead of saying "Table"? I don't think anything quite like that exists, and it would be nontrivial.
Perhaps the CursorLocator addon may help? https://github.com/nvdaes/cursorLocator
I am guessing it is in the NVDA Addon Store for easier installation but not checked.
And perhaps the AudioChart addon which works in Excel? Note I am not sure if this addon has been updated to work with current NVDA release. https://addons.nvda-project.org/addons/AudioChart.en.html

By TheBllindGuy07 on Friday, June 7, 2024 - 17:26

Joke aside, I personally don't do anything with the python consol of nvda other than inspecting modules names that are imported and running, and tones.beep because, well.. Why not. Reading the logs of nvda though is a very gratifying activity with lots of knowledge about how nvda works under the hood especially with errors, even the info logs only is enough. And debug adds a lot of course.

By Enes Deniz on Friday, June 7, 2024 - 17:26

No, such add-ons already do exist, but this is not what I am referring to. I am trying to say that we should have an add-on that reports the position of characters, words, cells or whatever you focus the cursor on, and indicates their positions through beeps as you navigate around documents, tables and so on. The closer to the top of a page or table you get, the higher the pitch should be. Similarly, the beeps should indicate the position within a single line as you move from left to right in stereo. Just check that check box I mentioned earlier and you should get what I mean. Such an add-on can also be helpful in certain cases where you want to move in a Word document line-by-line and hear the indentation for each line without having to press any additional keys or hear any additional speech. It will also be helpful in figuring out how much of a whole line the indentation constitutes. You can also just play around with the font size and spacing and get a better overview of how the space or distance between each letter changes and how many letters a single line has.

By Brad on Friday, June 7, 2024 - 17:26

You could try audiogames.net too and their off topic room.

Here's the link to the maling list:https://nvda.groups.io/g/nvda

Look at the list of email addresses, to subscribe, just send a blank email to that subscribe email address, once you've gotten on the list, to write to them use the post email address and to unsubscribe; send a blank email to the unsubscribe email.

By Brian on Friday, June 7, 2024 - 17:26

This could possibly exist already. Though I am not up for searching for it, there are 2 links below for you that host NVDA add-ons. The first one is the "official" add-on directory, and the other is a far more robust directory that has many pages of add-ons for you to explore.

Good luck.

https://addons.nvda-project.org/

https://nvda-addons.org/

By Enes Deniz on Friday, June 7, 2024 - 17:26

Okay, but are most NVDA add-ons that are under active development not available on the Add-On Store already? If I can even find any add-ons that do serve the purpose but cannot be found on the add-on store, they have likely not been updated in a while.

By Travis Roth on Friday, June 7, 2024 - 17:26

The addon store is pretty new. And the submission process is a bit involved. So no, not all addons are in it. More and more will be, but I doubt 100% of addons ever will be. For now at least you can still install addons outside of the store, and hopefully this will remain the case.

By Brian on Friday, June 7, 2024 - 17:26

You can set your search criteria for new/updated add-ons to look under the following categories:
~ Stable (This is the default)
~ Beta (Add-ons still in beta)
~ Dev (Add-ons currently in development)
~ All (As in all of the above)

HTH. 🙂