Skip to content

Commit 8e245df

Browse files
committed
Call relative mode package instead of from main package
1 parent cb7c471 commit 8e245df

4 files changed

Lines changed: 90 additions & 2 deletions

File tree

test/test_input.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
input("Enter anything")

test/test_shell.py

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# # client.py
2+
# # import socket
3+
4+
# import subprocess
5+
6+
# from threading import Thread
7+
# from time import sleep
8+
9+
10+
# # s = socket.socket()
11+
# # s.connect(('localhost', 1337))
12+
# popen = None
13+
14+
# def execute(cmd):
15+
# print ("im here")
16+
# popen = subprocess.Popen(cmd,
17+
# stdin=subprocess.PIPE,
18+
# stdout=subprocess.PIPE, universal_newlines=True)
19+
# for stdout_line in iter(popen.stdout.readline, ""):
20+
# yield stdout_line
21+
# popen.stdout.close()
22+
# return_code = popen.wait()
23+
# if return_code:
24+
# raise subprocess.CalledProcessError(return_code, cmd)
25+
26+
# # Example
27+
28+
# def output_loop():
29+
# for path in execute(["python"]):
30+
# print(path, end="")
31+
32+
# # Example
33+
# # await execute("python")
34+
# # print(path, end="")
35+
36+
# if __name__ == "__main__":
37+
38+
# input ("First input")
39+
40+
# thread = Thread(target = output_loop)
41+
42+
43+
# thread.start()
44+
# thread.join()
45+
46+
# sleep(2)
47+
# # popen.communicate(str(input("I am here")).encode('utf-8'))
48+
# popen.stdin.write(str(input("I am here").encode('utf-8')))
49+
# sleep(2)
50+
51+
# print("thread finished...exiting")
52+
53+
54+
# # popen = subprocess.Popen(['python',], stdout=subprocess.PIPE, universal_newlines=True)
55+
# # for stdout_line in iter(popen.stdout.readline, ""):
56+
# # yield stdout_line
57+
# # popen.communicate(str(input()).encode('utf-8'))
58+
# # popen.stdout.close()
59+
60+
# # while (process.wait()):
61+
# # process.communicate(str(input()).encode('utf-8'))
62+
63+
64+
65+
#from subprocess import Popen, PIPE
66+
67+
#p1 = Popen(['python'],stdin=PIPE, stdout=PIPE)
68+
# # p2 = Popen(['sed', '/^$/d'], stdin=p1.stdout, stdout=PIPE)
69+
# # p3 = Popen(['awk', 'NR > 1 { print $2 }'], stdin=p2.stdout, stdout=PIPE)
70+
71+
#p1.stdin.write("print('hello world!')".encode('utf-8'))
72+
73+
#p1.wait()
74+
# stdout, _ = p1.communicate()
75+
76+
77+
78+
79+
80+
#!/usr/bin/env python3
81+
import time
82+
#from subprocess import Popen, PIPE
83+
import subprocess
84+
85+
proc = subprocess.Popen("python", stdin=subprocess.PIPE)
86+
#while (proc.poll() is None):
87+
proc.stdin.write("print('hello world!!')".encode('utf-8')) # etc
88+
#time.sleep(4)

urdupython/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
Python, but in Urdu.
66
"""
77

8-
__version__ = "0.1.1"
98
__author__ = 'Saad Bazaz'
109
__credits__ = 'Grayhat'
1110
__url__ = 'https://github.com/saadbazaz/UrduPython'

urdupython/urdu_python.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def run_module(
2424
'return': True,
2525
},
2626
):
27-
mod = importlib.import_module("urdupython.modes."+mode)
27+
mod = importlib.import_module("modes."+mode)
2828
return mod.run(args, code)
2929

3030
def main():

0 commit comments

Comments
 (0)