On 21/07/18 14:39, Ganesh Pal wrote:
>> The dictionary is irrelevant to your question. It doesn't matter whether
>> the path came from a dict, a list, read directly from stdin, an
>> environment variable, extracted from a CSV file, or plucked directly from
>> outer space by the programmer. The proc
> The dictionary is irrelevant to your question. It doesn't matter whether
> the path came from a dict, a list, read directly from stdin, an
> environment variable, extracted from a CSV file, or plucked directly from
> outer space by the programmer. The process remains the same regardless of
> wher
On Sat, 21 Jul 2018 17:07:04 +0530, Ganesh Pal wrote:
> I have one of the dictionary values in the below format
>
> '/usr/local/ABCD/EDF/ASASAS/GTH/HELLO/MELLO/test04_Failures.log'
> '/usr/local/ABCD/EDF/GTH/HEL/OOLO/MELLO/test02_Failures.log'
> '/usr/local/ABCD/EDF/GTH/BEL/LO/MELLO/test03_Failur
def return_filename_test_case(filepath):
filename = os.path.basename(filepath)
testcase = filename.partition('_')[0]
return filename, testcase
On 21 July 2018 at 12:37, Ganesh Pal wrote:
> I have one of the dictionary values in the below format
>
> '/usr/local/ABCD/EDF/ASASAS/GTH/HELL
I have one of the dictionary values in the below format
'/usr/local/ABCD/EDF/ASASAS/GTH/HELLO/MELLO/test04_Failures.log'
'/usr/local/ABCD/EDF/GTH/HEL/OOLO/MELLO/test02_Failures.log'
'/usr/local/ABCD/EDF/GTH/BEL/LO/MELLO/test03_Failures.log'
I need to extract the file name in the path example, say