Also, do y’all call main() in the if block or do you just put the code you want to run in the if block?

  • _stranger_@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    8 days ago

    Python doesn’t need the name main check to function at all. that’s just a convenience feature that lets developers also include arbitrary entry points into modules that are part of a library and expected to be used as such. If you’re writing a script, a file with a single line in it reading print("hello world") will work fine when run: python thescript.py