You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I open this issues to point out some changes that the code has to have to be able to run in python 3.6.
First, the Print ""...have to changed to Print()
then in blocktools.py,
The ord() funtion has to be removed in the line
def hashStr(bytebuffer):
return ''.join(('%02x'%ord(a)) for a in bytebuffer)
In Python 2, bytestrings are the "standard" string objects, so that indexing into one returns the character at that position (itself a string) …
Python 2.7
b'whatever'[3]
't'
… and calling ord() on the result behaves as expected:
ord(b'whatever'[3])
116
However, in Python 3, everything is different: the standard string object is a Unicode string, and bytestrings are instead sequences of integers. Because of this, indexing into a bytestring returns the relevant integer directly …
Python 3.6
b'whatever'[3]
116
… so calling ord() on that integer makes no sense
Second in the block.py
the line print("\tCoinbase Text:\t %s" % hashStr(self.prevhash).decode("utf-8"))
in python 3.6 str has no longer a decode method, so they recommend removed, but im not sure, it is right.
Its seems that its working with this changes.
Hope this help,
Thanks and kid regards,
Iván
The text was updated successfully, but these errors were encountered:
Hi,
I open this issues to point out some changes that the code has to have to be able to run in python 3.6.
First, the Print ""...have to changed to Print()
then in blocktools.py,
The ord() funtion has to be removed in the line
def hashStr(bytebuffer):
return ''.join(('%02x'%ord(a)) for a in bytebuffer)
In Python 2, bytestrings are the "standard" string objects, so that indexing into one returns the character at that position (itself a string) …
Python 2.7
Python 3.6
Second in the block.py
the line print("\tCoinbase Text:\t %s" % hashStr(self.prevhash).decode("utf-8"))
in python 3.6 str has no longer a decode method, so they recommend removed, but im not sure, it is right.
Its seems that its working with this changes.
Hope this help,
Thanks and kid regards,
The text was updated successfully, but these errors were encountered: