here is what I have so far:
Expand|Select|Wrap|Line Numbers
- import os
- fileDir=os.listdir("c:\\Users\\Nathan\\Desktop\\Cell Pics\\")
- count = 1
- for fn in fileDir:
- if fn[-4:] == '.jpg':
- os.rename(fn,'%03i.jpg' % count)
- count += 1
Expand|Select|Wrap|Line Numbers
- Traceback (most recent call last):
- File "C:/Python27/test2.py", line 7, in <module>
- os.rename(fn,'%03i' % count)
- WindowsError: [Error 2] The system cannot find the file specified
I am using windows atm but this script is for UNIX. (if that matters let me know) I am pretty new to scripting and python (first week ever programming) so please be descriptive if at all possible!
thanks in advance!