当前位置: 首页>>代码示例>>Python>>正文


Python console.clear方法代码示例

本文整理汇总了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) 
开发者ID:christianlundkvist,项目名称:bitcoinista,代码行数:26,代码来源:text_view.py

示例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!" 
开发者ID:RussianOtter,项目名称:networking,代码行数:38,代码来源:ColorTerminal.py

示例3: main

# 需要导入模块: import console [as 别名]
# 或者: from console import clear [as 别名]
def main():
    console.clear()
    args = argue()
    ln(args.lhs,args.rhs,args.symbolic)
    return 
开发者ID:ywangd,项目名称:stash,代码行数:7,代码来源:ln.py

示例4: main

# 需要导入模块: import console [as 别名]
# 或者: from console import clear [as 别名]
def main():
    console.clear()
    args = argue()
    diff(
        args.lhs.rstrip('/'),
        args.rhs.rstrip('/')
    )
    return
    
#_____________________________________________________ 
开发者ID:ywangd,项目名称:stash,代码行数:12,代码来源:diff.py

示例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 
开发者ID:victordomingos,项目名称:optimize-images,代码行数:35,代码来源:platforms.py

示例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') 
开发者ID:Tyulis,项目名称:3DSkit,代码行数:9,代码来源:utils.py


注:本文中的console.clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。