
Tkinter GUI Module and Tools
|
119
object = U.load()
Reads an object from the unpickler’s file/stream.
object = pickle.load(fileobject)
Combination of the previous two: unpickles object from
file.
string = pickle.dumps(object)
Returns pickled representation of object as a string.
object = pickle.loads(string)
Reads an object from a character string instead of a file.
Notes
• Pickler and Unpickler are exported classes.
•
fileobject is an open file object, or any object that
implements file object attributes called by the interface.
Pickler calls the file write method with a string argu-
ment.
Unpickler calls the file read method with a byte-
count and
readline without arguments.
• In recent releases, the
Pickler constructor and the mod-
ule’s
dump and dumps functions have an additional argu-
ment, which used to be a flag named
bin and is now an
integer named
protocol. For more efficient but still back-
ward-compatible pickling, use
1 in this argument; for the
most efficient (but incompatible with pre-2.3
unpicklers)
pickling, use
2. Using -1 automatically uses the highest
protocol supported (and this works in older versions as
well).
Tkinter GUI Module and Tools
Tkinter is a portable graphical user interface (GUI) construc-
tion library shipped with Python as a standard library mod-
ule. Tkinter provides an object-based interface to the open
source Tk library and implements native look and feel for
Python-coded GUIs on ...