Skip to main content

From the terminal

How to Use

  1. Create a new file in a folder.
  2. 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

  1. Open a Terminal in the folder of this file.
  2. 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.