python-3.x - 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()
最终,此代码会产生标题中指示的错误。如何避免这种情况?
解决方案
事实证明,这段代码是多余的:
node = "https://nodes.wavesnodes.com"
chain = "mainnet"
pw.setNode(node=node, chain=chain)
没有它的重构解决了这个问题。
推荐阅读
- node.js - 可以在没有密码的情况下保护 POST 路由吗?
- python - 通过在 Python 中使用循环连接另一个数据帧的值来重命名一个数据帧的变量
- sql - SQL - 过滤行数可变的数据
- javascript - 为什么 UserScript 的 fetch 比 web-extension 的 fetch 拦截更多的请求?
- python - keras中多输出图像分类模型中的数据馈送问题
- react-native - 无法解析项目:@react-native-community_viewpager
- android - Android 从设备存储恢复领域
- amazon-web-services - 我无法将 EKS 节点加入 EKS 集群 (Terraform)
- scala - 如何读取 PCAP 的 Hadoop SequenceFile 并将单个 PCAP 从它写入 HDFS?
- go - Golang exec.Command 问题:总是以退出代码 2 失败