I am using MATLAB and SIMULINK and there is something missing there that is driving me crazy, but the question is not MATLAB-related.
At a certain point I have a window like that:
I would like to have the SELECT ALL button. I don't know why, but since a lot of years I am asking this feature to MathWorks but they don't implement it.
Anyway, I decided to do a workaround by myself.
I want to make a small script in Python which detect the text 'Tunable' and after it clicks automatically on ALL the checkboxes.
Is it possible to do it in Python ?
I found a solution to my problem.
If you are interested you can look at it in this video:
VIDEO YOUTUBE
I am happy to share ideas and to know your opinion.
Related
I am working on the following project and I am having really difficulties in finding the right way of doing that. I would like to build in Python (but I am open to other possibilities) a very basic interface that allows the user to draw with the mouse (or the pen if used on a surface laptop) something and then save the image. Ideally I would like this to work on a website or at least in a jupyter notebook (at least I imagine this to be utterly difficult).
Anyone can point me in the right direction? The goal would be to use the images as input to a neural network model to demonstrate its result with real life examples.
I am looking at tk but I don't seem to find much in terms of examples.
Thanks in advance, Umberto
I'd take a look at pyautogui to capture the mouse location then "draw" it in matplotlib -- should be able to do this in a loop. You'll want to watch the tkinter window size to sync the mouse coordinates with the relative location.
Why not just have your script open create a new blank img and automatically open it with paint - then read it on close? Seems easier than creating a drawing GUI.
Have a look at my Github repository which have exactly what you need.
Link : CanvasDraw Repo
Depending on the complexity you could either use tkinter which is a package for complex GUIs or something from the gaming community like pygames. You have user input and graphical output so libraries made for games will do what you want but provide way more stuff then you need. This site might help you: Drawing Libarys
Also the answere draw-on-python-tkinter-canvas-using-mouse-and-obtain-points-to-a-list might help you.
I want to build something like a programming tastature for my soon-arriving windows tablet.
I don't want to use the normal windows 8.1 tastature, because it would take a long time to get
brackets or things like that, so I wan't to build one myself, with buttons, where I need them.
But I've got one problem. I searched around using Google, and I saw, I'm not the only one with that problem - but I didn't find a simple solution either - so:
How do I simulate keypresses to a window?
I'm looking for something like
Sendkey("S")
Another problem was, that the focused windows would be my own tastature at this point, but I want to send the text to another window I clicked before...
If you know the solution, please answer amateur-friendly.
+Thank you for hopefully coming answers.
Beginner python learner here. I have a question that I have tried to Google but I just can't come up with the proper way to ask in just a few words (partly because I don't know the right terminology.)
How do I get python to detect other widgets? For example, if I wanted a script to check and see when I click my mouse if that click put focus on an entry widget on a (for example) website. I've been trying to get it to work in Tkinter and I can't figure out even where to begin.
I've seen this:
focus_displayof(self)
Return the widget which has currently the focus on the
display where this widget is located.
But the return value for that function seems to be some ambiguous long number I can't decipher, plus it only works in its own application.
Any direction would be much appreciated. :)
Do you mean inside your own GUI code, or some other application's/website's?
Sounds like you're looking for a GUI driver, or GUI test/automation driver. There are tons of these, some great, some awful, many abandoned. If you tell us more about what you want that will help narrow down the choices.
Is this for testing, or automation, or are you going to drive the mouse and button yourself and just want something to observe what is going on under the hood in the GUI?
>How do I get Python to detect other widgets?
On a machine, or in a browser? If in a machine, which platform: Linux/Windows (which)/Mac?
If in a browser, which browser (and major version)?
> But the return value for that function seems to be some ambiguous long number I can't decipher
Using longs as resource handles is par for the course, although good GUI drivers also work with string/regex matching on window and button names.
> plus it only works in its own application.
What do you mean, and what are you expecting it to return you? You should be able to look up that GUI object and access its title. Look for a GUI driver that works with window and button names.
Here is one list, read it through and see what sounds useful. I have used AutoIt under Win32, it's great, widely-used and actively-maintained; it can be called from Python (via subprocess).
Here are comparisons by the author of PyWinAuto on his and similar tools. Give a read to his criticisms of its structure from 2010. If none of these is what you want, at least you now have the vocabulary to tell us what would be...
I posted a similar question a while ago but haven't received any answers so i thought i might ask a more generic question:
Does anyone know how to, through any means, output true video, not a rapidly changing sequence of images, in a Tkinter window with python?
You probably need an extension like TkVideo or Quicktime to do that, not sure there is a python style wrapper for it available yet.
https://github.com/patthoyts/tkvideo
I am a geology student and am trying to come up with a program for illustrating joint networks in rock masses.
Basically I just need wxPython script, or any snippets of script that would be able to create a GUI program which displays a number of disks inside a box, with the parameters (ie relative position, orientation and radius) of the disks being input at the beginning. Does anyone know of any script like that, or if thats even possible? My problem is that this is for my thesis, and although I have dabbled in Python before, not on anything anywhere near as complex as this, and certainly not GUI. I literally don't even know where to begin trying to display geometric shapes.
I unfortunately don't have the time to learn enough wxPython to do this, I'm looking for any pre-written example code. I have downloaded wxPython and have done some tutorials on creating message windows etc but now I'm not sure where to look for help now. Any advice/tips/code at ALL would be greatly appreciated, I am desperate for help!
I'm not sure I understand exactly what you are trying to do here. Are you creating an interactive GUI or just a visualization? It sounds like you want something in 3D. In that can you should check out VPython which has some tutorials and demo code. Also much more powerful is PyOpenGL. For something and actual 2D user interface in wxPython you should really look through the demo code included with wxPython. There is quite a nice library of complete examples with source code that you can just copy and modify. I am pretty sure there are some examples for drawing polygons of arbitrary size/shape.