How to Create a Timer using functions with tkinter in Python

Поділитися
Вставка
  • Опубліковано 21 жов 2024

КОМЕНТАРІ • 15

  • @Rajan-kk8nl
    @Rajan-kk8nl Рік тому +1

    Very very nice class, intersting and inspiration sir, thank you so much, your all video class are excellent and very useful. Again thank you so much.

    • @DJOamen
      @DJOamen  Рік тому

      Glad you enjoyed it, You are most welcome

  • @GasimovTV
    @GasimovTV Рік тому

    Awesome video, Oamen!

    • @DJOamen
      @DJOamen  Рік тому

      Glad you enjoyed it

  • @abdolabdollah1783
    @abdolabdollah1783 Рік тому

    You are great always. Thanks

  • @EricAstarcom
    @EricAstarcom Рік тому

    thanks. please which IDE are you using. Is it vscode?

    • @DJOamen
      @DJOamen  Рік тому

      IDLE (Python 3.11 64 bit)
      See download link below
      www.python.org/downloads/

  • @GasimovTV
    @GasimovTV Рік тому

    Your videos are always very informative and entertaining to watch! :)

    • @DJOamen
      @DJOamen  Рік тому

      Glad you like them!

  • @ahsanhabib9870
    @ahsanhabib9870 Рік тому

    Thank you sir
    Please make it ms access

    • @DJOamen
      @DJOamen  Рік тому +1

      To create a timer using VBA in MS Access, you can follow these steps:
      1. Open the MS Access database in which you want to create the timer.
      2. Open the Visual Basic Editor by pressing ALT + F11.
      3. In the Visual Basic Editor, insert a new module by clicking on "Insert" in the top menu and then choosing "Module."
      4. In the new module, declare a public variable to store the current time. You can do this by adding the following code:
      Public startTime As Date
      5. Create a function to start the timer. This function will set the value of the startTime variable to the current time. You can do this by adding the following code:
      Function StartTimer()
      startTime = Now()
      End Function
      6. Create a function to stop the timer and return the elapsed time. This function will calculate the elapsed time by subtracting the current time from the startTime variable. You can do this by adding the following code:
      Function StopTimer() As String
      Dim elapsedTime As Date
      elapsedTime = Now() - startTime
      StopTimer = Format(elapsedTime, "hh:mm:ss")
      End Function
      7. Save the module and close the Visual Basic Editor.
      To use the timer in your MS Access database, you can call the StartTimer function to start the timer and the StopTimer function to stop the timer and return the elapsed time. For example, you can create a button on a form and add the following code to the button's "OnClick" event:
      Private Sub btnTimer_Click()
      StartTimer
      ' Do some work here...
      MsgBox "Elapsed time: " & StopTimer()
      End Sub
      When the button is clicked, the timer will start and some work will be done. Then, a message box will be displayed showing the elapsed time.
      Good luck

    • @ahsanhabib9870
      @ahsanhabib9870 Рік тому

      @@DJOamen Many many thanks sir

  • @Henry_Nunez
    @Henry_Nunez Рік тому

    👍😄

    • @DJOamen
      @DJOamen  Рік тому

      Glad you enjoyed it