ChatDev/WareHouse/Article_pic_DefaultOrganization_20231023003059/main.py
2023-10-23 10:54:37 +08:00

19 lines
728 B
Python

'''
This is the main file that will run our application.
'''
from flask import Flask, render_template, request
from article_processor import ArticleProcessor
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
article = request.form['article']
processor = ArticleProcessor(article)
markdown = processor.process_article()
return render_template('result.html', markdown=markdown)
return render_template('index.html')
if __name__ == "__main__":
try:
app.run(debug=True)
except ImportError:
print("Error: The watchdog library is not installed. Please install it by running 'pip install watchdog' in your terminal.")