Closed kisssadam closed 9 years ago
This would slow down your program considerably. I think it's enough to check just the extension.
And what do you think about the current solution? Which one is better?
Find the extension only at the end of the filename:
match = re.search(key + "$", filename)
or in the entire string:
match = re.search(key, filename)
I used the last one, beacuse you have python files ending with .txt
here:
https://dl.dropboxusercontent.com/u/144888/tanitas/python/02_listak/index.html
If the first solution is used then list1.py.txt
will be treated as a single text file and icon on the left will be different than the current one.
I would treat list1.py.txt
as a normal TXT file. Its extension is .txt
so it's a text file for me.
Function is updated.
This method should determine the filetype as "file" program does.