В этом сообщении говорится, что следующее должно работать:
import os
os.system('cls||clear')
Почему это не работает в следующем коде? Он работает при применении в терминале, но не в скрипте:
import os
def highest_bidder(bidders):
highest = 0
for key in bidders.keys():
if bidders[key] > highest:
high_bidder = {}
high_bidder[key] = bidders[key]
highest = bidders[key]
return high_bidder
bidders = True
bids = {}
while bidders:
name = input("what is your name? ")
bid = int(input("What is yourt bid? "))
bids[name] = bid
more_bidders = input("Are there more bidders (yes, no)? ")
os.system('clear||cls')
if more_bidders == 'no':
bidders = False
high_bidder = highest_bidder(bids)
for key in high_bidder.keys():
print(f'{key} is the high bidder with a bid of {high_bidder[key]}')
Подробнее здесь: https://stackoverflow.com/questions/786 ... hon-spyder
Os.system('cls||clear') не очищает экран в Python Spyder ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение