Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8885159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:14:26+00:00 2026-06-14T21:14:26+00:00

is there any method to count how many times a function is called in

  • 0

is there any method to count how many times a function is called in python?
I’m using checkbutton in GUI. I have written a function for that checkbutton command, i need to perform some actions based on the checkbutton status, i mean based on whether it is ticked or not. My checkbutton and button syntax are like this

All = Checkbutton (text='All', command=Get_File_Name2,padx =48, justify = LEFT)
submit = Button (text='submit', command=execute_File,padx =48, justify = LEFT)

so i thougt of countin no. of times the command function is called, and based on its value i can decide whether it is ticked or not. please help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:14:27+00:00Added an answer on June 14, 2026 at 9:14 pm

    If checking whether the checkbutton is ticked or not is the only thing you need, why not just do checkbutton.ticked = true?

    One way to implement this is to create a sub class out of Checkbutton (or – if you can – edit the existing Checkbutton class) and just add self.ticked attribute to it.

    class CheckbuttonPlus(Checkbutton):
        def __init__(self, text, command, padx, justify, ticked=False):
            super().__init__(text, command, padx, justify)
            self.ticked = ticked
    

    And edit your function so that it changes your CheckbuttonPlus -object’s ticked to not ticked.

    I don’t know how your classes are constructed, but you should find the method from Checkbutton class that activates the function, and then overwrite it in CheckbuttonPlus -class (incase you cannot edit the existing Checkbutton class, in which case, you don’t even need CheckbuttonPlus class at all).

    Edit: If you’re using Tkinter Checkbutton (looks quite like it), you might wanna check this:
    Getting Tkinter Check Box State

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any default method in Java that can count total occurrence of a
Is there any method to rename a div element. I have a div with
Is there any method like the array_unique for objects? I have a bunch of
Is there any method so that I can stop syncing to gmail. I want
I have created a method called isInPoly that receives the x and y coordinates
I am writing a very simple function that counts how many times a certain
Is there any method I can get the full JSON data from jqGrid when
Is there any method / API defined to collect system info in osx. I
Is there any method available to add IDs like there is for adding a
Is there any method to preview Excel files on XP besides WebBrowser control? How

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.