I need to process the filenames from a directory by creating the list of the filenames. But my resulting list contains entries for symbolic links too. How can I get pure filenames in a particular directory using python.
I have tried:os.walk,os.listdir,os.path.isfile
But all are including symbolic links of type 'filename~'
to the list :(
The glob.glob
adds the path to the list which I don't need.
I need to use it in a code like this:
files=os.listdir(folder)
for f in files:
dosomething(like find similar file f in other folder)
Any help? Or please redirect me to the right answer. Thanks
Edit: the tilde sign is at end