linux, macOS, and win variables instead of sys.platform.startswith(...)
See original GitHub issueThis is just a suggestion to define (boolean) python variables linux
, macOS
(or osx
), and win32
such that the following:
{% if sys.platform.startswith('linux') or sys.platform.startswith('osx') %}
could be replaced with:
{% if linux or osx %}
Are there any limitations in the tools used by conda-devenv
that prevent this simpler usage?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:13 (13 by maintainers)
Top Results From Across the Web
Linux 3: code should avoid using sys.platform == 'linux2'
msg138251 ‑ (view) Author: Charles‑François Natali (neologix) * Date: 2011‑06‑13 14:34
msg138252 ‑ (view) Author: STINNER Victor (vstinner) * Date: 2011‑06‑13 14:38
msg138253 ‑ (view)...
Read more >sys.platform.startswith Example
Learn how to use python api sys.platform.startswith. ... return 'win' elif sys.platform.startswith('linux'): return 'linux' elif ...
Read more >How to identify which OS Python is running on?
i.e. platform. system() returns "Windows" instead of "win32" . sys. platform also contains "linux2" on old versions of Python while it contains just...
Read more >Building Go Applications for Different Operating Systems ...
You can set either the GOOS or GOARCH environment variables to build for a different platform using go build . If you are...
Read more >What's the difference between "platform.system() ...
Use os.name == 'nt' for determining windows (vs posix), sys.platform for finer granularity (eg. sys.platform.startswith('linux') for checking if it's Linux.).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@nicoddemus Sure! 😃 I’ll see what I can do. @marcelotrevisani Sure,
unix === linux or osx
, right.Yes you are right. I say we drop all python (and numpy) related vars. Since to the environment being created the info from the root (base) environment is not really useful and can became confusing.