{"id":24791,"library":"universal-startfile","title":"universal-startfile","description":"A cross-platform replacement for os.startfile (Windows) that works on macOS and Linux by opening files with the default application. Current version 0.4, requires Python 3.9+. Releases are sporadic.","status":"active","version":"0.4","language":"python","source_language":"en","source_url":"https://github.com/jacebrowning/universal-startfile","tags":["cross-platform","file-opening","startfile","xdg-open"],"install":[{"cmd":"pip install universal-startfile","lang":"bash","label":"PyPI"}],"dependencies":[],"imports":[{"note":"Module name uses underscore, not hyphen.","symbol":"startfile","correct":"from universal_startfile import startfile"}],"quickstart":{"code":"from universal_startfile import startfile\n\n# Open a file with the default application (cross-platform)\nstartfile('/path/to/file.pdf')","lang":"python","description":"Opens a file using the OS default program. Works on Windows, macOS, and Linux."},"warnings":[{"fix":"Use underscore in imports: `from universal_startfile import startfile`.","message":"The package name on PyPI uses hyphen (universal-startfile), but the Python module uses underscore (universal_startfile). Import as `from universal_startfile import startfile`.","severity":"gotcha","affected_versions":"all"},{"fix":"Check return value (if any) or verify file associations before calling.","message":"On Linux, `startfile` typically calls `xdg-open`. This may fail silently if no default application is configured or if the file type is not associated.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `from universal_startfile import startfile` (underscore).","cause":"Trying to import with hyphen instead of underscore.","error":"ModuleNotFoundError: No module named 'universal-startfile'"},{"fix":"Ensure the file is readable and that xdg-open (or equivalent) is installed and executable.","cause":"The file exists but the user does not have execute permission for xdg-open or similar.","error":"PermissionError: [Errno 13] Permission denied"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}