From the terminal
How to Use
- Create a new file in a folder.
- Write some Urdu code in this new file. The mappings are as following:
Python (original) | 🇵🇰 Ur |
---|---|
print | لکھو |
if | اگر |
elif | ورنہاگر |
else | ورنہ |
while | جبتک |
for | جو |
in | اندر |
input | داخله |
break | توڑ |
continue | جاری |
pass | گزر |
True | حق |
False | باطل |
is | ہے |
class | طبقه |
def | وضح |
init | ابتدا |
self | خود |
return | واپس |
string | ستلی |
str | ستل |
append | شامل |
pop | نکل |
and | اور |
or | یا |
all | سب |
any | کوئ |
None | ندارد |
, | ، |
. | ۔ |
0 | ۰ |
1 | ۱ |
2 | ۲ |
3 | ۳ |
4 | ۴ |
5 | ۵ |
6 | ۶ |
7 | ۷ |
8 | ۸ |
9 | ۹ |
Find the whole list of keywords for Urdu here. Don't worry if you can't find a mapping, you can also use English Python!
An example of a Hello World Program:
print ("Hello world!")
would be
لکھو ("Hello world!")
There are many more sample codes available here
- Open a Terminal in the folder of this file.
- Run the code in one command:
universalpython <NAME_OF_YOUR_FILE>
For more help, run universalpython --help
. For better understanding, do run the sample code files in the "samples" folder.
Guide
For macOS
- Use TextEdit (default text editor) to write Urdu code.
- Activate right-to-left typing through Menu: Format->Text->Writing Direction->Right-to-Left
For Windows
- Download and install Notepad++.
- Right click and activate RTL (Right-to-left).
For Linux
Open gEdit (or any similar text-editing program), and start coding right away.