#confused on how to link files in my program.
65 messages · Page 1 of 1 (latest)
and ik its cus
yeeyyee
so im just confused on how to approach this
and diff ways
What do you want the code to do?
You'd probably want to look into importing files as modules
I'm not sure on that, unfortunately
ye idk i this this is getting too complicated
You want the Events.py to replace the entire window?
for a small program
LMFAO
yes
essentially wht i mean is
whe nbthe button is pressed
the program starts reading from events.py
What's in the Events.py file?
And what libraries are you using?
tkinter
for gui
and os
messageboxes
btu they r all tkinter
i feel like im making it too complicated
for a simple program
but at the same time codign everything in one file is making it harder for me to find wht im looking for
its just too long
my poitn is like there r abt 7 buttons in main menu
so for events section, id rather use another file yk
i just dont want the program to treat it as a new window
i can screenshare too
since its lil complicated
Hmm, I unfortunately don't know tkinter that well to tell you how you'd approach that
id say its mostly a
python problem tho
since its logical rather than the gui
ive only used tkinter for the appearance
But you can import classes and functions from separate files
Without running additional files
im just confused
LMFAO
i dont think the gui matters its just
instead of using 1 file u break it down into other files
right
bro i mlost
What?
The gui does matter, cause I don't know how you'd replace an entire view in tkinter
And even less how to load all that from another file
o
u hide frames and show frames
thts all
hiding stuff and showing wht u want
ik how to do tht
the problem is
linking tht to a diff file
i want to do all the hiding and showing stuff in the new file
idk if you have tried it, but basically you could solve this by creating functions for building your gui in separate files. So when you want to access the second file, you basically create some kind of function to clear out the current window and then use that builder function from the another file to place elements into your window. If you have variables accosiated with that separate file you could declare them in that separate file and then import them to your main file. This is what I would do if I were you, but again, this hypothesis is completely untested so I'm not 100% sure that it works.