[Python] WHY IT DOES NOT FIND THE FILE?

Discussão em 'Python' iniciado por Stack, Junho 10, 2025.

  1. Stack

    Stack Membro Participativo

    I installed an application for coding called acode and tried to do a simple log-in system but idk why even if the file for data is in the same folder it says such file doesn't exist.

    Here is the code

    def varification(username, password, filepath):

    #try:
    password = password+"\n"
    info = open(filepath, 'r')
    print(info)
    user_data = info.readlines()
    print(user_data)

    #except Exception:
    #print(Exception)


    varification("Mami404", "pass12343", "app/data.txt")
    varification("Alex234", "awS303", "data.txt")
    varification("wasp9", "12sd3", "data.txt")


    and here is the data file

    username,password
    Mami404,Osmuhanmmed044_
    Alex234,awS303


    the data file and the python file are in the same folder (app) and i have tried every method from getting its file path to only writing its name and again i am on an android device.

    Continue reading...

Compartilhe esta Página