目录结构:

__init__:
from flask import flask
app = Flask(__name__)
if __name__ == '__main__'
app.run()
Run Code Online (Sandbox Code Playgroud)
浏览次数:
from app import app
@app.route('/')
def hello_world():
return 'Hello World!'
Run Code Online (Sandbox Code Playgroud)
我希望有人可以解释我在这里做错了什么 - 我想我不明白如何正确导入app.这导致404.但是当视图移回到__init__一切正常时.
from itertools import combinations_with_replacement
x = 'opo'
v = combinations_with_replacement(x, len(x))
ans = [''.join(map(str, x)) for x in v]
print(" ".join(set(ans)))
Run Code Online (Sandbox Code Playgroud)
我不知道为什么我错过了pop这里的序列.为什么pop不显示,但ppo和opp做的.
预期产出 opp ppp poo ppo ooo opo oop pop
实际产出 opp ppp poo ppo ooo opo oop
import os
import time
torrent_folder = os.listdir(r'C:\users\chris\desktop\torrents')
for files in torrent_folder:
if files.endswith(".torrent"):
print(files + time.ctime(os.path.getatime(files)))
Run Code Online (Sandbox Code Playgroud)
我在运行此脚本时收到文件未找到错误.
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'TORRENT NAME.torrent"
一切正常,直到time.ctime(os.path.getatime(files)
添加到混合中.
我希望脚本为文件夹中的每个文件显示"torrent name""last last modified".
为什么错误引用文件,按名称说它无法找到,我该如何解决?