首页 > 解决方案 > PyWAVES:simplejson.errors.JSONDecodeError:预期值:第 1 行第 1 列(字符 0)

问题描述

import pywaves as pw

def main():
    node = "https://nodes.wavesnodes.com"
    chain = "mainnet"

    pw.setNode(node=node, chain=chain)

    private_key = #############
    my_address_statement = pw.Address(privateKey=private_key)
    WAVES_balance = my_address_statement.balance()

    print("Your WAVES balance is: %d." % WAVES_balance)
    main()

main()

最终,此代码会产生标题中指示的错误。如何避免这种情况?

标签: python-3.xwavesplatform

解决方案


事实证明,这段代码是多余的:

node = "https://nodes.wavesnodes.com"
chain = "mainnet"

pw.setNode(node=node, chain=chain)

没有它的重构解决了这个问题。


推荐阅读