I'm having some trouble with stringVars from TK.
from tkinter import *
root = Tk()
strVar = StringVar()
tmp1 = ['one','two','three']
print(tmp1)
print(len(tmp1))
strVar.set(tmp1)
tmp2=strVar.get()
print(tmp2)
print(len(tmp2))
Output is:
['one', 'two', 'three']
3
('one', 'two', 'three')
23
As you can see, the format is different. Obviously, the list of strings is internally converted into one string with quotes. What ist the reason and how can I avoid it? For my script I would like to have a list of strings for further processing.
StringVar? What's wrong with using just a normal python list?str.splitthe value ofstrVar.get()accordingly. That's even easier to use than having to enter all those[,', etc.StringVarto move data in and out of a listbox.