我是想把一个档案内的字,放到阵列里面
那些字我想转成十六进制,有转成功!但是值放不进去。。以下是我的程式码
import numpy as np
fileName = input ("输入档案名称:")
file = open(fileName,"r")
#abc = np.zeros((4,4))
abc = np.zeros((4,4))
i = 0
for j in range (4):
for i in range (4):
text = file.read(1)
#print("text"+" "+str(text))
textB = text.upper()
#print("textB" +" "+ str(textB))
text2 = ord(text)
#print("textord" +" " + str(text))
text3 = hex(text2)
print("texthex" +" "+text3)
abc[j][i] = text3
#print(abc)
https://i.imgur.com/MvN4C9P.jpg