Tendo is a Python library that extends core functionality, providing tools such as transparent Unicode support for file operations, a `tee` implementation for concurrent output, and an improved `execfile` function. Its prominent `singleton` module ensures that only a single instance of a Python script or application can run at a time on a given machine, leveraging lock files for process management. As of version 0.4.0, it requires Python 3.8+ and uses `SingleInstance` as a context manager.
pip install tendoVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `tendo.singleton.SingleInstance` as a context manager to ensure only one instance of a Python script runs at a time. If a second instance attempts to acquire the lock, a `SingleInstanceException` is raised.
Update your code to use `with SingleInstance():` instead of `me = SingleInstance()`.
Ensure your Python environment is version 3.8 or newer before installing or upgrading to `tendo` v0.4.0+.
Upgrade `tendo` to version 0.3.0 or higher. If unable to upgrade, avoid using Python 3.9+ with older `tendo` versions.
Upgrade `tendo` to the latest version. The refactoring to use a context manager in v0.4.0 and other internal improvements address such shutdown issues more robustly.
This is often intended behavior. If you only want one instance, ensure previous runs are terminated. If you want multiple distinct instances of the same script, provide a unique `flavor_id` to `SingleInstance(flavor_id='unique_id')`. Wrap your `SingleInstance` usage in a `try...except SingleInstanceException` block to handle this gracefully.
No dependency data recorded yet.