cmd - How to detect the terminal that is running python? -
i've tried sys.platform, platform.system() , os.name none of them return related cygwin (i win32, windows , nt output). maybe because python installed on windows (8.1) , not through cygwin. need detect if python file being executed cygwin or cmd.
cygwin uses linux-style paths; might able check path separator:
import sys import os.path def running_cygwin(): return sys.platform == 'win32' , os.path.sep == '/'
(i don't have cygwin here, untested.)
Comments
Post a Comment