SOLVED (Idk how to explain) Python read text file and run func at each number?

question
solved
#1

Hello! Does anybody know how to make python in armory3d read a text file and then run a different function after it reads each number? (Ex: 10201
The 1 would run a function and then the 0 would run a. Different function, then 2 same thing, and then 0 and then 1)

0 Likes

#2

NVM I found it on another forum… lol

Here it is in case anybody finds this:

with open(filename) as f:
while True:
c = f.read(1)
if not c:
print “End of file”
break
print “Read a character:”, c

0 Likes