Hi All,
This is just something that has bothered me about IDLE through Anaconda on my Mac where if you hit F5 to run your module, it runs twice. So I figured out how to "fix" it.
Go to your python installation and find the idlelib folder (mine is anaconda3/envs/python36/lib/python3.6/idlelib). In this folder you'll find the files that run IDLE, the basic bare-bones IDE for python. Through poking around I found it seems to run twice because it runs once when you hit F5 and once because when you hit F5 it runs the Run Module menu item. So in order to fix it we need to assign the menu item somewhere else, I cleverly named it run-module2. Open mainmenu.py and edit run-module to say run-module2 (as shown).
Now if you were to run idle like this F5 would work, but the menu way wouldn't, so we should fix that while we are here. Open editor.py next and copy and paste the run-module line and rename the second one run-module2 (as shown).
Now I can go back to work.