I have a script that reads user-queried values from a file, then writes just those values to a text file. The text file is then further manipulated in ModelBuilder. I want the user to be able to pick the original file. I added a parameter called INPUTFILE to the script, with type equal to "File" and Direction equal to "Input". In the script, that variable is called. This is the first several lines of the script:
import struct
import numpy as np
import matplotlib.pyplot as plt
fid = open(INPUTFILE,'rb')
When i run the model, it fails at the line "fid = open..." and gives this error message: "NameError: name 'INPUTFILE' is not defined"
But it is an input to the script in the model I built. Its a variable, when you run the Model, it is one of the things you set. you set it by browsing to the file you want the script to read.
What do i have to do to get the script to accept the parameter?