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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a5e24d2d748fe7949e932c124a88fe42254bd46673aa7cdb031693005dcabdb |
|
MD5 | 9d1d2d4a697e0c1ac3cde887fbe1b3fa |
|
BLAKE2b-256 | c67df921c35b85a737915f4e01430bb03a2359f12998c2e1dcdf02b16611ee49 |
Close
Hashes for PyFoldingAtHomeControl-1.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2738e0d197b33e71f25e37306270977252c1f2f80164d889dbabf14e9403f94 |
|
MD5 | e9472b3ce1d63c091983ace75790b800 |
|
BLAKE2b-256 | 3a2524bda6948a45940d0e0b3bf24c1737b89c92aa564d525ef28d5e25df1d88 |