I have used the following code:
from time import time
import datetime
now = datetime.datetime.now()
Report = now.strftime("%Y%m%d_%H%M%S") + "Prueba llamada de funciones" + ".txt"
modo=0
def llamar_funciones():
if (modo==1):
Alimentaciones_1(Report)
Alimentaciones_2(Report)
else:
print("¿Que ensayos de alimentaciones quieres hacer?")
Ensayo=input()
Nombre_Ensayo= "Alimentaciones_" + Ensayo
print(Nombre_Ensayo)
Nombre_Ensayo(Report)
def Alimentaciones_1(Report):
f = open(Report,"a")
f.write("1.funtzioa")
f.close()
def Alimentaciones_2(Report):
f = open(Report,"a")
f.write("\n2.funtzioa")
f.close()
llamar_funciones()
I get the following error:
TypeError: 'str' object is not callable
How can I call the function 1 or 2 depending on the value of the variable "modo"??