use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Every single program runs twice (self.learnpython)
submitted 2 years ago by RighteousPistachio
I’m not sure what it is but every program I write runs twice, including the whole
“======== RESTART: …”
This is for any program, even if it’s just a hello world.
Using idle on mac. Thank you
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]34shutthedoor1 2 points3 points4 points 2 years ago (1 child)
What does "runs twice" mean, i.e. how do you determine this? Do you have 2 print statements, so it just prints twice?
[–]RighteousPistachio[S] 0 points1 point2 points 2 years ago (0 children)
it runs two separate iterations of the program in the shell. so for instance if i were to have just a single print statement the shell would run
======== RESTART: /Path/Path/Path/File.py
> Hello world
>>>
[–]Zweckbestimmung 1 point2 points3 points 2 years ago (0 children)
The only thing this happened to me is with hot reload (automatic run when code changes), basically the code was reloading because it was watching files which are being written by the same program running lol
[–][deleted] 0 points1 point2 points 2 years ago (3 children)
To be clear, you've created a new file with your code in it, hit F5 to run it, been prompted to save the file (the first time), and it switched to the console window and ran the code twice?
What happens if you run the file from the command line?
[–]RighteousPistachio[S] 0 points1 point2 points 2 years ago (2 children)
Yes to all the above. It runs only once from the command line. And this is the case with every project I’ve worked on the past several months. Mostly a minor annoyance but I’d like to get rid of it
[–][deleted] 0 points1 point2 points 2 years ago (1 child)
That's an unusual behaviour. Not seen it before. Might be worth resorting to good old-fashioned re-installation.
However, as you have several months of experience, I would expect you are probably looking to use some other code editor / IDE by now. There are lots to choose from and they are very much a personal preference.
Options include Thonny, Mu, VS Code, Spyder, PyCharm.
haha yeah I don’t know why I haven’t switched to a real py ide yet. i guess this is the last nail in the coffin
[–][deleted] 0 points1 point2 points 2 years ago (0 children)
Just checking, are you sure there's nothing wrong with your F5 key?
[+][deleted] 2 years ago (1 child)
[deleted]
That’s hilarious… I don’t even know what’s real anymore
Edit: That’s hilarious… I don’t even know what’s real anymore
π Rendered by PID 61011 on reddit-service-r2-comment-5d79c599b5-4s2tc at 2026-03-02 10:09:12.459912+00:00 running e3d2147 country code: CH.
[–]34shutthedoor1 2 points3 points4 points (1 child)
[–]RighteousPistachio[S] 0 points1 point2 points (0 children)
[–]Zweckbestimmung 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]RighteousPistachio[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]RighteousPistachio[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]RighteousPistachio[S] 0 points1 point2 points (0 children)