renaming files in a directory using python or R -
i went across similar questions of renaming files in directory using python. i have these files in directory want rename: -statistical_analysis_with_r -statistical_pattern_recognition_3rd_edition -statistical analysis r -statistical pattern recognition 3rd edition for wrote script in windows: def naming(so): import re w=re.split('[ _]+',so) r=[] in w: r.append(i.capitalize()) print(' '.join(r)) import os c in os.listdir(os.getcwd()): if c.endswith(".pdf"): os.rename(c,naming(c)) print(os.listdir(os.getcwd())) but getting error: statistical analysis r.pdf traceback (most recent call last): file "<ipython-input-79-d7f645d6d3e5>", line 4, in <module> os.rename(c,naming(c)) typeerror: rename: can't specify none path argument can what's going on? and doing same thing using r (www.r-project.org)? loads of in advance. your naming functio