Im a beginner at Python and I have written a program consisting of three functions and now Im stuck when I need to 'call' on them at the bottom of the program. In the 1st and 2nd functions I get some information and saving it to a file, but the important thing is what I get from fcn3. Fcn2 needs the result from fcn1 and fcn3 needs the result from fcn2. So they all rely on each other(thats why im writing them to a new file, to save and to reuse). It looks something like this:
def fcn1():
do some stuff
write result to a new file
def fcn2():
do some stuff
write result to a new file
def fcn3():
do some stuff
write result to a new file
return result
#___________main___________
f=open('filename','r'
fread=f.readlines()
for f in fread
fcn1()
fcn2()
res=fcn3()
res
All the functions seem to work, but not when I run the entire program called prob.py. I have several files I want to go through and that I need f to open. How do I automate things? Each filename has same directory, but differences in an ID nr.