func _ready():
read("res://words.txt", "a")
func read(p_path, p_starts_with):
var file = File.new()
var err = file.open(p_path, file.READ)
if err != OK:
print("Can't read ", p_path)
return
while !file.eof_reached():
var line = file.get_line()
if line.find(".") < 0:
continue
var split = Array(line.split("."))
var word = split[1]
if word.begins_with(p_starts_with):
print(word)
file.close()
thank you very much
Immanity | 2019-09-13 16:45
when i type the code you send, I didn’t get any output but it didn’t say it’s an error
what do you think is the problem?