Python Forum
Code running many times nad not just one?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Code running many times nad not just one?
#2
Not sure if we have all the code, but I will point out - All of the code at the top executes before you hit the dunder name == dunder main. Generally recommended that you put that code into another function and call it after the check. Doesn't really explain why it executes many times, but try putting it in a function. If that does not solve, post the rest of the code.
Reply


Messages In This Thread
RE: Code running many times nad not just one? - by jefsummers - Jul-17-2022, 11:40 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  problem in running a code akbarza 7 766 Feb-14-2024, 02:57 PM
Last Post: snippsat
  writing and running code in vscode without saving it akbarza 1 445 Jan-11-2024, 02:59 PM
Last Post: deanhystad
  the order of running code in a decorator function akbarza 2 581 Nov-10-2023, 08:09 AM
Last Post: akbarza
  Different code execution times Wirbelwind94 4 821 Oct-06-2023, 12:30 PM
Last Post: snippsat
Question Running an action only between certain times alexbca 9 1,824 Mar-15-2023, 04:21 PM
Last Post: deanhystad
  Error while running code on VSC maiya 4 3,904 Jul-01-2022, 02:51 PM
Last Post: maiya
  code running for more than an hour now, yet didn't get any result, what should I do? aiden 2 1,567 Apr-06-2022, 03:41 PM
Last Post: Gribouillis
  Why is this Python code running twice? mcva 5 5,404 Feb-02-2022, 10:21 AM
Last Post: mcva
  Python keeps running the old version of the code quest 2 3,878 Jan-20-2022, 07:34 AM
Last Post: ThiefOfTime
  My python code is running very slow on millions of records shantanu97 7 2,685 Dec-28-2021, 11:02 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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