I am very sorry because my English is not very good，In order to better describe this problem,I want to show this problem with pictures, but I don’t know how to send it to,I posted a photo on Twitter. In the photo, you can see that not all the characters are intercepted. I want to get all the Chinese characters. If it is convenient for you, I hope you can take a look.I used examples\keyboard\ KB Info.py in pythonista，thank youlink twitter url
For doing 1:1 character replacements, maketrans plus translate makes for clean code. You list all the characters you are replacing in one string, all the replacements in the second, and all the characters to delete in the third argument to maketrans.
Damn, I never knew about this. Now I can finally replace my for c in (...): s = s.replace(c, "") loops. My code may finally look acceptable.
Btw thank you for pythonista, it was the one thing that actually got me started with programming and made me realize how much I love it. It’s been my hobby for the last 5 months overtaking my love for video games😂
Good point about this only getting called when keyboard is first shown. Ideally, you would attach textfield did_begin_editing delegates that scroll the textfield to the top of the scroll view. Even if you don't own those, you could basically store the original delegate within your custom delegate, and then call the original delegate methods after you scroll into place.