Python Forum
Problem In calling a Function from another python file of project
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem In calling a Function from another python file of project
#8
It's the same problem just extended a bit. EEG imports Click_Listener, Click_Listener imports Functions, and Functions tries to import EEG, which isn't finished loading yet because it is still trying to import Click_Listener.

This is highlighting why classes and object oriented programming are so useful to GUI programming. You have a function bound to an event, so you don't have control of it's parameters. But you need to access other parts of your GUI from the function. You're trying to do this with imports, so you keep getting circular imports. If the function is part of the same class as the rest of the GUI, it can access the other parts of the GUI using class attributes.

I would really recommend learning OOP and classes before moving forward with GUIs. There are lots of tutorials on this site about classes. I even link to one in my signature.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Problem In calling a Function from another python file of project - by ichabod801 - Oct-05-2019, 01:09 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] remove file from current project rwahdan 2 2,352 Jul-25-2021, 09:14 AM
Last Post: Larz60+
  python file(.py) not working with my tkinter project DeanAseraf1 9 7,346 Mar-22-2020, 10:58 PM
Last Post: ifigazsi
  [Tkinter] Issue with calling a Class/Method in GUI File Fre3k 3 3,085 Mar-08-2020, 12:35 PM
Last Post: Fre3k
  Calling widget from another function? WuchaDoin 1 3,679 Oct-23-2018, 12:55 AM
Last Post: stullis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020