简介
uv 高效的包管理工具,替代pip。用rust编写。
安装
sh
pip install uv
使用
demo
- 创建虚拟环境(快速)
cpp
uv venv venv
Using Python 3.11.1 interpreter at D:\env\python311\python.exe
Creating virtualenv at: venv
Activate with: venv\Scripts\activate
py
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def home():
return 'Hello, Flask!'
@app.route('/about')
def about():
return render_template('about.html', title='About Us', content='This is a simple Flask demo.')
if __name__ == '__main__':
app.run(debug=True)
- templates/about.html
html
<html>
<head>
<title>{{ title }}</title>
</head>
<body>
<h1> {{ title }} </h1>
<p> {{ content }} </p>
</body>
</html>
运行
python app.py