Skip to main content

Find file or folder by Python, Faster than Windows File Explorer.

Project description

python_find_file_name

find file or dir location.

Install

pip install wfind

Usage

python -m find "base_path" "file_or_directory_name"

python -m find --base_path "C:\" --pattern ".mp4"
python -m find --base_path "C:\" --pattern "mat" --mode "in" --folder
python -m find --base_path "C:\" --pattern ".png" --mode "in" --file
python -m find --base_path "C:\" --mode "re" -re ".pdf$" 
python -m find --base_path "C:\" --pattern "*.jpg" --mode "fm" 

python -m find --help
usage: __main__.py [-h] [-p BASE_PATH] [-d PATTERN] [-file] [-folder] [-m MODE] [-re RE]

Find File or Folder Name.

options:
  -h, --help            show this help message and exit
  -p, --base_path BASE_PATH
                        base path
  -d, --pattern PATTERN
                        dest pattern
  -file, --file         only search file
  -folder, --folder     only search folder
  -m, --mode MODE       mode: -m in, -m fm, -re
  -re, --re RE          regex

source and reference

https://stackoverflow.com/a/1724723/19470749
https://www.runoob.com/python/os-walk.html

Why I need this script?

I don't know where the huggingface download the model, and after search I know it download to cache folder, but I don't know where it is, so I directly use this script to search D drive and C drive, and then success find.

find("*text_encoder*", "D://")
find("*text_encoder*", "C://")

Notice, you can also set huggingface cache dir

pipe = CogVideoXImageToVideoPipeline.from_pretrained(model_id,text_encoder=text_encoder,transformer=transformer,vae=vae,torch_dtype=torch.float16,cache_dir="D://3")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wfind-0.0.2.tar.gz (8.8 kB view details)

Uploaded Source

File details

Details for the file wfind-0.0.2.tar.gz.

File metadata

  • Download URL: wfind-0.0.2.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for wfind-0.0.2.tar.gz
Algorithm Hash digest
SHA256 4f7ada83d225709aa61a786b386fcf16cbccc4aa0d4e52dcf8c624d8f09cdb1d
MD5 352c78d97dc7664827a4d7c8bf6fb025
BLAKE2b-256 e3a24b7fc35f4c03466f99d3cf7d7034a1c4dabcbb370e1f8bff7272968291dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page