GithubHelp home page GithubHelp logo

saadbazaz / urdupython Goto Github PK

View Code? Open in Web Editor NEW
32.0 1.0 4.0 317 KB

Programming Language in Urdu, based on Python - اردو میں کوڈ لکھیں

Python 85.39% Shell 14.61%
urdu-language python programming-language translation

urdupython's Introduction

⚠️ Development has shifted to UniversalPython, we recommend using it as it has Urdu support built-in. Use this for learning purposes if you wish.

UrduPython

Ever had that random thought of programming in Urdu? Well, you're at the right place.

Programming Language in Urdu, based on Python - اردو میں کوڈ لکھیں

Pre-requisites

  • Python 3+
  • Pip
  • (optional but recommended) Virtual environment, like conda or virtualenv

Why?

Just look at how beautiful it is :)

Side by Side Comparison of UrduPython vs Python

Side by side comparison of UrduPython vs Python

It works!

Running UrduPython code

How to Install

Pip

If you've installed pip, you can install UrduPython from Test PyPI using the following command:

pip install -i https://test.pypi.org/pypi/ --extra-index-url https://pypi.org/simple  urdupython

Source

  1. Download this repo as a ZIP, or clone it via Git.
  2. Open the repo's folder in your Terminal.
  3. Run pip install -e .

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 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: urdupython <NAME_OF_YOUR_FILE>

For more help, run urdupython --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.

Tests

Platform(s) tested on

  • macOS Big Sur 11.1
  • Termux (Android)
  • Ubuntu 20.04.3 LTS

urdupython's People

Contributors

saadbazaz avatar zohairhadi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

urdupython's Issues

How to solve imports?

Preface

Python imports are interesting.

They can happen in many forms. For example:

import os
os.open()

makes os available in the global namespace, so you can call the function it contains as os.open(). In this case, you cannot call open() directly.

Another way is:

from os import open
open()

This now makes open available in the global namespace, hence you can call it directly.

Also, imports in Python can happen anywhere in the code, so when they do happen again, they override the previous ones.

e.g.

from os import open
.
.
# some code...
.
.
from numpy import open # just an example

The second import's open will now become the global open.


How to solve this in UrduPython?

There are some methods which I'm contemplating.
Ideas for module imports

Do nothing

Pros:

  • Works out-of-the-box
  • No extra work needed
  • Always compatible

Cons:

  • Hurts user experience (mix of English and Urdu)

Use global translations

e.g. numpy.open and os.open -> Open == کھولو in both scenarios, using a global dictionary

Pros:

  • One word fits all
  • Minimizes effort

Cons:

  • Compatibility issues (Example?? Idk)
  • Meaning may vary across libraries, e.g. open might mean open a file (کھولو) or something which is already opened (کھلا). Depends on what the function does. So meanings might become jumbled.

Use package-specific translations

e.g. numpy would have it's own list of translations, nested translations, etc

Pros:

  • Separate meaning for each package

Cons:

  • Needs runtime checking, so compilation step might not work
  • What if an import happens later?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.