logo

deblob

remove binary executables from a directory git clone https://anongit.hacktivis.me/git/deblob.git/

python_pickle.py (418B)


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