Hello, I am trying to make a program that takes input on the command-line and returns the result to textfile.
The problem is that I get the error
TypeError: can only concatenate tuple (not "str") to tuple
WARNING: Failure executing file: <write_cml_function.py>
from scitools.all import *
# imports numpy and StringFunction(turns f into python
# function)
import sys
f = sys.argv[1] # function
f = StringFunction(f)
a = int(sys.argv[2]) # left bounder
b = int(sys.argv[3]) # right bounder
n = int(sys.argv[4])
x = linspace(a,b,n)
resultat = f(x)
s = open("resultat.txt","w")
for i in range(0,n,1):
line = x[i], resultat
s.write(line + "\n")
s.close()