August 16th, 2005, 11:09 PM
From file2.py append an item to file1.py combobox
Hi to all:
How can I append some data from file1.py to a combobox
I know, if you want to append data to a combobox
inside the same script, I would be like follows:
I'm having some trouble sending the new "item" from file2.py
def __init__(self, *args, **kwds):
self.mycombobox = wx.Combobox(...
# and then...
# would append to the combobox a new item.
What can I do? thanks in advance
# So here are my problems...
# I got:
def __init__(self, *args, **kwds)
# and it doesnt work...
# does not work either..
August 17th, 2005, 08:55 AM
You seem to understand the basic concept of how to do this. Importing the other file. But is that file1.py located in the correct directory? Try moving it to your Lib directory or to another place where Python library (module) files are stored.
August 17th, 2005, 05:36 PM
They are both in the same directory...
So... it should work then? the pseudocode is correct?
August 17th, 2005, 05:37 PM
maybe i should make the combobox global?? I'll try that...
August 19th, 2005, 06:02 PM
Oh, now I get it. I was trying to Append the new item calling the combobox to file2.py, but there was no combobox there!
I should have done it all the way around, that is, calling the new item variable from file2.py to file1.py and then append it to the existing combobox in there...
So sintax was right, but I was doing it the wrong way.
August 19th, 2005, 08:47 PM
Glad you figured out the problem.