PyWAVES: simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
PyWAVES: simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 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)
不使用它进行重构解决了问题。
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)
不使用它进行重构解决了问题。