X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include urdupython/languages/*/*.yaml
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ Programming Language in Urdu, based on Python - اردو میں کوڈ لکھی
- (optional but recommended) Virtual environment, like ```conda``` or ```virtualenv```

## How to Install
### Pip
If you've installed ```pip```, you can download UrduPython from [Test PyPI](https://test.pypi.org/project/urdupython/) using the following command:
```
pip install -i https://test.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 .```
Expand Down
13 changes: 9 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
# References:
# - https://stackoverflow.com/questions/27494758/how-do-i-make-a-python-script-executable

from setuptools import setup
from setuptools import setup, find_packages

files = ["samples/*/*", "languages/*/*.yaml"]

setup(
name='urdupython',
version='0.0.2',
version='0.0.8',
author='Saad Bazaz',
author_email='saadbazaz@hotmail.com',
url='https://github.com/saadbazaz/UrduPython',
packages=['urdupython'],
# packages=['urdupython', 'modes', 'filters', 'languages'],
packages=find_packages(),
package_data = {'urdupython' : files },

entry_points={
'console_scripts': [
'urdupython=urdupython.urdu_python:main',
'اردوپایتھان=urdupython.urdu_python:main'
'اردوپایتھان=urdupython.urdu_python:main',
'اردوپای=urdupython.urdu_python:main'
]
}
Expand Down
1 change: 1 addition & 0 deletions test/test_input.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
input("Enter anything")
88 changes: 88 additions & 0 deletions test/test_shell.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# # client.py
# # import socket

# import subprocess

# from threading import Thread
# from time import sleep


# # s = socket.socket()
# # s.connect(('localhost', 1337))
# popen = None

# def execute(cmd):
# print ("im here")
# popen = subprocess.Popen(cmd,
# stdin=subprocess.PIPE,
# stdout=subprocess.PIPE, universal_newlines=True)
# for stdout_line in iter(popen.stdout.readline, ""):
# yield stdout_line
# popen.stdout.close()
# return_code = popen.wait()
# if return_code:
# raise subprocess.CalledProcessError(return_code, cmd)

# # Example

# def output_loop():
# for path in execute(["python"]):
# print(path, end="")

# # Example
# # await execute("python")
# # print(path, end="")

# if __name__ == "__main__":

# input ("First input")

# thread = Thread(target = output_loop)


# thread.start()
# thread.join()

# sleep(2)
# # popen.communicate(str(input("I am here")).encode('utf-8'))
# popen.stdin.write(str(input("I am here").encode('utf-8')))
# sleep(2)

# print("thread finished...exiting")


# # popen = subprocess.Popen(['python',], stdout=subprocess.PIPE, universal_newlines=True)
# # for stdout_line in iter(popen.stdout.readline, ""):
# # yield stdout_line
# # popen.communicate(str(input()).encode('utf-8'))
# # popen.stdout.close()

# # while (process.wait()):
# # process.communicate(str(input()).encode('utf-8'))



#from subprocess import Popen, PIPE

#p1 = Popen(['python'],stdin=PIPE, stdout=PIPE)
# # p2 = Popen(['sed', '/^$/d'], stdin=p1.stdout, stdout=PIPE)
# # p3 = Popen(['awk', 'NR > 1 { print $2 }'], stdin=p2.stdout, stdout=PIPE)

#p1.stdin.write("print('hello world!')".encode('utf-8'))

#p1.wait()
# stdout, _ = p1.communicate()





#!/usr/bin/env python3
import time
#from subprocess import Popen, PIPE
import subprocess

proc = subprocess.Popen("python", stdin=subprocess.PIPE)
#while (proc.poll() is None):
proc.stdin.write("print('hello world!!')".encode('utf-8')) # etc
#time.sleep(4)
1 change: 0 additions & 1 deletion urdupython/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
Python, but in Urdu.
"""

__version__ = "0.1.1"
__author__ = 'Saad Bazaz'
__credits__ = 'Grayhat'
__url__ = 'https://github.com/saadbazaz/UrduPython'
Expand Down
Empty file.
Empty file.
Empty file.
Empty file added urdupython/samples/__init__.py
Empty file.
Empty file.
File renamed without changes.
Empty file.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions urdupython/urdu_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def run_module(
'return': True,
},
):
mod = importlib.import_module("urdupython.modes."+mode)
mod = importlib.import_module(".modes."+mode, package='urdupython')
return mod.run(args, code)

def main():
Expand All @@ -44,7 +44,7 @@ def main():
default="lex", required = False,
help = "The mode to use to translate the code.")
ap.add_argument("-d", "--dictionary",
default="./languages/ur/ur_native.lang.yaml", required = False,
default=os.path.join(SCRIPTDIR, 'languages/ur/ur_native.lang.yaml'), required = False,
help = "The dictionary to use to translate the code.")

ap.add_argument("-r", "--reverse",
Expand Down
X Tutup