Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

bulk file name changer in python

# Developed by Sadman Sakib
import os


path = 'C:/Users/N.S Computer/OneDrive/Desktop/temp/'   # Path Directory


i=1

for file in os.listdir(path):
    new_name = 'SSS'+str(i)                 # Setting new unique name
    pre_file_name = path + file             # Obj with pre. fila name % directory
    new_file_name = path + new_name         # Obj with new. fila name % directory

    os.rename(pre_file_name, new_file_name) # Renaming Files
    i += 1                                  # Incrementing Value of i
Comment

PREVIOUS NEXT
Code Example
Python :: wxpython custom dialog 
Python :: python json indented 
Python :: dataframe catch data types 
Python :: install scratchattach 
Python :: python scratch cloud variabelen 
Python :: remove all rows where one ccolumns egale to nan 
Python :: remove duplicate space in string in pytoon 
Python :: how to save the history of keras model 
Python :: get date and time python 
Python :: sacar la posicion en una lista python 
Python :: python get weather temperature 
Python :: how to launch jupyter notebook from cmd 
Python :: python teilen ohne rest 
Python :: change the style of notebook tkinter 
Python :: add padding to 2d matrix p 
Python :: append one column pandas dataframe 
Python :: python set label colour 
Python :: adaptive thresholding with opencv python 
Python :: write muli line conditional statements in python 
Python :: python http server command line 
Python :: sns time series plot 
Python :: write to file python 3 
Python :: install log21 python 
Python :: matplotlib add legend axis x 
Python :: plt close all 
Python :: sorted python lambda 
Python :: install django windows 
Python :: flask return html 
Python :: python r before string 
Python :: finding if user input is lower or upper in python 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =