I'm attempting to make use of cgminer
's API using Python. I'm particularly interested in utilizing the requests
library.
I understand how to do basic things in requests
, but cgminer
wants to be a little more specific. I'd like to shrink
import socket
import json
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('localhost', 4028))
sock.send(json.dumps({'command': 'summary'}))
using requests
instead.
How does one specify the port using that library, and how does one send such a json request and await a response to be stored in a variable?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句