本文整理匯總了Python中console.clear方法的典型用法代碼示例。如果您正苦於以下問題:Python console.clear方法的具體用法?Python console.clear怎麽用?Python console.clear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類console
的用法示例。
在下文中一共展示了console.clear方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: draw_splash_screen
# 需要導入模塊: import console [as 別名]
# 或者: from console import clear [as 別名]
def draw_splash_screen(self, user_mode):
try:
import console
console.clear()
except ImportError:
pass
if user_mode == 'mainnet':
print '*****************'
print '** BITCOINISTA **'
print '*****************'
print ''
elif user_mode == 'demo':
print '*****************************'
print '** BITCOINISTA (DEMO MODE) **'
print '*****************************'
print ''
elif user_mode == 'testnet':
print '***************************'
print '** BITCOINISTA (TESTNET) **'
print '***************************'
print ''
else:
raise Exception('Unsupported user mode ' + user_mode)
示例2: colorhelp
# 需要導入模塊: import console [as 別名]
# 或者: from console import clear [as 別名]
def colorhelp():
print ""
console.set_font("Arial-BoldMT",16)
print "Commands: "
console.set_font()
time.sleep(0.3)
print "Rainbow - rainbow | r1"
time.sleep(0.3)
print "Rainfade - rainfade | r1"
time.sleep(0.3)
print "Blood - blood | b1"
time.sleep(0.3)
print "BlueFade - bluefade | r1"
time.sleep(0.3)
print "L33T - leet | l3"
time.sleep(0.3)
print "Italics - italic | i"
time.sleep(0.3)
print "Captcha - captcha | cap"
time.sleep(0.3)
print "Underline - underline | u2"
time.sleep(0.3)
print "UnderColor - undercolor | u1"
time.sleep(0.3)
print "Updown - updown | ud"
time.sleep(0.3)
print "L33T - leet | l3"
time.sleep(0.3)
print "PurpleFade - purplefade | p1"
print "Exit - q | exit"
time.sleep(0.3)
print "Back - cd | back"
time.sleep(0.3)
print "Clear - cls | clear"
time.sleep(0.3)
print "\nTip: Typing \"!quit\" while using a color will return you to the command line!"
示例3: main
# 需要導入模塊: import console [as 別名]
# 或者: from console import clear [as 別名]
def main():
console.clear()
args = argue()
ln(args.lhs,args.rhs,args.symbolic)
return
示例4: main
# 需要導入模塊: import console [as 別名]
# 或者: from console import clear [as 別名]
def main():
console.clear()
args = argue()
diff(
args.lhs.rstrip('/'),
args.rhs.rstrip('/')
)
return
#_____________________________________________________
示例5: adjust_for_platform
# 需要導入模塊: import console [as 別名]
# 或者: from console import clear [as 別名]
def adjust_for_platform() -> Tuple[int, Union[TPoolExType, PPoolExType], int]:
if platform.system() == 'Darwin':
if platform.machine().startswith('iPad'):
device = "iPad"
elif platform.machine().startswith('iP'):
device = "iPhone"
else:
device = "mac"
else:
device = "other"
if device in ("iPad", "iPhone"):
# Adapt for smaller screen sizes in iPhone and iPod touch
import ui
import console
console.clear()
if device == 'iPad':
font_size = IPAD_FONT_SIZE
else:
font_size = IPHONE_FONT_SIZE
console.set_font(IOS_FONT, font_size)
screen_width = ui.get_screen_size().width
char_width = ui.measure_string('.', font=(IOS_FONT, font_size)).width
line_width = int(screen_width / char_width - 1.5) - 1
pool_ex = concurrent.futures.ThreadPoolExecutor
workers = IOS_WORKERS
else:
line_width = shutil.get_terminal_size((80, 24)).columns
pool_ex = concurrent.futures.ProcessPoolExecutor
from multiprocessing import cpu_count
workers = cpu_count() + 1
return line_width, pool_ex, workers
示例6: clearconsole
# 需要導入模塊: import console [as 別名]
# 或者: from console import clear [as 別名]
def clearconsole():
if has_console:
console.clear()
elif platform.system() == 'Windows':
os.system('cls')
else:
os.system('clear')