def get_cwd():
 p = subprocess.Popen(['pwd'], stdout=subprocess.PIPE, shell=True)
 return p.communicate()[0].strip()

def get_cwd ( ) : p = subprocess . Popen ( [ 'pwd' ] , stdout = subprocess . PIPE , shell = True ) return p . communicate ( ) [ 0 ] . strip ( )
get_cwd os .