Is there a module for converting the letters of a AZERTY keyboard in a QWERTY keyboard letters and vice versa?
To do this it must also be able to detect the keyboard type, is it possible?
Example: ‘data’. to_qwerty () -> ‘dqtq’ or ‘dqtq’. to_azerty () -> ‘data’
Or a simple solution without having to type all the letters of each letter?
Thank you in advance.
If you just want to convert one string to another, that’s pretty simple:
(it does however require you to specify how they translate from one to the other)
or
… or any number of ways to do this in a few lines.
If you want to get fancy and do something similar to what you did in your question (call a method on a string and have it converted) then you can have a look at the codecs module that will let you do that. Takes a bit more work, but you would be able to do something like this
The big effort is probably getting the data on how to translate everything.
The easiest thing is probably to make sure you have the right keymap before starting to type. 🙂