Is there a way to check if my python script is running in Windows Command Prompt, vs Cygwin? Using os.name doesn't work because Cygwin on Windows still returns "nt". I want to check the command prompt's name or type from a shell script so I can differentiate between Command Prompt and Cygwin.
-
Maybe the perl version is not exactly the same.simlev– simlev2017-03-15 21:57:35 +00:00Commented Mar 15, 2017 at 21:57
-
What do you mean?gusg21– gusg212017-03-15 22:04:25 +00:00Commented Mar 15, 2017 at 22:04
-
Ops, I mean Python: Cygwin installs its own python executable, so scripts running inside a Cygwin terminal will probably use that. What python executable is used by your scripts running inside a Windows command prompt? If you make them use a different one, possibly a slightly different version, you could check the version and know which environment you are in.simlev– simlev2017-03-15 22:09:24 +00:00Commented Mar 15, 2017 at 22:09
-
Possible duplicate of How can I know if my python script is running? (using Cygwin or Windows shell)Taku– Taku2017-03-15 22:15:05 +00:00Commented Mar 15, 2017 at 22:15
-
1My copy of Cygwin uses my Windows' Python. And I don't just want to detect Cygwin, I want to detect specifically Windows Command Prompt.gusg21– gusg212017-03-15 23:27:13 +00:00Commented Mar 15, 2017 at 23:27
|
Show 2 more comments