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" ```
{
"id":"4d17c704a7f1ba0db84945f0b608888fe8dbc4281fe0fd1be42f7fcf96932e94",
"pubkey":"171c7c793b55c0662b5cfffbaf6a98ac5d362dec807630963281581241d97e33",
"created_at":1760145659,
"kind":1,
"tags": [
[
"p",
"33f89959a8527ac2dce5fc4bc5172cbcb1aa5914cff8591e5a9617e06ace2513"
],
[
"p",
"171c7c793b55c0662b5cfffbaf6a98ac5d362dec807630963281581241d97e33"
],
[
"e",
"494328b76ed27f0c913421106a5540d916ab3623254304cbdcba4b437e31ad8f",
"",
"reply",
"171c7c793b55c0662b5cfffbaf6a98ac5d362dec807630963281581241d97e33"
],
[
"e",
"83175eebc1616fa819d84accad1b895a1c9bacc5d650bb76e368dd5823e5d758",
"",
"root",
"33f89959a8527ac2dce5fc4bc5172cbcb1aa5914cff8591e5a9617e06ace2513"
],
[
"proxy",
"https://eepy.moe/notes/adp5lc8fpw8d04x2",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://eepy.moe/notes/adp5lc8fpw8d04x2",
"pink.momostr"
],
[
"-"
]
],
"content":"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\nSo:\n```py\nnew_filename = f\"P11000{str(int(old_filename[6:8])-17).zfill(2)}.RW2\"\n```",
"sig":"b3efc7ad9447502bf83d060232387886453766da9d231b4befd763eed4ebbe142c042633d00cd229182afd2b9ebcc8b703a6916986c0a74e799e91df375765b7"
}