Dec-13-2020, 10:21 AM
from tkinter.filedialog import askopenfilename from pathlib import Path import sys import csv def get_filename(): filename = Path(askopenfilename(filetypes=[("CSV files","*.csv")])) return filename def read_csv_file(filename): parts = list(filename.parts) if __name__ == '__main__': #This executes the code! read_csv_file(get_filename())If I run the above code, I have the
Unused variable 'parts'pylint(unused-variable)
message. I do understand the parts variable is not defined, but how can it run anyway in the code Larz60 provided me? I can't find the variable parts
defined in the code anyway...