import os

# This Python 3 script examines all file and directory names in the current directory 
# and replaces spaces with underscore characters.  It is not recursive, so it must be 
# run in each directory to be changed.

[os.rename(f, f.replace(' ', '_')) for f in os.listdir('.') if not f.startswith('.')]
