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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -