|
|
|
|
|
by sgarland
722 days ago
|
|
from string import capwords
result = capwords(string)
This does the split/capitalize/join dance, all in one.The file example you gave could also be turned into a dict comprehension if desired. Iām on mobile, but I think this would work. result = { f:os.path.getsize(f) for f in glob.glob(ā*ā) if os.path.isfile(f) }
|
|