A cross-platform version of 'os.startfile' from the standard library.
Maintained. Last release 13 months ago, commits in 17 of the last 26 weeks. Weaker on recent releases and release cadence.
pip install universal-startfileOverview
This is a cross-platform version of the os.startfile function in the Python standard library.
It emulates the following actions in an operating system's UI:
- double-clicking a file
- single-clicking a URL
which will open the default program associated with that type.
Setup
Requirements
- Python 3.9+
Installation
Install it directly into an activated virtual environment:
$ pip install universal-startfile
or add it to your Poetry project:
$ poetry add universal-startfile
Usage
After installation, import the startfile function:
from startfile import startfile
startfile("~/Downloads/example.png")
startfile("http://example.com")