from flask import Flask, render_template
import time
import os
app = Flask(__name__)
movies = [
{'title': 'My Neighbor Totoro', 'year': '1988'},
{'title': 'Dead Poets Society', 'year': '1989'},
{'title': 'A Perfect World', 'year': '1993'},
{'title': 'Leon', 'year': '1994'},
{'title': 'Mahjong', 'year': '1996'},
{'title': 'Swallowtail Butterfly', 'year': '1996'},
{'title': 'King of Comedy', 'year': '1999'},
{'title': 'Devils on the Doorstep', 'year': '1999'},
{'title': 'WALL-E', 'year': '2008'},
{'title': 'The Pork of Music', 'year': '2012'},
]
fileDict={'title': 'The Pork of Music', 'year': '2012'}
fileList=[]
fileList.append(fileDict)
print(fileList)
num=0
path = "F:\\PythonWebPYCode\\mma"
listS = os.listdir(path)
print(listS)
print("*************************")
for i in listS:
fileDict['title']=i
fileDict['year']=time.ctime(os.path.getatime(i))
print(fileDict)
fileList.append(fileDict.copy())
print("&&&&&&&&&&&&&&&&&&&&&&&&&&&&")
print(fileList)
@app.route('/')
def index():
return render_template('index.html', name=name, movies=fileList)
if __name__ == '__main__':
app.run()