Python console.clear() Examples

The following are 6 code examples of console.clear(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module console , or try the search function .
Example #1
Source File: text_view.py    From bitcoinista with MIT License 6 votes vote down vote up
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) 
Example #2
Source File: ColorTerminal.py    From networking with GNU General Public License v3.0 5 votes vote down vote up
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!" 
Example #3
Source File: ln.py    From stash with MIT License 5 votes vote down vote up
def main():
    console.clear()
    args = argue()
    ln(args.lhs,args.rhs,args.symbolic)
    return 
Example #4
Source File: diff.py    From stash with MIT License 5 votes vote down vote up
def main():
    console.clear()
    args = argue()
    diff(
        args.lhs.rstrip('/'),
        args.rhs.rstrip('/')
    )
    return
    
#_____________________________________________________ 
Example #5
Source File: platforms.py    From optimize-images with MIT License 5 votes vote down vote up
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 
Example #6
Source File: utils.py    From 3DSkit with GNU General Public License v3.0 5 votes vote down vote up
def clearconsole():
	if has_console:
		console.clear()
	elif platform.system() == 'Windows':
		os.system('cls')
	else:
		os.system('clear')