I printed a specific list from csv file and tried to add a function after the print.
If I do not add the function, the list will be printed in whole and accurately.
If I add the function, only the first line of the list is printed but the function is still able to run after the incomplete list is printed.
I tried to use line separator but it doesn't work as intended.
for line in menu_csv_reader: #looks into menu file
print(line[0]) #print menu
Back()
Output: - Incomplete list (only first line printed) - Back() function able to run
for line in menu_csv_reader: #looks into menu file
print(line[0]) #print menu
print('\n')
print('\n')
print('\n')
print('\n')
Back()
Output: - Incomplete list (only first line printed) - Then skips 4 lines - Then Back() function able to run
WITHOUT BACK() FUNCTION
for line in menu_csv_reader: #looks into menu file
print(line[0]) #print menu
Output: - Complete list
WITHOUT BACK() FUNCTION
for line in menu_csv_reader: #looks into menu file
print(line[0]) #print menu
print('\n')
print('\n')
print('\n')
print('\n')
Output: - Complete list - 4 lines skipped per entry from list;
e.g: A
B
C
Expected result:
for line in menu_csv_reader: #looks into menu file
print(line[0]) #print menu
Back()
Output: - Complete list printed - Back() function able to run after complete list is printed