Nov-12-2018, 06:18 PM
Here is the full code:
/Users/richard/anaconda/bin/python3.5 /Users/richard/PycharmProjects/ToDo/todos.py
config.sqlite
config.sqlite
SQLiteClient clienting on ('0.0.0.0', 8889)
[['Jim'], ['Jim'], ['Jim'], ['John'], ['Susan']]
Traceback (most recent call last):
File "/Users/richard/PycharmProjects/ToDo/todos.py", line 24, in <module>
window.FindElement('_OUTPUT_').Update(values=test)
File "/Users/richard/anaconda/lib/python3.5/site-packages/PySimpleGUI/PySimpleGUI.py", line 719, in Update
self.TKListbox.delete(0, 'end')
AttributeError: 'NoneType' object has no attribute 'delete'
import PySimpleGUI as sg from SQLiteClient import * ########################## name = 'Pi3B+' ########################## conf = db() otherIP = conf.select('select IP from nodes where name="%s" ' % name)[0][0] layout = [ [sg.Listbox(values=[], key='_OUTPUT_', size=(30, 6))], [sg.Submit(), sg.Cancel()] ] window = sg.Window('ToDo').Layout(layout) clint = client(otherIP, 8889) clint.sendSQL('select first_name from employees') ret = clint.checkQ() print(ret) test=['aaaa','bbbb','cccc'] window.FindElement('_OUTPUT_').Update(values=test) button, values = window.Read()And here is the output:
/Users/richard/anaconda/bin/python3.5 /Users/richard/PycharmProjects/ToDo/todos.py
config.sqlite
config.sqlite
SQLiteClient clienting on ('0.0.0.0', 8889)
[['Jim'], ['Jim'], ['Jim'], ['John'], ['Susan']]
Traceback (most recent call last):
File "/Users/richard/PycharmProjects/ToDo/todos.py", line 24, in <module>
window.FindElement('_OUTPUT_').Update(values=test)
File "/Users/richard/anaconda/lib/python3.5/site-packages/PySimpleGUI/PySimpleGUI.py", line 719, in Update
self.TKListbox.delete(0, 'end')
AttributeError: 'NoneType' object has no attribute 'delete'