Advertisement
Danila_lipatov

format_file(active)

Oct 13th, 2022
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. import os
  2. import subprocess as sub
  3. import pathlib
  4. import io
  5. from magic import libmagic
  6. f1 = open(f"0409115.rar.TXT", "r")
  7. print(f1.read())
  8. """f2 = open(f"F0409115_KO-0600_S_20220101.xml", "r")
  9. print(f2.read())"""
  10. """f3 = open(f"test1.rar.txt")
  11. print(f3.read())"""
  12.  
  13.  
  14. """with io.open(f"test1") as file:
  15. for line in file:
  16. print(line)"""
  17. #print("File Extension: ", file_extension)
  18.  
  19. blob = open('test1"', 'rb').read()
  20. m = libmagic.open(libmagic.MAGIC_MIME_ENCODING)
  21. m.load()
  22. encoding = m.buffer(blob)
  23. print(encoding)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement