请帮助,我收到此错误:
with open('Data/language.json') as settings_file:
TypeError: Required argument 'flags' (pos 2) not found
Run Code Online (Sandbox Code Playgroud)
我的代码是:
import json
with open('Data/settings.json') as settings_file:
Settings = json.load(settings_file)
Run Code Online (Sandbox Code Playgroud) 我现在拥有的代码:
import os
Tree = {}
Tree = os.listdir('Dir')
Run Code Online (Sandbox Code Playgroud)
>>> print(Tree)
['New Folder', 'Textfile1.txt', 'Textfile2.txt']
Run Code Online (Sandbox Code Playgroud)
那不会打印出子目录中的文件。(新文件夹是一个子目录)。
我的问题是,如何输出目录中的所有文件以及子目录中的文件?
为什么会抛出"未捕获的TypeError:非法调用"?
function Game () {
this.reqAnimFrame = window.requestAnimationFrame;
this.gameLoop = function () {
this.reqAnimFrame(this.gameLoop); // It's thrown on this line
};
}
var game = new Game();
game.gameLoop();
Run Code Online (Sandbox Code Playgroud)