Join Nostr
2024-11-11 22:32:06 UTC

Trey Hunner 🐍 on Nostr: Question #Python-knowledgeable folks. I usually use & recommend platform.system() for ...

Question #Python-knowledgeable folks.

I usually use & recommend platform.system() for identifying the current OS that code runs on.

Is that the best approach?

I only ask because platform.system() returns a user-facing name (it's not lowercased) and the docs for sys.platform note the possible names while platform.system()'s docs do not (Emscripten, WASI, and Cygwin are absent and I'm not even sure if those are the correct spellings for those platforms).