本文整理汇总了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')