當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。