Spaces:
Running
Running
# cPickle是python2系列用的,3系列已经不用了,直接用pickle就好了 | |
import pickle | |
# 重点是rb和r的区别,rb是打开2进制文件,文本文件用r | |
f = open('/mnt/data10t/dazuoye/GROUP2024-GEN6/FakeSV/code_test/preprocessed_feature/douyin_6559701594739313923.pkl','rb') | |
data = pickle.load(f) | |
# 打印前五个键值对 | |
for i, (key, value) in enumerate(data.items()): | |
if i >= 2: | |
break | |
print(f"Key: {key}") | |
print(f"Value: {value}\n") |