Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm using Python 2.7.13 with Tkinter.
This is part of my program:
PAButton = Tkinter.ButtonPress(PAFrame, text='PA', fg='white', bg='blue')
PAButton.pack()
self.PAButton.bind("<ButtonPress>", self.playPA)
This is the gist of what I am trying to do:
When PAButton is pressed (not released), run the function playPA() as defined earlier in the script.
However, I get this error:
AttributeError: 'module' object has no attribute 'ButtonPress'
How would I correctly accomplish my goal?
There's no such thing as ButtonPress. It's Button.
EDIT: For the .bind() function, instead of "<ButtonPress>", use "<Button-1>".
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I have removed the title of the main window.
Created a button that should hide the window, but not close it. How can I implement a similar function for her?
I guess you want something to minimize application
like this button :
To minimize your application you should call showMinimized(); function.
look at this Qt Documentation link :
https://doc.qt.io/qt-5/qwidget.html#showMinimized
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
Hi I'm trying to catch the change in the paperclip of my computer with the library pyperclip something same as
url=pyperclip.paste()
I want to create a thread which can append all the urls into a list my script, but I don't know how to could I do it
Thanks for your time and help c:
Did you check the documentation or the source code at all? That's all I did. pyperclip supports waitForPaste and waitForNewPaste methods that can do this.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I want to execute a method when the button pressed and executes another method when it released. I searched a lot in the Internet and didn't understand how to do it, how can I do that ?
You can bind actions to specific functions with the following example. on_press and on_release are functions, you don't have to call them with () , they will automatically run.
button.bind("<ButtonPress>", on_press)
button.bind("<ButtonRelease>", on_release)
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
why the python Cmd module command prompt not using multi-line? it's over writing the same line
example image
I am sorry I don't know, hw to answer ques in stackoverflow, but I found it finally
use self.use_rawinput = False this will fix the problem (If you want a given stdin to be used, make sure to set the instance’s use_rawinput attribute to False, otherwise stdin will be ignored.)
https://docs.python.org/2/library/cmd.html
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Hello, these are my codes. The first one is the format in which I want my output to be for the 2nd code ..
Sorry to post snapshot of my code ...the main reason is I was unable to upload my code itself ....plz somebody help me
so you only need op. in a GUI window instead of console ? create a window ,add a label and button using tkinter(basic GUI programming).
basic tutorial for GUI prog.
l = Label(root, textvariable = var)
var will be from your backend code