Tkinter StringVar And Replace

Post here if you need help with creating a Graphical User Interface in Python.

Tkinter StringVar And Replace

Postby Benerded » Fri Jan 31, 2014 12:16 am

I am trying to find a way to replace some text in a stringvar in tkinter. I would like to replace the spaces in the a string with pluses.

Code: Select all

main = Tk()
SEARCH = StringVar()
DROPDOWN = StringVar()

def SearchB():
    SEARCH.set("")
    DropdownMenu=DROPDOWN.get()
   
    if DropdownMenu=="X":
        SEARCH.replace(' ', '+')
        print(SEARCH)

Last edited by stranac on Fri Jan 31, 2014 12:29 am, edited 1 time in total.
Reason: First post lock.
Benerded
 
Posts: 1
Joined: Fri Jan 31, 2014 12:10 am

Re: Tkinter StringVar And Replace

Postby stranac » Fri Jan 31, 2014 12:32 am

Ok, so what's the question?
Also, posting some code we can actually run would be helpful.
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1137
Joined: Thu Feb 07, 2013 3:42 pm


Return to GUI

Who is online

Users browsing this forum: No registered users and 2 guests