Transfer file name input from one .py to another

M

mark.martinez2

How do I transfer the file name which is input in one .py (an MDI
parent frame in wxPython) to another .py (an MDI child frame)? The
parent gets the file name from the user via a file select dialog, but
the child frame is the one that needs to know what file it is working
with.

Thanks
 
L

Larry Bates

How do I transfer the file name which is input in one .py (an MDI
parent frame in wxPython) to another .py (an MDI child frame)? The
parent gets the file name from the user via a file select dialog, but
the child frame is the one that needs to know what file it is working
with.

Thanks
Normally I do something like:

class childFrame:
def __init__(self, parent, *args):
self.parent=parent

#
# Now you can refer to the filename by accessing
#
self.parent.filenamefromdialog

class main:
def getfilefromdialog(self):
self.filenamefromdialog=...

-Larry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top