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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2872e6ad28dd68addf4579cb3eca25b602303de06efe5659d62d3c208c652713 |
|
MD5 | ee403825d8ec77cc20b6d542bbb25014 |
|
BLAKE2b-256 | 90f311e886d3da9f7fba3892040c55ef633fea0ef782360f504f75f8b7783bed |
Close
Hashes for PyFoldingAtHomeControl-2.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f00f92b75bc69e3448f1e83a4c7fb76dc5b9dba5b2d367336d5c501c0695156b |
|
MD5 | c70644fe6021bd2a2d165136f41e536e |
|
BLAKE2b-256 | 3dc7d318fbd95ac4a1b655ee0931ce0d40d8c9553579f78a84fcc58772f64038 |