Friday, 17 February 2017

How to check whether a file (from the list of file names) exist or not in Python?

I have a list of file names like




22.75_87.dat
22.75_87.25.dat
22.75_87.5.dat
22.75_87.75.dat
23_86.dat
23_86.25.dat
23_86.5.dat
23_86.75.dat
23_87.dat

23_87.25.dat
23_87.5.dat
23_87.75.dat
23.25_86.dat
23.25_86.25.dat
23.25_86.5.dat
23.25_86.75.dat
23.25_87.dat
23.25_87.25.dat
23.25_87.5.dat



and so on.



Out of these file names I only few files exist. I need to make folders exactly same as the exisitng file names only. How to do this?



I can generate the filenames, but have no idea how to proceed further.

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...