tkinter

How to install Python ttk themes

半城伤御伤魂 提交于 2021-02-20 19:06:33
问题 This is my first post on SO, so please feel free to correct me if I'm doing anything wrong! I am making a simple GUI for my Raspberry Pi (that runs Raspbian stretch) on Windows (because I can use PyCharm on there). I am would like to install third party themes from this site and have followed the instructions on the wiki. However, on both Windows and Raspbian, it appears to install properly without any errors, but when I check for ttk by doing this: import tkinter.ttk tkinter.ttk.Style()

Force TkInter Scale slider to snap to mouse

∥☆過路亽.° 提交于 2021-02-20 18:47:35
问题 When a GUI has a TkInter Scale and they click somewhere on the scale, the default behavior seems to be to slide the slider along the Scale in the direction towards the mouse (and then unexpectedly past their mouse). What I'd want instead is to have the slider always jump to and stay attached to the user's mouse point while they're clicking anywhere on the slider. If they click to a particular point on the Scale, the slider should jump directly to that point. I have some code below which

Difference between ACTIVE and NORMAL state

戏子无情 提交于 2021-02-20 17:03:23
问题 I have been using Tkinter from couple of weeks. One thing I have noticed is that the tkinter widgets (Button, etc.) have 3 states: NORMAL , ACTIVE and DISABLED . I understand the NORMAL and DISABLED states. Whats the difference between the ACTIVE and NORMAL states? 回答1: Tk sets state = ACTIVE when a mouse is over a non-DISABLED button option (i.e. NORMAL) It can then be made to appear raised, sunken, flat, flash etc. So basically, NORMAL enables a button while ACTIVE can change the appearance

tkinter resize frame and contents with main window

£可爱£侵袭症+ 提交于 2021-02-20 06:45:09
问题 I am trying to work out how to control resizing of the window containing a frame. In the code I have three buttons across the top that should to stay exactly where they are. When I drag the window to expand it, I want the frame and the text box it contains to expand with the master window. I have read that columnconfigure and rowconfigure can be used but not sure how to implement it. from tkinter import * from tkinter import scrolledtext master_window = Tk() # Create the buttons btn_Image =

How to Divide the Contents of a TkInter Entry With a Number?

家住魔仙堡 提交于 2021-02-20 05:14:01
问题 I've been trying to figure out how to divide the contents of a TkInter entry box with a number (a float, to be precise). I looked it up on Google, and I found nothing that answered my question, other than doing .get() for getting a number from a entry. I want to have a number already there (or have a static variable) that I can divide to get the results I need. Any help would be appreciated! Thanks a billion!! :D P.S. Here's the website results I saw before I posted this question: Results of

How to Divide the Contents of a TkInter Entry With a Number?

大城市里の小女人 提交于 2021-02-20 05:12:59
问题 I've been trying to figure out how to divide the contents of a TkInter entry box with a number (a float, to be precise). I looked it up on Google, and I found nothing that answered my question, other than doing .get() for getting a number from a entry. I want to have a number already there (or have a static variable) that I can divide to get the results I need. Any help would be appreciated! Thanks a billion!! :D P.S. Here's the website results I saw before I posted this question: Results of

How to Divide the Contents of a TkInter Entry With a Number?

耗尽温柔 提交于 2021-02-20 05:11:56
问题 I've been trying to figure out how to divide the contents of a TkInter entry box with a number (a float, to be precise). I looked it up on Google, and I found nothing that answered my question, other than doing .get() for getting a number from a entry. I want to have a number already there (or have a static variable) that I can divide to get the results I need. Any help would be appreciated! Thanks a billion!! :D P.S. Here's the website results I saw before I posted this question: Results of

Python, Tkinter, Checkbutton: Is there a way to check on/off value

旧城冷巷雨未停 提交于 2021-02-20 04:57:29
问题 what i am trying to do is setup if statements to check if a checkbuttons value is on or off what i was thinking was something like this from Tkinter import * def checkbutton_value(): #If statement here #is their something like #if checkbox_1.onvalue == True: # checkbox_2.deselect() #if checkbox_1.varible == checkbox_1.onvalue: # checkbox_2.deselect() print 'Need Help on lines 7-8 or 10-11' root=Tk() checkbox_1 = Checkbutton(root, text='1 ', command=checkbutton_value).pack() checkbox_2 =

Python, Tkinter, Checkbutton: Is there a way to check on/off value

ε祈祈猫儿з 提交于 2021-02-20 04:57:06
问题 what i am trying to do is setup if statements to check if a checkbuttons value is on or off what i was thinking was something like this from Tkinter import * def checkbutton_value(): #If statement here #is their something like #if checkbox_1.onvalue == True: # checkbox_2.deselect() #if checkbox_1.varible == checkbox_1.onvalue: # checkbox_2.deselect() print 'Need Help on lines 7-8 or 10-11' root=Tk() checkbox_1 = Checkbutton(root, text='1 ', command=checkbutton_value).pack() checkbox_2 =

How to use tkinter GUI to select function argument and file output path in python?

拈花ヽ惹草 提交于 2021-02-20 04:14:49
问题 I currently have a python file that I have to run for different excel files on a daily basis. The steps are : Open .py file change directory of excel file run python file write to .xlsx This takes in a excel file as a pandas dataframe does some manipulation and other things and spits out an excel file. The problem is that I have to change the directory each time manually in the code. I would rather build a nice GUI for me to pick the source file that I want to manipulate, pick the output