Skip to content

Commit

Permalink
fix11
Browse files Browse the repository at this point in the history
  • Loading branch information
Dainius Kirsnauskas committed May 29, 2024
1 parent d50954d commit 74d9053
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions GUI/back-end/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ def process():
api_answer = answer + '\n'
if '```' in api_answer:
execute = api_answer[api_answer.find('```python') + 9:api_answer.rfind('```')]
old_stdout = sys.stdout
redirected_output = sys.stdout = StringIO()
exec(execute)
sys.stdout = old_stdout
# old_stdout = sys.stdout
# redirected_output = sys.stdout = StringIO()
# exec(execute)
# sys.stdout = old_stdout

api_answer += redirected_output.getvalue()
# api_answer += redirected_output.getvalue()
else:
api_answer += 'nothing to execute'
return api_answer
Expand Down

0 comments on commit 74d9053

Please sign in to comment.