Skip to content

Commit

Permalink
broke, maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
Dainius committed May 29, 2024
1 parent 8306926 commit 629c339
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions GUI/back-end/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ def process():

api_answer = answer + '\n\n'
if '```' in api_answer and '```python' in api_answer:
execute = 'from data_collection import *\n\n' + 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
#
# api_answer += redirected_output.getvalue()
api_answer = execute
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

api_answer += redirected_output.getvalue()
# api_answer = execute
return api_answer.replace('\n', '\n\n')


Expand Down

0 comments on commit 629c339

Please sign in to comment.