-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathxmptool.py
16 lines (13 loc) · 1.8 KB
/
xmptool.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import glob
import mmap
import sys
server=sys.argv[1]
for x in glob.glob("./*.png"):
with open(x, "r+b") as f:
mm = mmap.mmap(f.fileno(), 0)
t=mm.read(50000)
content=t.replace(b"SERVER", server)
mm.close()
with open("./test/"+x, "wb") as f:
f.write(content)
mm.close()