I see there is an transcription error, ooops it should be:
tmod = open('list.txt', 'r')
for i in range(4):
cb.addItem(str(i))
tmod.close()
tmod = open('list.txt', 'r')
for i in range(4):
cb.addItem(str(i))
tmod.close()
To copy to clipboard, switch view to plain text mode
The first line opens the file called list.txt for reading as indicated by the 'r'.
The second line is a for loop , that loops through 4 times -range(4)
the third line adds the names(re-previous post) to the combobox
The fourth line closes the the file.
The above snippet of code works the problem is, it display is the numbers from 0 to 3. My question is how do I display the name in the file?. My suspicison is I should be not
be using range(4)
I will be away on business for the next few days, I will catch up with you again on Friday in my part of the world.
Thank you
PS the code snippet does not show once posted the way I wrote it in the message.
Bookmarks