You can use msvcrt.getch()
to get the key, and then map that to a value in a dictionary:
from msvcrt import getch
chars = {b'f': 'ph'} # You could easily extend this dictionary.
while True:
z = getch()
if z in chars:
print(chars[z])