Update app.py
Browse files
app.py
CHANGED
@@ -230,10 +230,13 @@ def create_file(filename, prompt, response, should_save=True):
|
|
230 |
base_filename, ext = os.path.splitext(filename)
|
231 |
has_python_code = bool(re.search(r"```python([\s\S]*?)```", response))
|
232 |
if ext in ['.txt', '.htm', '.md']:
|
233 |
-
with open(f"{base_filename}-Prompt.txt", 'w') as file:
|
234 |
-
|
235 |
-
with open(f"{base_filename}-Response.md", 'w') as file:
|
|
|
|
|
236 |
file.write(response)
|
|
|
237 |
if has_python_code:
|
238 |
python_code = re.findall(r"```python([\s\S]*?)```", response)[0].strip()
|
239 |
with open(f"{base_filename}-Code.py", 'w') as file:
|
|
|
230 |
base_filename, ext = os.path.splitext(filename)
|
231 |
has_python_code = bool(re.search(r"```python([\s\S]*?)```", response))
|
232 |
if ext in ['.txt', '.htm', '.md']:
|
233 |
+
#with open(f"{base_filename}-Prompt.txt", 'w') as file:
|
234 |
+
# file.write(prompt.strip())
|
235 |
+
#with open(f"{base_filename}-Response.md", 'w') as file:
|
236 |
+
# file.write(response)
|
237 |
+
with open(f"{base_filename}.md", 'w') as file:
|
238 |
file.write(response)
|
239 |
+
|
240 |
if has_python_code:
|
241 |
python_code = re.findall(r"```python([\s\S]*?)```", response)[0].strip()
|
242 |
with open(f"{base_filename}-Code.py", 'w') as file:
|