AnsweredAssumed Answered

Parse out lowest directory in a path

Question asked by desertsp on Jul 24, 2018
Latest reply on Jul 24, 2018 by desertsp

Given an arbitrary path which contains a filename, how would I parse out the just name of the lowest directory?

 

Example:  "c:\customers\midwest\chicago\input_file.csv" 

 

Desired output:  "chicago"

 

Is there a proper way to do this using Python 2.7?

Outcomes