Created
April 22, 2022 11:58
-
-
Save sohang3112/9b12491b005434fb33467a3bc027ab40 to your computer and use it in GitHub Desktop.
Keep opening random stdlib modules' documentation in browser while user wants to continue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import random | |
import webbrowser | |
mods = list(sys.stdlib_module_names) | |
random.shuffle(mods) | |
for mod in mods: | |
if mod[0] == '_': # Skip Internal Modules | |
continue | |
webbrowser.open(f'https://docs.python.org/3/library/{mod}.html') | |
if input('Continue? (y|n)> ').strip().lower() != 'y': | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: This will fail for some modules (eg.
pstats
) that don't have their own Python 3 Documentation page.