如何在单独的行上打印最后一行代码?
How can I print the last line of code on a seperate line?
我正在尝试将最后一行代码打印在单独的一行上,因为它总是与微调器打印在同一行上?
我已经试过去掉休眠功能了。
from halo import Halo
import time
from colorama import Fore
name = input("TARGET:\n")
spinner = Halo(text='\nCalling: ' + name, spinner='dots')
spinner.start('\rCalling: ' + name)
time.sleep(5)
print(Fore.GREEN + 'Call Successful! [Internet = POSITIVE]')
我希望打印时最后一行的输出在单独的一行上。
两种选择。在我的系统 (Mac) 上,您的代码似乎没有执行预期的操作,它只是打印大量行而不是微调器。无论如何,这里是我希望工作的选项:
停止微调器
name = input("TARGET:\n")
spinner = Halo(text='\nCalling: ' + name, spinner='dots')
spinner.start('\rCalling: ' + name)
time.sleep(5)
spinner.stop()
print(Fore.GREEN + 'Call Successful! [Internet = POSITIVE]')
添加换行符
name = input("TARGET:\n")
spinner = Halo(text='\nCalling: ' + name, spinner='dots')
spinner.start('\rCalling: ' + name)
time.sleep(5)
print("\n" + Fore.GREEN + 'Call Successful! [Internet = POSITIVE]')
我正在尝试将最后一行代码打印在单独的一行上,因为它总是与微调器打印在同一行上?
我已经试过去掉休眠功能了。
from halo import Halo
import time
from colorama import Fore
name = input("TARGET:\n")
spinner = Halo(text='\nCalling: ' + name, spinner='dots')
spinner.start('\rCalling: ' + name)
time.sleep(5)
print(Fore.GREEN + 'Call Successful! [Internet = POSITIVE]')
我希望打印时最后一行的输出在单独的一行上。
两种选择。在我的系统 (Mac) 上,您的代码似乎没有执行预期的操作,它只是打印大量行而不是微调器。无论如何,这里是我希望工作的选项:
停止微调器
name = input("TARGET:\n")
spinner = Halo(text='\nCalling: ' + name, spinner='dots')
spinner.start('\rCalling: ' + name)
time.sleep(5)
spinner.stop()
print(Fore.GREEN + 'Call Successful! [Internet = POSITIVE]')
添加换行符
name = input("TARGET:\n")
spinner = Halo(text='\nCalling: ' + name, spinner='dots')
spinner.start('\rCalling: ' + name)
time.sleep(5)
print("\n" + Fore.GREEN + 'Call Successful! [Internet = POSITIVE]')