Код: Выделить всё
def menuController(menuName:str, options:list):
print(options)
time.sleep(0.01)
menuPosition = 0
for i in range(len(options)):
if menuPosition == i:
options[i] = "*"+options[i]+"* "
else:
options[i] = " "+options[i]+" "
print(options[i], end="")
menuController("ra", ["one", "two", "three", "four"])
Код: Выделить всё
['one', 'two', 'three', 'four']
Однако, когда я добавляю print("") после вызова MenuController, он выводит это:
Код: Выделить всё
['one', 'two', 'three', 'four']
*one* two three four
Почему вторая строка выводится только тогда, когда она пуста? после?
Можно ли это исправить с помощью какого-то сброса вывода в определении функции?
Подробнее здесь: https://stackoverflow.com/questions/790 ... g-in-debug