I have a function that retrieves a list of files from two separate directories (file folders) that the user chooses in my Tkinter GUI window. The list of all the files in both of the directories prints in the visual studio code terminal just fine, but how do I get the list of files from these two directories to print to a new text file?
Input_1 = entry_field1.get() #Retrieving what the user inputed into entry field 1.
Input_2 = entry_field2.get() #Retrieving what the user inputed into entry field 2.
file_list_1=os.listdir(Input_1) #Listing the files from directory 1.
file_list_2=os.listdir(Input_2) #Listing the files from directory 2.
print (file_list_1) #Printing the files in the terminal window.
print (file_list_2) #Printing the files in the terminal window.