1Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32
2Type "help", "copyright", "credits" or "license" for more information.
3>>> import os
4>>> path = os.getcwd()
5>>> filenames = os.listdir(path)
6>>> for filename in filenames:
7... os.rename(os.path.join(path, filename), os.path.join(path, filename.replace(' ', '-')))
8...
9>>>
10