Define module-level imports.
Project description
PyFoldingAtHomeControl
Python library to get stats from your Folding@Home Clients
Installation
$ pip install PyFoldingAtHomeControl
Usage
import asyncio
from FoldingAtHomeControl import FoldingAtHomeController
from FoldingAtHomeControl import PyOnMessageTypes
def callback(message_type, data):
print(f"callback for: {message_type}: ", data)
async def cancel_task(task_to_cancel):
task_to_cancel.cancel()
await task_to_cancel
if __name__ == '__main__':
Controller = FoldingAtHomeController("localhost")
Controller.register_callback(callback)
loop = asyncio.get_event_loop()
task = loop.create_task(Controller.start())
try:
loop.run_until_complete(task)
except KeyboardInterrupt:
pass
finally:
print("Cancelling task")
try:
loop.run_until_complete(cancel_task(task))
except asyncio.CancelledError:
print("Closing Loop")
loop.close()
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
Close
Hashes for PyFoldingAtHomeControl-2.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ceb22d7d3a8c41335f53f08b27137383ad6f3c54471b6f25b5f2232fc56bf64 |
|
MD5 | bc2530ce5ccad62520f5064543f65987 |
|
BLAKE2b-256 | 65e3c0af94c4127a4b053d8397b68839569b8b025156afd76db3949c70d0db55 |
Close
Hashes for PyFoldingAtHomeControl-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ea647983c7f30a801e0566ca9897d8f07de38239d52994da5b7b63fe1cbab77 |
|
MD5 | 8c936ef9b22d11e6dc1dd1e8a83c0be0 |
|
BLAKE2b-256 | 6c649d56071b192fcce5deec0f42784a1aabb8b4f44b5cac5d8cbcd1d8a56dcb |