Farsi Characters in Python

how to use farsi characters in python console?

10/19/2019 6:54:27 PM

Saman Farrokhi

4 Answers

New Answer


Each character has a unicode, you can find Farsi Characters unicode online, for example: print(u"\u06CC") This will output a Farsi Character, for other characters, you just have to replace the number with the desired one.


if you want to use playground to print for you, do not forget to add the following code on top of the file: import sys import codecs sys.stdout = codecs.getwriter('utf_16')(sys.stdout.buffer, 'strict')


Check this out, i can see some arabic characters(not sure if they're farsi). https://code.sololearn.com/cEeS9k7Hc2Al/?ref=app If that's not what youre looking for, then keep changing the range from 2000-3000 and so on. it may cause a "time limit exceeded error" if range difference is greater than 1000