thanks, i also want to practice some code for cpu/gpu bitcoin mining, so i very gladly looked at your work.
a question regarding this line of code: hash = hashlib.sha256(hashlib.sha256(binascii.unhexlify(blockheader)).digest()).digest()
why are you calling sha256 twice? so you hash the hash of the header.
maybe it's a mistake?