SeleniumTest2\func()

csvFileManager.py# 1.导入代码库import csv# 2.指定csv文件所在的路径path = r"C:\Users\51Testing\PycharmProjects\SeleniumTest2\test_data\register_test_cases.csv"# print(path)# 3.打开csv文件file = open(path)# 4.读取csv文件中的内容table = csv.reader(file)# 5.打印csv文件的内容for row in table:    print(row)csvFileManager2.py
import csvimport osdef reader(filename):    list = []    # path = "../test_data/" + filename    base_path = os.path.dirname(__file__) # C:\Users\51Testing\PycharmProjects\SeleniumTest2\func    path = base_path.replace("func","test_data/" + filename)    # C:\Users\51Testing\PycharmProjects\SeleniumTest2\func - func + test_data/ + filename    # C:\Users\51Testing\PycharmProjects\SeleniumTest2\test_data\register_test_cases.csv    # file = open(path)    with open(path) as file:        table = csv.reader(file)        i = 0        for row in table:            if i == 0:                pass            else:                list.append(row)            i = i + 1    return listif __name__ == '__main__':    base_path = os.path.dirname(__file__) # C:\Users\51Testing\PycharmProjects\SeleniumTest2\func    path = base_path.replace("func","test_data/" + "test_result.csv")    file = open(path, 'w')    list = reader('export_user.csv')    for row in list:        print(row[0])        file.write(row[0]+'\n')
————————
csvFileManager.py# 1.导入代码库import csv# 2.指定csv文件所在的路径path = r"C:\Users\51Testing\PycharmProjects\SeleniumTest2\test_data\register_test_cases.csv"# print(path)# 3.打开csv文件file = open(path)# 4.读取csv文件中的内容table = csv.reader(file)# 5.打印csv文件的内容for row in table:    print(row)csvFileManager2.py
import csvimport osdef reader(filename):    list = []    # path = "../test_data/" + filename    base_path = os.path.dirname(__file__) # C:\Users\51Testing\PycharmProjects\SeleniumTest2\func    path = base_path.replace("func","test_data/" + filename)    # C:\Users\51Testing\PycharmProjects\SeleniumTest2\func - func + test_data/ + filename    # C:\Users\51Testing\PycharmProjects\SeleniumTest2\test_data\register_test_cases.csv    # file = open(path)    with open(path) as file:        table = csv.reader(file)        i = 0        for row in table:            if i == 0:                pass            else:                list.append(row)            i = i + 1    return listif __name__ == '__main__':    base_path = os.path.dirname(__file__) # C:\Users\51Testing\PycharmProjects\SeleniumTest2\func    path = base_path.replace("func","test_data/" + "test_result.csv")    file = open(path, 'w')    list = reader('export_user.csv')    for row in list:        print(row[0])        file.write(row[0]+'\n')