Skip to main content

解决了Windows不支持通配符运行python代码的问题

Project description

Regular Python (repy) 🐍

PyPI Version License: MIT

一个专为Windows优化的Python通配符执行工具,弥补原生shell不支持python /*/tar*get.py的不足,支持多级目录匹配操作。

仅支持Windows环境

让Python通配符执行像呼吸一样自然 🌟


✨ 功能特性

  • 通配符解析
    • 支持 *.pysrc/**/test_*.py 等复杂模式
    • 自动转换为正则表达式,适配Windows大小写不敏感文件系统
  • 多层级递归匹配
    • 通过 --rp-allow-multiple 允许*跨多级目录匹配
  • 无缝参数传递
    • 支持向被运行脚本传递参数(如-- args

📦 安装

通过PyPI安装

pip install stv_repy

从源码安装

git clone https://github.com/StarWindv/regular-python.git
cd regular-python
pip install .

🚀 使用指南

基本命令

repy [--rp-选项] <路径模式> [-- Python参数]

主要参数说明

选项 说明
-rh, --rp-help 显示帮助信息
-ram, --rp-allow-multiple 允许多级通配符(如**/*.py

示例

1. 执行当前目录所有Python文件

repy *.py

2. 多级目录匹配测试文件

repy --rp-allow-multiple tests/**/*_test.py args

3. 跨盘符匹配并传递参数

repy D:/*/*/*/target.py args

4. 显示帮助信息

repy --rp-help

⚠️ 注意事项

  1. 路径空格处理
    若路径含空格,需用引号包裹(如"My Project/*.py")。

  2. 性能提示
    深层目录匹配(如**/*.py)因设备原因可能较慢,建议结合具体层级限制。

  3. 特殊字符转义
    尽可能避免在路径模式中使用特殊符号,或手动转义。


🤝 贡献指南

欢迎提交Issue或PR! 希望您能完善正则匹配模式!


📜 许可证

MIT License © 2025 StarWindv (星灿长风v)
📧 联系作者:starwindv.stv@gmail.com

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

stv_repy-0.0.1.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stv_repy-0.0.1-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file stv_repy-0.0.1.tar.gz.

File metadata

  • Download URL: stv_repy-0.0.1.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for stv_repy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 108ef0554ea3ee773c40f92afd1d6763d63037b2cebe843ce7a35f3ec5d205ec
MD5 f2af9c983ead0775bcc1510636982561
BLAKE2b-256 423273614b4d3defae03d93b10d2b12b46437ab220d9c62aee6d776951235172

See more details on using hashes here.

File details

Details for the file stv_repy-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: stv_repy-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for stv_repy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2e90f38308aebf243a78b3ed68e5815553d368ce2397cf7bfa6c3236b21b402f
MD5 4ec63cdac19b7ea53e625a1945906320
BLAKE2b-256 3c36fcf08c5c70945657b3c71ba5f60ad36d590f6059db3c388fa7ea772ba82c

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