Use a mouse to draw on a screen with python? [closed] - python

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I'd like to create a tool in python that I can use to draw things on my screen. I found one tool that does what I want, Epic Pen, but it's only supported on Windows and it doesn't have all the functionality I need. I was hoping someone could suggest a library that would could help me out with this project. Most of my Python work has been in research, and I haven't built any GUI's so I'm not really familiar with any libraries that could help me out. I'm sure there's more than one library that fits the bill. Which do you recommend? Why?
A few requirements/notes
I'd like for the tool to be completely cross platform
(Linux/Mac/Windows)
I have to be able to draw things outside of a 'special' window. If I'm making a powerpoint presentation I'd like to be able to highlight or underline a key point. Or circle something on a picture etc.
I'd like to be able to get the position of the mouse on my screen and feed that back into the program.
Here's a link to a video showcasing the kind of tool I'd like to build
How To Highlight, Draw, Sketch Anything on Windows Screen Free Software

You will need to create a transparent widget that covers the screen so that you can draw on it. I don't know how each of the GUI toolkits does this, but I'm sure they all have the functionality necessary to grab the screen's size and create a window that can cover it. With wxPython, you would create a wx.Frame instance and call its SetTransparent method. You can see an example of that here:
http://www.blog.pythonlibrary.org/2008/04/14/doing-a-fade-in-with-wxpython/
The wxPython demo includes a drawing demo that you might also want to take a look at.

Related

Best IDE for fast prototyping with OpenCV [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I want to ask about the best IDE to prototype programs by using OpenCV library.
I’ve been programming with Halcon for 3 years and I would like to learn how to program with OpenCV too. I was thinking about reproducing some old programs that I have created with Halcon, but instead using OpenCV. The problem is that maybe I’m not using the correct IDE (I’m programming with Python using Spyder) or maybe programming with OpenCV is slower than I have expected (I don't discard the possibility that I don’t know the appropriate way to prototype properly by using these tools).
I already know I come from an expensive program that allows me to work with many comforts, but I miss having a window where I can display dynamically the results of the operations than I’m applying. Also, draw some ROIs quickly. Anyways, do you think I’m using the right tools? Do you know some tutorials from which I can learn how to prototype quickly using that IDE?
Thank you in advance!
My suggestion for OpenCV prototyping in a GUI is a program called GRIP (Graphically Represented Image Pipeline). You can download it from GitHub.
It supports many inputs: single image, multiple images, webcam, and even HTTP cameras. You get all the key OpenCV commands, along with some custom ones developed by WPI.
You develop your image processing flow as a pipeline, with filtering blocks such as desaturate, find contours, etc. in which you string the output from one block to the input of another (or multiple). You can then export the pipeline to Python, Java, or C++ (exported as a usable class with a key process function). If you want to see an example, feel free to check out this previous post I wrote!

Which do I use for building simple GUIs with matplotlib plot? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I I just want to build a simple GUI (like button, scale changing parameter values) to update matplotlib plot using python. Which package is easier for me to use? TKinter, PyQt5, wxPython, etc??? I am not a software developer. I am an engineer. Just use python for data analysis and plotting. I like to have a simple gui to changing parameter values to update plot.
I am thinking if tkinter would be best? I came across the following example. It is pretty easier. Any suggestion would be appreciated.
Embed a pyplot in a tkinter window and update it
Thanks
Well if you are working on small projects then you should use Tkinter as it is easy use and user friendly but when you working on big projects then you need to use PyQt5 as it will give you lots of functionalities and it is easier to use too.
Believe it takes very less time to understand this library in python.
For learning purpose you can visit pdfdrive.com and download your free eBooks.

python - how to make autocomplete gui? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I searched so much but I couldn't find what I should use so I tried to use the built-in Tkinter but I can't find how to make what I want to make with it.
I want to have a text entry where user types something and my program makes some dynamic suggestions by opening a dropdown menu and user can choose the top option by pressing enter or they can click on one of the options or use up/down keys. and then that option will be added to a large text box under that single line textbox.
Can you recommend me any toolkit for python that I can make this GUI with? Also a link to a good tutorial for that toolkit would be much appreciated bc I'm new to python GUI.
Actually since this is very useful I'm sure there must be some snippet out there that would do this! But I can't find it yet!
Sorry if my question is a little too broad. But I'm so exhausted from searching to no avail. So I thought maybe some experienced people can easily help me out.
You can check out this module, which does exactly what you want (disclaimer: I am the author of that code).
Specifically, the code is not a tkinter.Entry widget, but a 'wrapper' (tk.Frame) around a tkinter.Entry and a tkinter.Listbox widget, the latter of which displays the results in an ordered list. If you want to redesign this behaviour yourself, I highly recommend using a similar approach rather than packing one widget below the other.
According to this link you have a lot of choices.
PyGTK
PyQt
wxPython

Gui Library in Python [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am in need of making an interface for Automata Construction. For those who are unaware of what an automata is, I basically need circles and arrows, extending them on the user interface and then various text to describe it. For example :- http://en.wikipedia.org/wiki/File:DFAexample.svg
I was wondering if there is any advanced library in Python which could let me do all of this. Please give me suggestions. I plan to use lots of internal frames and showing parsing of strings diagramatically . I had planned to use jython to use the swing libraries but I would like to know if there any other suggestions that I can use.
I've used PyQt4 to produce something like this:
http://doc.qt.nokia.com/4.6/graphicsview-diagramscene.html
which is the C++ version. Draw boxes, draw arrows, drag them around and so forth. Actually I think I pretty much ported the C++ version line-by-line to Python. Or someone else did.
PySide (Qt), WxPython, PyGtk
I looked at your picture and have another one idea - you can use graphviz and pydot.

making paint in pyqt or qt [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
i have just received a task to implement a software that paints over pictures (pretty much like microsoft paint )
i have no idea where to start or how to do that. do anyone have a good reference or idea for painting in qt or pyqt ?
this will be highly appreciated
thanks in advance
You'll be working with the QImage class, which represents bitmap images. It has methods for changing the colour at a given pixel using setPixel. There is am Image Viewer Example provided with Qt and PyQT should come with the same example in Python. However it uses a Qlabel to display the image so you may want to use a different widget, perhaps a custom QWidget subclass. You can start with that and add functionality to detect the mouse position in the , mouse clicks, etc and change the colours.
Check out Qt painting class QPainter:
https://doc.qt.io/archives/qt-4.7/qpainter.html
Have you looked at the scribble example included in PyQt? It does basic drawing, saving, loading, etc.

Categories