You should not hash the string "0102030405060701". What you actually need to do is hash the bytes which are represented by that hexadecimal value in your code.
You may use the code which is mentioned below:
>>> import hashlib
>>> import binascii
>>> hashlib.sha256(b'0102030405060701').hexdigest()
'5bc31e3decf480124c79c114744d111ec82b62e466a097c3ced6fe76cbace9a5'
>>> hashlib.sha256(binascii.unhexlify('0102030405060701')).hexdigest()
'245138c905599c8579ab186fbdbd6e62396aac35a98a6568f8803eed049d1251'
You should note that hashing the string directly won't fetch what you are seeking. You should convert the string to binary using unhexlify in Solidity.