python_pickle.py (418B)
- #!/usr/bin/python
- # SPDX-FileCopyrightText: 2019 deblob Authors <https://hacktivis.me/projects/deblob>
- # SPDX-License-Identifier: BSD-3-Clause
- import pickle
- def hello():
- print("Hello, World!")
- for protocol in range(0, pickle.HIGHEST_PROTOCOL+1):
- dest_file = "./test/fixtures/pickle/hello.{}.pickle".format(protocol)
- print(dest_file)
- fh = open(dest_file, "xb")
- pickle.dump(hello, fh, protocol)
- fh.close()