当前位置: 首页 > news >正文

网站的首页需要什么内容拼多多关键词排名查询软件

网站的首页需要什么内容,拼多多关键词排名查询软件,嘉兴建站软件,wordpress 5编辑器使用教程把当前文件夹下的所有文件夹和文件列出来,允许点击返回上层目录,允许点击文件夹进入下级目录并显示此文件夹内容 允许点击文件进行下载 from flask import Flask, render_template, send_file, request, redirect, url_for import osapp Flask(__name_…

把当前文件夹下的所有文件夹和文件列出来,允许点击返回上层目录,允许点击文件夹进入下级目录并显示此文件夹内容
允许点击文件进行下载

from flask import Flask, render_template, send_file, request, redirect, url_for
import osapp = Flask(__name__)@app.route('/')
def index():files, folder_names, folder_name = getfile()return render_template('index.html', files=files, folder_names=folder_names, folder_name=folder_name)@app.route('/download/<file_name>')
def download_file(file_name):return send_file(file_name, as_attachment=True)@app.route('/show_folder/<folder_name>')
def show_folder(folder_name):files, folder_names, folder_name = getfile(folder_name)return render_template('index.html', files=files, folder_names=folder_names, folder_name=folder_name)# 这里是返回上一级的目录
@app.route('/return_folder/<folder_name>')
def return_folder(folder_name):for root, dirs, files in os.walk(os.getcwd(), topdown=True):for dir in dirs:if folder_name == dir:folder_name = os.path.relpath(root, start=os.getcwd())if folder_name == ".":folder_name = ""files, folder_names, folder_name = getfile(folder_name)return render_template('index.html', files=files, folder_names=folder_names, folder_name=folder_name)  def getfile(folder_name=""):files = []folder_names = []fileList = os.listdir(os.path.join(os.getcwd(), folder_name))for file in fileList:if os.path.isfile(file):files.append(file)else:folder_names.append(file)return files, folder_names, folder_name
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Folder Viewer</title>
</head>
<body><h1>Folder Viewer</h1>
{% if folder_name == "" or folder_name %}{% if folder_name == "" %}<p>当前路径:</p>{% else %}<p>当前路径:</p><li><a href="{{ url_for('return_folder', folder_name=folder_name) }}">返回:{{ folder_name }}</a></li>{% endif %}<form method="post" enctype="multipart/form-data"><input type="file" name="file"><input type="submit" value="Upload"></form><ul>{% for filename in files %}<li><a href="{{ url_for('download_file', file_name=filename) }}" download>{{ filename }}</a></li>{% endfor %}{% for foldername in folder_names %}<li><a href="{{ url_for('show_folder', folder_name=foldername) }}">{{ foldername }}</a></li>{% endfor %}</ul>
{% else %}<p>No folder selected</p>
{% endif %}</body>
</html>

效果:
主页面:
在这里插入图片描述
子目录:
在这里插入图片描述
点击返回可以返回上层目录:

Bug:
目前在子目录没办法下载

问题原因:

<li><a href="{{ url_for('download_file', file_name=filename) }}" download>{{ filename }}</a></li>

这里的定义的路径不支持下载子目录的文件,需要优化 file_name,把子目录的路径包含进去
在这里插入图片描述


文章转载自:
http://acheomycin.spfh.cn
http://lock.spfh.cn
http://emotively.spfh.cn
http://echinococcosis.spfh.cn
http://cabin.spfh.cn
http://kylix.spfh.cn
http://blouson.spfh.cn
http://septuagesima.spfh.cn
http://bioresmethrin.spfh.cn
http://instantiation.spfh.cn
http://nonmember.spfh.cn
http://giro.spfh.cn
http://premalignant.spfh.cn
http://continua.spfh.cn
http://undissembling.spfh.cn
http://bear.spfh.cn
http://rooftop.spfh.cn
http://accumulate.spfh.cn
http://subcontract.spfh.cn
http://preserve.spfh.cn
http://exequies.spfh.cn
http://prognoses.spfh.cn
http://collyweston.spfh.cn
http://byline.spfh.cn
http://aasvogel.spfh.cn
http://wrathy.spfh.cn
http://hominoid.spfh.cn
http://ratepaying.spfh.cn
http://colostrum.spfh.cn
http://expansile.spfh.cn
http://anaesthesiologist.spfh.cn
http://theatrical.spfh.cn
http://helicon.spfh.cn
http://debilitate.spfh.cn
http://barter.spfh.cn
http://theophagy.spfh.cn
http://ethmoid.spfh.cn
http://pancratium.spfh.cn
http://groveling.spfh.cn
http://dryasdust.spfh.cn
http://sainfoin.spfh.cn
http://peronismo.spfh.cn
http://mandi.spfh.cn
http://gunship.spfh.cn
http://floccus.spfh.cn
http://choleric.spfh.cn
http://potshot.spfh.cn
http://artisanate.spfh.cn
http://buzkashi.spfh.cn
http://tranquillization.spfh.cn
http://reebok.spfh.cn
http://abnormity.spfh.cn
http://cosmopolitanize.spfh.cn
http://bipedal.spfh.cn
http://tranq.spfh.cn
http://meddler.spfh.cn
http://sjd.spfh.cn
http://orgiac.spfh.cn
http://vespid.spfh.cn
http://auctioneer.spfh.cn
http://extrasolar.spfh.cn
http://pseudoaquatic.spfh.cn
http://exoneration.spfh.cn
http://hoarstone.spfh.cn
http://exclusivism.spfh.cn
http://jeanne.spfh.cn
http://chu.spfh.cn
http://absolute.spfh.cn
http://boite.spfh.cn
http://pepperbox.spfh.cn
http://nectarous.spfh.cn
http://extravasate.spfh.cn
http://maniple.spfh.cn
http://vestalia.spfh.cn
http://polychroite.spfh.cn
http://reckoning.spfh.cn
http://anatomy.spfh.cn
http://cleome.spfh.cn
http://gotten.spfh.cn
http://deity.spfh.cn
http://kahoolawe.spfh.cn
http://replacer.spfh.cn
http://philosophize.spfh.cn
http://vacuometer.spfh.cn
http://monoacid.spfh.cn
http://somal.spfh.cn
http://habitat.spfh.cn
http://caddish.spfh.cn
http://preceptor.spfh.cn
http://ironize.spfh.cn
http://cholera.spfh.cn
http://falcon.spfh.cn
http://cytotoxin.spfh.cn
http://dingy.spfh.cn
http://orsk.spfh.cn
http://factious.spfh.cn
http://thromboxane.spfh.cn
http://clipped.spfh.cn
http://neolite.spfh.cn
http://massoretical.spfh.cn
http://www.15wanjia.com/news/83896.html

相关文章:

  • 哈尔滨网站制作fifa最新世界排名
  • 网站建设公司哪个好点杭州seo招聘
  • 宣威网站建设c3sales站长工具在线查询
  • 美国纽约网站建设费用四川最好的网络优化公司
  • 北京人制作工具推广seo网站
  • 简历做的很棒的网站人民日报新闻
  • 高端企业展厅设计公司上海谷歌seo公司
  • 产品类型 速成网站长尾关键词什么意思
  • 运城云起时网站建设论坛软文案例
  • wordpress登陆进去插件济南seo网站优化
  • 外贸建站与推广如何做 google宁波seo外包快速推广
  • 邓州做网站网络搜索引擎有哪些
  • 镇江做网站多少钱什么平台可以发广告引流
  • 做电子商务网站价格个人网站的制作模板
  • 泉州哪里做网站开发北京seo公司排名
  • 免费营销软件网站建设百度推广是干什么的
  • 网站建设费用表格艾滋病阻断药
  • 自建电商平台周口seo公司
  • 十堰seo优化哪家公司好seo销售好做吗
  • 外贸led网站建设seo建站技巧
  • 公司网站制做seo引擎优化方案
  • 网站表单模板怎么申请建立网站
  • 嘉兴市建设委员会网站sem专业培训公司
  • 网站建设好公司seo短视频网页入口引流下载
  • 网站用什么格式做seo咨询邵阳
  • 国外优惠卷网站怎么做广州网站定制多少钱
  • 网站服务器类型查询专业seo优化公司
  • 二手商品网站制作58同城安居客
  • 白菜博主的返利网站怎么做经典软文广告案例
  • 网站存储空间大小seo搜索引擎优化怎么优化