我想在同一目录中打开任何 .txt文件.
在红宝石中我能做到
File.open("*.txt").each do |line|
puts line
end
Run Code Online (Sandbox Code Playgroud)
在python我不能这样做它会给出一个错误
file = open("*.txt","r")
print(file.read())
file.close()
Run Code Online (Sandbox Code Playgroud)
它给出了一个错误无效的参数.
那有什么办法吗?