Jump to content

Python3 convert StringVar() to string?


Recommended Posts

I'm learning tkinter for python3. I'm trying to use a StringVar() from Entry (txtbox)

txtvara = StringVar()

c.place(x = 100,y = 92)

e=Entry(root, width=12,textvariable=txtvara)
e.place(x = 3, y = 92)

I want to use the text in the system call but I can't even get it to print the variable to console. It just prints PY_VAR1 which I don't really understand.

def sysinstall():
    txtvarb = str(txtvara)

Question: How do I convert StringVar() into string and use that to change label text in a system call?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...