Code Monkey home page Code Monkey logo

Comments (3)

shidenggui avatar shidenggui commented on July 20, 2024

python 2.7 不支持银河,因为银河用到了 dict 的中文 key

from easytrader.

hhhcj avatar hhhcj commented on July 20, 2024

@shidenggui 我又看了下,这个错误跟中文key无关,而是凡是有4个股东账户,都登不上银河的hytrader。Can not fetch balance info出自yhtrader.format_response_data方法

        columnlen = len(search_result_name)
        if columnlen == 0 or len(search_result_content) % columnlen != 0:
            log.error("Can not fetch balance info")
            retdata = json.dumps(search_result_name)
            retjsonobj = json.loads(retdata)
        else:
            rowlen = len(search_result_content) // columnlen
            retdata = list()
            for i in range(rowlen):
                retrowdata = list()
                for j in range(columnlen):
                    retdict = dict()
                    retdict[search_result_name[j]] = search_result_content[i * columnlen + j]
                    retrowdata.append(retdict)
                retdata.append(retrowdata)
            retlist = json.dumps(retdata)
            retjsonobj = json.loads(retlist)

有四个账户时,len(search_result_content) 并不等于20,而是18,“设为主股东”这一列只有2个值,还有两个非主股东是空值,所以进不了else

from easytrader.

hhhcj avatar hhhcj commented on July 20, 2024

@shidenggui dict 的中文 key的问题,似乎在key前加u即可,YHTrader.login()

        if len(exchangeinfo) >= 2:
            for i in range(2):
                if exchangeinfo[i][TRADE_MARKET][u'交易市场'] == '深A':
                    self.exchange_stock_account['0'] = exchangeinfo[i][HOLDER_NAME][u'股东代码'][0:10]
                else:
                    self.exchange_stock_account['1'] = exchangeinfo[i][HOLDER_NAME][u'股东代码'][0:10]
        return login_status

目前这两问题fix之后,继续报错
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
然后程序中止

from easytrader.

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.