I have the following string with numbers delimited by a comma. The string is obtained from an Entry widget. How can I parse it to an int vector?
from tkinter import *
def key_return(event):
stringToParse= String_entry.get()
print(stringToParse) # which basically looks like this '110,220,330'
root = Tk()
global stringToParse
# Creating Entry widget
String_entry = Entry(root, width=20, font= ('Helvetica 13'))
String_entry.insert(INSERT, "insert text")
# Pressing enter to get the widget string
String_entry.bind('<Return>', key_return)
String_entry.pack()
root.mainloop()
…some function to parse….
print(parsedString)
I basically need the following output as int vector:
# Output
#
# [110,220,330]