标签:.com question ret eval port tween for tps from
val
accepts only a single expression, eval
returns the value of the given expression。exec
can take a code block that has Python statements: loops, try: except:
, class
and function/method def
initions and so on. return None.import pickle a = [‘test value‘,‘test value 2‘,‘test value 3‘] a [‘test value‘,‘test value 2‘,‘test value 3‘] file_Name = "testfile" # open the file for writing fileObject = open(file_Name,‘wb‘) # this writes the object a to the # file named ‘testfile‘ pickle.dump(a,fileObject) # here we close the fileObject fileObject.close() # we open the file for reading fileObject = open(file_Name,‘r‘) # load the object from the file into var b b = pickle.load(fileObject) b [‘test value‘,‘test value 2‘,‘test value 3‘] a==b True
标签:.com question ret eval port tween for tps from
原文地址:https://www.cnblogs.com/ryu-manager/p/9399453.html