I am making a fun python program to automate couple clicks for me. I want to use pyAutoGui library provided by python to make this program. I am struggled to find the coordinates of elements that I want to click. Are there any ways that I can find coordinates of my elements?
You can use pyautogui.mouseInfo().
MouseInfo is an application to display the XY position and RGB color information of the pixel currently under the mouse. Works on Python 2 and 3. This is useful for GUI automation planning.
The full documentation is at https://mouseinfo.readthedocs.io/en/latest/
Point Position (for Windows) is a simple tool that lets you pick the coordinates for any point on your screen (using X,Y axis). Simply point one of the four corner arrows at the spot on your screen that you want to define and click the button to display the X/Y coordinates.
Related
I need to find library / tool that based on the parameters from python (width/height position x/y of the rectangle) can display rectangles. It is necessary that position of the presented rectangles can be changed on the display via dragging and their position can be used as an input for functions e.g rotation. Would be great if I could connect rectangles with lines as it is the next step
Have you heard about such library/ tool?
Currently i am displaying them as png
I want to make a game in panda3d with support for touch because I want it to be playable on my windows tablet also without attaching a keyboard.
What I want to do is, find a way to draw 2d shapes that don't change when the camera is rotated. I want to add a dynamic analog pad so I must be able to animate it when the d-pad is used with mouse/touch.
Any help will be appreciated
Make those objects children of base.render2d, base.aspect2d or base.pixel2d. For proper GUI elements take a look at DirectGUI, for "I just want to throw these images up on the screen" at CardMaker.
I would like to create a home screen(menu) for my project using pygame(?).
I have a piTFT 2.8" Capactive display from adafruit.
I have design the whole display menu. Take a look on this demo screen for example:
Now I would like to built this on my pi. is there any easy way to position each element as can be seen on the attached image?
The display is 320 x 240, and I think if I try position the elements blindly it will take a lot of time which in this case, I dont really have spare time to waste.
Have you got any other suggestions about the use of pygame? Would you suggest me something different?
This answer may be a bit general, but what I do to find each position is go to paint or some paint program and then I add markers where positions are, then I can select rectangles and find there positions. It would be hard to find the positions by itself just from that image. Do you have a mac, windows, linux?'
just paste your menu, into the paint program and draw rectangles around certain icons, after that just go to the top left of the rect and it will tell you the position, so you will get both the width, height, and position.
I would like to be able to have a user drag points across an XY-plane, resulting in a histogram (in Python 3.3).
Consider the following picture, in which the red shows the motion the mouse made (start of arrow is the CLICK, end of the arrow is when the user LETS GO):
Is there any package this could be accomplished in, or do you consider would be of great help? The goal is to be able to create a discrete histogram having this shape.
I guess what I need is to be able to record a dragged path?
In R you can use locator() to register left mouse clicks on the current device. You could take these locations and build the histogram from this. I'm quite sure this will only works with discrete clicks, not a smooth dragging motion. See ?locator() for more details about this function.
http://pygooglechart.slowchop.com/
Is a Python wrapper for the Google Chart API.
Just take a look at the Documentation.
Especially check the Examples from the github
https://github.com/gak/pygooglechart/tree/master/examples
I would like to know if there is a simple way to get coordinates of an area selected with the mouse on screen?
Imagine, I have a small gui, clicking a "select" button then I draw a select area on my screen and it returns the top-left / bottom-right coordinate of my selected area.
And also which kind of gui should I use to be multi platform compatible?
wxPython / wkTinker, any other?
Thanks to point me on the right direction.
The first question depends on the second, but usually you have something like a mousePressed and a mouseRelease event which both provide coordinates (see here for Tkinter). A selected rectangle is defined by the coordinates of those two events.
The second question is rather subjective and also depends on what you want to do exactly. But another option would be PyQt.