r/PythonLearning • • Sep 04 '25

I started coding in python.

Post image
159 Upvotes

21 comments sorted by

17

u/TheSupervillan Sep 04 '25

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

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

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/Legitimate-Rip-7479 Sep 04 '25

Good starting point

1

u/Letscode11 Sep 04 '25

Thanks

1

u/AbacusExpert_Stretch Sep 04 '25

Just a top as a side note: screenshots usually look and work much better 😁 but you do you, all good

1

u/TimeContribution9581 Sep 04 '25

Personal preference over commenting is more bloat I have to read through, give a function a decent name and description and leave the body alone unless mandatory

1

u/faton2004 Sep 04 '25

Welcome to the Team

1

u/lokidev Sep 04 '25

Good start already, but the following improvements:

  • look into pep8 and how to enforce it automatically 

  • look into typing so you can get rid of superfluous comments

  • use TypesDict 

  • don't mix do and show: either print or do logic :)

I complain, but it is really a good start

1

u/Lumpy_Marketing_6735 Sep 07 '25

Great job, always be proud of anything you make because you made it and not someone else!