Skip to content

Instantly share code, notes, and snippets.

@Raka-loah
Created July 3, 2020 09:52
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raka-loah/8f9777a8c8dca9f5df43cfbca9681d8d to your computer and use it in GitHub Desktop.
Save Raka-loah/8f9777a8c8dca9f5df43cfbca9681d8d to your computer and use it in GitHub Desktop.
import os
for file in os.listdir('./'):
if file.endswith('.w3m') or file.endswith('.w3x'):
with open(os.path.join('./', file), 'rb') as f:
header = f.read(255)
map_name = header[8:8+header[8:].find(b'\x00')]
print(map_name)
# TODO: map_name删除|c与|r,顺带删除|c后面的颜色代码
# TODO: os.rename()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment