def abbrev_cwd():
 cwd = os.getcwd().replace('\\', '/')
 drivepart = ''
 tail = cwd
 if (sys.platform == 'win32'):
  if (len(cwd) < 4):
   return cwd
  (drivepart, tail) = os.path.splitdrive(cwd)
 parts = tail.split('/')
 if (len(parts) > 2):
  tail = '/'.join(parts[(-2):])
 return (drivepart + (((cwd == '/') and '/') or tail))

def abbrev_cwd ( ) : cwd = os . getcwd ( ) . replace ( '\\' , '/' ) drivepart = '' tail = cwd if ( sys . platform == 'win32' ) : if ( len ( cwd ) < 4 ) : return cwd ( drivepart , tail ) = os . path . splitdrive ( cwd ) parts = tail . split ( '/' ) if ( len ( parts ) > 2 ) : tail = '/' . join ( parts [ ( - 2 ) : ] ) return ( drivepart + ( ( ( cwd == '/' ) and '/' ) or tail ) )
return abbreviated version of cwd .