r/PythonLearning • • Sep 04 '25

I started coding in python.

Post image
159 Upvotes

21 comments sorted by

View all comments

17

u/TheSupervillan Sep 04 '25

I recommend start doing screenshots! It’s not that hard.

4

u/randomgenacc Sep 04 '25

My thoughts too, can’t tell what the OS is, but snipping tool is great!!

3

u/TheSupervillan Sep 04 '25 edited Sep 04 '25

Just use:

import platform import webbrowser from urllib.parse import quote_plus

def detect_os_name():

sys = platform.system()

if sys == "Windows":
    rel = platform.release()
    if rel == "10":
        return "Windows 10"
    if rel == "11":
        return "Windows 11"
    return "Windows"
if sys == "Darwin":
    return "macOS"
if sys == "Linux":
    return "Linux"
return "Unknown OS"

def main():

os_name = detect_os_name()
query = f"How to take a screenshot on {os_name}"
url = f"https://www.google.com/search?q={quote_plus(query)}"
webbrowser.open(url)

if name == "main":

main()

4

u/HyperWinX Sep 04 '25

I also recommend formatting code.

1

u/Some-Passenger4219 Sep 05 '25

Me too. Happy cake day!

3

u/HyperWinX Sep 05 '25

Oh, its my happy cake day already? Damn, thank you so much

1

u/Makarov-Dreyar Sep 05 '25

Happy cake day !

1

u/Letscode11 Sep 05 '25

Ok i will do screen short for the next code. Like i update this and uploaded it which is a pic too but next one i will screenshot