SyntaxError:%time pickle.dump

时间:2015-06-17 20:45:09

标签: python time syntax syntax-error pickle

有人可以向我解释%时间是如何运作的吗? 我从一本书中得到了这个,但每次使用它时,都会出错。 SyntaxError:语法无效

path = '/home/foad/PythonBoken/flash/'

import numpy as np
from random import gauss

a = [gauss(1.5, 2) for i in range(100000)] #generation of normally distributed randoms

#Write this list above to disk for later retrieval
import pickle 

pkl_file=open(path + 'data.pkl', 'w') #open file for writing. Existing file may be overwritten

%time pickle.dump(a, pkl_file)

0 个答案:

没有答案