A Python package that provides cross-platform Unicode executable path resolution. Like Unix `which` command but better.
Project description
find-unicode-executable
A Python package that provides cross-platform Unicode executable path resolution. Like Unix which command but better.
Features
- Compatibility - Python 2+, Windows and Unix-like systems supported
- Generator-based - finds all matching executables, not just the first one
- Thread-safe - no global state
- Supports multi-call binaries - DOES NOT follow symlinks to canonical paths (that would mess up
argv[0]passed to multi-call binaries)
Installation
pip install find-unicode-executable
Usage Example
# coding=utf-8
from __future__ import print_function
from find_unicode_executable import find_unicode_executable
# Find all Python executables in resolution order
# Sample output on Linux:
# /home/user/miniconda3/bin/python3.12
# /usr/bin/python3.10
# /usr/bin/python3.10
# Sample output on Windows:
# C:\Python38\python.exe
# C:\Python27\python.exe
for executable_path in find_unicode_executable(u'python'):
print(executable_path)
Windows-Specific Features
On Windows, the package automatically handles:
PATHEXTenvironment variable (.exe,.bat, etc.)- Current directory checking (Windows behavior)
- Case-insensitive matching
Comparison to Alternatives
| Feature | find-unicode-executable | shutil.which |
Unix which |
|---|---|---|---|
| Multiple results | ✅ Yes | ❌ No | ❌ No |
| Windows PATHEXT | ✅ Yes | ✅ Yes | ❌ No |
| Thread-safe | ✅ Yes | ✅ Yes | ❌ No |
| Follows symlinks | ✅ Yes | ❌ No | ❌ No |
| Current dir (Windows) | ✅ Yes | ❌ No | ❌ No |
Why Use This Package?
- When you need all matches, not just the first one
- For consistent behavior across platforms
- When you need proper Windows executable resolution
- For thread-safe executable finding
- When you want to follow symlinks to real paths
Contributing
Contributions welcome! Please open issues or pull requests on GitHub.
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file find_unicode_executable-0.1.0a2.tar.gz.
File metadata
- Download URL: find_unicode_executable-0.1.0a2.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2ead0391cb132820bc5ac60ccdf4dcc048aaf3968a62ba6299b9596255d35ff
|
|
| MD5 |
376956cc8f547249efa4abf6569e891a
|
|
| BLAKE2b-256 |
0468ccfe916c4294bac5df5f7df3a0c786d076762afc4133d812737932fe473f
|
File details
Details for the file find_unicode_executable-0.1.0a2-py2.py3-none-any.whl.
File metadata
- Download URL: find_unicode_executable-0.1.0a2-py2.py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17327898e495cee611c6cc66a523709130222cc1471a1598288657f71591cae5
|
|
| MD5 |
d4996160a5bbca9eea14ae7746eed9cf
|
|
| BLAKE2b-256 |
1f34d8e937b377136c15281ce9b1cf24d21d83af2f143d4fdfcba4b271db9cea
|