Join Nostr
2025-10-11 01:20:59 UTC
in reply to

Charlotte on Nostr: i’d take the slice of string[n:n+2] and turn that into an integer, subtract 17, ...

i’d take the slice of string[n:n+2] and turn that into an integer, subtract 17, turn it back into a string, and pad it with zeros using zfill
So:
```py
new_filename = f"P11000{str(int(old_filename[6:8])-17).zfill(2)}.RW2"
```