-
-
Save Raka-loah/8f9777a8c8dca9f5df43cfbca9681d8d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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