Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- def getfilez(dir):
- for name in os.listdir(dir):
- path = os.path.join(dir,name)
- if os.path.isfile(path):
- j = os.path.splitext(path)
- if j[1]=='.txt':
- print path
- else:
- getfilez(path)
- m = "C:\Users\6CDG83DFV443RP443RP4\Documents\infodocs"
- getfilez(m)
- raceback (most recent call last):
- File "C:/Python27/filezz.py", line 15, in <module>
- getfilez(m)
- File "C:/Python27/filezz.py", line 4, in getfilez
- for name in os.listdir(dir):
- WindowsError: [Error 123] The filename, directory name, or volume label syntax is incorrect: 'C:\\Users\x06CDG83DFV443RP443RP4\\Documents\\infodocs/*.*'
- >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement