Expand|Select|Wrap|Line Numbers
- import os
- tralla='/windows'
- tintin='/LOLOL'
- list1=[]
- list2=[]
- for item in os.listdir(tralla):
- if os.path.splitext(item)[1][0]=='.':
- list1.append(item)
- else:
- list2.append(item)
- for item in os.listdir(tintin):
- if os.path.splitext(item)[1][0]=='.':
- list1.append(item)
- else:
- list2.append(item)
- for item in list2:
- print item
"Traceback (most recent call last):
File "untitled.py", line 8, in <module>
if os.path.splitext(item)[1][0]=='.':
IndexError: string index out of range"
?
At least this time it's with tab-indents, some people didn't like it when I used spaces last time... :)
Any help I can get is appreciated.