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-1.6.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ab47708b6a9d55c4c3d679a606d87d86fa7f7f712e4fd811a4f4889d142feb3 |
|
MD5 | eec07c73eda203351915cd28d0e4acc9 |
|
BLAKE2b-256 | f27f72554ba1953b8a92f3a16d3e8b4784fb904426e7a35e900e1d4955e5a4cb |
Close
Hashes for PyFoldingAtHomeControl-1.6.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7254283190f814709f18c48893c29c2aa977cde35165fa9394fd51b0f8c9bab |
|
MD5 | 3d953640b84759cefc080622ce181e68 |
|
BLAKE2b-256 | c642bd359920386e853235dc2bf64345c36d4d8e8f7b695410b74631ec087d49 |