Juho Schultz wrote:
> rbt wrote:
>> Hi,
>>
>> Is there a way to make os.path.splitext() case agnostic?
>>
>> def remove_file_type(target_dir, file_type):
>> for root, dirs, files in os.walk(target_dir):
>> for f in files:
>> if os.path.splitext(os.path.join(root, f))[1] in f
Richie Hindle wrote:
> [rbt]
>> Is there a way to make os.path.splitext() case agnostic?
>>
>> def remove_file_type(target_dir, file_type):
>> for root, dirs, files in os.walk(target_dir):
>> for f in files:
>> if os.path.splitext(os.path.join(root, f))[1] in file_type:
>
[rbt]
> Is there a way to make os.path.splitext() case agnostic?
>
> def remove_file_type(target_dir, file_type):
> for root, dirs, files in os.walk(target_dir):
> for f in files:
> if os.path.splitext(os.path.join(root, f))[1] in file_type:
> pass
>
>
rbt wrote:
> Hi,
>
> Is there a way to make os.path.splitext() case agnostic?
>
> def remove_file_type(target_dir, file_type):
> for root, dirs, files in os.walk(target_dir):
> for f in files:
> if os.path.splitext(os.path.join(root, f))[1] in file_type:
>
Hi,
Is there a way to make os.path.splitext() case agnostic?
def remove_file_type(target_dir, file_type):
for root, dirs, files in os.walk(target_dir):
for f in files:
if os.path.splitext(os.path.join(root, f))[1] in file_type:
pass
remove_file_type(sy