Измените end
, чтобы print
не добавлял символ новой строки, и убедитесь, что flush
оператор вынуждает его печатать перед продолжением.
import time
print("Hello world!", end=" ", flush=True)
time.sleep(1)
print ("I just stopped for 1 sec!!", end=" ", flush=True)
time.sleep(1)
print ("But I want to Marge these lines. How?")
Выход:
Hello world! I just stopped for 1 sec!! But I want to Marge these lines. How?