Answers for "os.rename python"

0

python rename

#!/usr/bin/python

import os
# Scan current path='.'
it =  os.scandir()
for entry in it:
    if not entry.name.startswith('.') and entry.is_file():
        print(entry.name)
        os.rename(entry.name, entry.name.replace('_', ''))
Posted by: Guest on September-30-2021

Python Answers by Framework

Browse Popular Code Answers by Language