Why my code doesn't save/load my data in python?
问题 I use the following code(you can copy and run the code, it works) to load(if exists) and save the data to reuse it in the next execution of my program, but it doesn't work: import matplotlib.pyplot as plt import time import requests import pickle z = [] try: with open('3_tir.pickle', 'rb') as f: last_prices = pickle.load(f) print("pickle loaded") #f = open("last_prices.txt", 'a+') #f.read() except Exception: #f = open("last_prices.txt", 'a+') pass for i in range(25200): time.sleep(1) with