I am making a basic comand line program that does conversions in python and i want to add more conversions to it without scripting. so you can command the program something like
(you command the PC) add new_conversion
(The PC ask) name the new_conversion: *here you enter your function name*
ect.
then in the end you get a function like this:
def kiloMile(n, km):
if type(n) != int:
return "Error 1", "Unexpected variable."
elif km == "k":
mile = n * 0.621371
return mile
elif km == "m":
kilometers = n * 1.60934
return kilometers
else:
return "Error 1", "Unexpected variable."
is this posible to edit the program through the program.
thanks in advance
LTJR