Skip to content

Instantly share code, notes, and snippets.

@fuomag9
Last active September 6, 2018 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fuomag9/68c554a9de3c07673fc41a917904fd1e to your computer and use it in GitHub Desktop.
Save fuomag9/68c554a9de3c07673fc41a917904fd1e to your computer and use it in GitHub Desktop.
Replace spaces with underscores for files in execution folder
# coding=utf-8
import os
from os import listdir
from os.path import isfile, join
bot_path=os.getcwd()
lista_cibo=[f for f in listdir(bot_path) if isfile(join(bot_path, f))]
for x in lista_cibo:
os.rename(x,x.replace(" ","_"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment