Python Forum
Search file with *filename* python 3.8
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Search file with *filename* python 3.8
#12
(Dec-22-2019, 02:29 PM)snippsat Wrote:
(Dec-22-2019, 12:01 PM)lastyle Wrote: But os.Path.Isdir returns the complete path
No it return True or False,it dos a test if it's a folder and that folder exits.
>>> os.path.isdir(r'E:\div_code\pan')
True
>>> os.path.isdir(r'E:\div_code\pan999')
False
(Dec-22-2019, 12:01 PM)lastyle Wrote: So I need to check if the return value if it contains bestfile.
This i don't understand,in code dos regex .*bestfile.* the check,and only return files that match this regex.

Sure, finding Files works like a charm. But as this is a work in Progress i didnt notice earlier that there may exist Folders like bestfileV2.0 which contain e.g. Updatev2.0.exe which belongs to bestfile but doesnt match the Filename. So i need to cover that aswell sadly
Reply


Messages In This Thread
Search file with *filename* python 3.8 - by lastyle - Dec-19-2019, 09:07 PM
RE: Search file with *filename* python 3.8 - by lastyle - Dec-22-2019, 11:13 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020