Function error - name not defined (python) :     def getDetail(username, password):

        accountFile = open("accounts.txt", 'r')
        readFile = accountFile.readline()

        user = readFile.split(",")
        username = user[0]
        password = user[1]

    getDetail(password)

    I get the error:
    File "C:/Users/-/Desktop/-/quiz.py", line 151, in <module>
    getDetail(password)
NameError: name 'password' is not defined

How else could I define it? 
I am trying to split the two texts into two individual strings and access them through user[0] and user[1]. I've stored these in username and password, the parameters of the function. I want to do this so I can access the username and the password later on.