Python Forum
Stop import from executing function, but allow the function to execute from tk btn.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stop import from executing function, but allow the function to execute from tk btn.
#2
If you have functions they don't get executed at import. You need to call any imported function in order to execute it.
Maybe show your code (the two modules) and how you import one from the other. Best would be to keep the code as minimal as possible to reproduce your problem

my guess is - you actually call the functions without realizing it - e.g. when you assign it as call beck to a button.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
RE: Stop import from executing function, but allow the function to execute from tk btn. - by buran - Dec-08-2020, 09:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Call local variable of previous function from another function with Python3 & tkinter Hannibal 5 4,457 Oct-12-2020, 09:16 PM
Last Post: deanhystad
  [Tkinter] Tkinter - I have problem after import varaible or function from aGUI to script johnjh 2 2,598 Apr-17-2020, 08:12 PM
Last Post: johnjh
  [Tkinter] Not able to use the output from one function into another function AravindPandian 1 1,650 Oct-17-2019, 08:40 AM
Last Post: Evil_Patrick
  [Tkinter] Button won't execute function TheLegendOfPanda 2 3,091 Jul-05-2019, 07:41 PM
Last Post: TheLegendOfPanda
  Stop Watch star/stop problem macellan85 1 2,585 Jun-12-2019, 06:04 PM
Last Post: woooee
  How to stop a tkinter function, without closing the window? keakins 5 13,089 Jun-29-2017, 11:53 AM
Last Post: keakins

Forum Jump:

User Panel Messages

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