]>
vgcfreebox.myrthtech.pt Git - ue-ccd-compressaodeimagensbinarias.git/blob - huffman.py
4 _opt_type
= sys
.argv
[1]
5 _file_path
= sys
.argv
[2]
9 _file
= utils
.get_file(_file_path
)
10 _pbm_content
= utils
.BitMapFile(_file
)
11 _result
= utils
.huffman_encode_image(_pbm_content
)
12 with open(sys
.argv
[2]+".bin", "wb") as file:
15 elif _opt_type
== "d":
16 _result
= utils
.huffman_decode_file(_file_path
)
17 with open(sys
.argv
[2].strip('.bin'), "w") as file: