Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -685,15 +685,16 @@ async def handle_user_input(websocket,key, process, connected):
|
|
685 |
pass
|
686 |
|
687 |
def process_input(user_input, process):
|
|
|
688 |
if process:
|
689 |
try:
|
690 |
-
print(user_input.encode('utf-8').split("&&")[1])
|
691 |
if user_input == 'Ctrl+C':
|
692 |
print('Stopping process')
|
693 |
# Send SIGINT signal to terminate the process gracefully
|
694 |
process.send_signal(signal.SIGINT)
|
695 |
else:
|
696 |
-
process.stdin.write(user_input.encode('utf-8').split("&&")[1] + b'\n')
|
697 |
# process.stdin.flush()
|
698 |
except Exception as e:
|
699 |
print(f"Error writing to process stdin: {str(e)}")
|
|
|
685 |
pass
|
686 |
|
687 |
def process_input(user_input, process):
|
688 |
+
print(user_input.encode('utf-8').split("&&")[1],1)
|
689 |
if process:
|
690 |
try:
|
691 |
+
print(user_input.encode('utf-8').split("&&")[1],2)
|
692 |
if user_input == 'Ctrl+C':
|
693 |
print('Stopping process')
|
694 |
# Send SIGINT signal to terminate the process gracefully
|
695 |
process.send_signal(signal.SIGINT)
|
696 |
else:
|
697 |
+
process.stdin.write(bytes(user_input.encode('utf-8').split("&&")[1], 'utf-8') + b'\n')
|
698 |
# process.stdin.flush()
|
699 |
except Exception as e:
|
700 |
print(f"Error writing to process stdin: {str(e)}")
|