Coder Social home page Coder Social logo

Comments (7)

j9ac9k avatar j9ac9k commented on August 25, 2024

So after messing around w/ this a bunch, I settled with a work-around using conda environments, while not a fix, I thought I would post here in case anyone saw this:

I already had Miniconda3 installed on my windows based system (my preferred python distribution).

From the command prompt (not powershell):

>conda create -n EDDN python=2.7
>conda install pyzmq simplejson zlib gevent -n EDDN
>activate EDDN
>python client.py

when done with EDDN and wanting to go back to python 3

>deactivate

from eddn.

AnthorNet avatar AnthorNet commented on August 25, 2024

gEvent is effectively not used in examples, thus it could be removed.
I'll try when I have 5 minutes.

from eddn.

AnthorNet avatar AnthorNet commented on August 25, 2024

Try just changing:
import zmq.green as zmq
to:
import zmq

from eddn.

j9ac9k avatar j9ac9k commented on August 25, 2024

This is the closest I got, but I'm still getting:

TypeError: the JSON object must be str, not 'bytes'

import zlib
import zmq
import json
import sys


def main():
    context = zmq.Context()
    subscriber = context.socket(zmq.SUB)

    subscriber.setsockopt_string(zmq.SUBSCRIBE, "")
    subscriber.connect('tcp://eddn-relay.elite-markets.net:9500')

    while True:
        market_json = zlib.decompress(subscriber.recv())
        market_data = json.loads(market_json)
        print(market_data)
        sys.stdout.flush()

if __name__ == '__main__':
    main()

I've tried

import codecs

reader = codecs.getreader('utf-8')
...
    market_data = json.load(reader(market_json))
....

Then I get:

TypeError: the JSON object must be str, not 'StreamReader'

from eddn.

AnthorNet avatar AnthorNet commented on August 25, 2024

Try that one: https://github.com/AnthorNet/EDDN/tree/EDDN-Monitor/examples/Python%203.4

from eddn.

j9ac9k avatar j9ac9k commented on August 25, 2024

I confirmed both of those worked (after I opened the issue yesterday, I found those files posted in the forums); I didn't want to make a pull request suggesting that they be added as I didn't write them (what's the protocol for that sort of thing, I'm still new to development/open source/etc)?

Probably should have mentioned that earlier on...

from eddn.

AnthorNet avatar AnthorNet commented on August 25, 2024

Closing, example is available in "master"

from eddn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.