Is there a way of using .lower more effectively in tkinter?

0 votes

When asking the user for an input I would like it to be set to .lower() like in python when you do start=start.lower() for example. Is there any way I can do this in tkinter without putting Command_Line.get().lower every time due to my code having a code of inputs and me wanting to be efficient?

Sep 25, 2018 in Python by bug_seeker
• 15,510 points

1 answer to this question.

0 votes

Here is a simple function and some example code that will modify the value of a string var to lower case. Just pass the stringvar to the function.

from tkinter import *

root = Tk()
#No need for the following line in your code

def lowerStringVar(var):
    """Function to convert the text in a StringVar to lower case"""
    if isinstance(var, StringVar):

myTextVar = StringVar()
myTextVar.set("ALL UPPER CASE")


answered Sep 25, 2018 by Priyaj
• 57,700 points

Related Questions In Python

0 votes
1 answer

Is there a way to list out in-built variables and functions of Python?

The in-built variables and functions are defined ...READ MORE

answered May 14, 2019 in Python by Junaid
0 votes
1 answer

Is there a way to store this text in a list using selenium (python)

Try using this code snippet to resolve ...READ MORE

answered Aug 24 in Python by Carlos
0 votes
1 answer

Is there a foreach function in python and is there a way to implement it if there isnt any

Every occurence of "foreach" I've seen (PHP, ...READ MORE

answered Aug 31, 2018 in Python by charlie_brown
• 7,780 points
0 votes
1 answer

What is the recommended way to randomize a list of strings using Python?

Hi. Nice question. Here is the simplified answer ...READ MORE

answered Jan 18, 2019 in Python by Nymeria
• 3,520 points
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,461 views
0 votes
0 answers
0 votes
1 answer

Is there a label/goto in Python?

No, Python does not support labels and ...READ MORE

answered Aug 1, 2018 in Python by Priyaj
• 57,700 points
0 votes
1 answer

What is the meaning of “int(a[::-1])” in Python?

Assumming a is a string. The Slice ...READ MORE

answered Aug 27, 2018 in Python by Priyaj
• 57,700 points