本文整理汇总了Python中WConio.textmode方法的典型用法代码示例。如果您正苦于以下问题:Python WConio.textmode方法的具体用法?Python WConio.textmode怎么用?Python WConio.textmode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WConio
的用法示例。
在下文中一共展示了WConio.textmode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup
# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import textmode [as 别名]
def setup():
#setup the screen
log.debug('setting up screen')
import os
if 'nt' in os.name:
import subprocess
subprocess.call(['mode', 'con', 'lines=%i' % (C.height+1), 'cols=%i' % C.width], shell=True)
else:
W.resize(C.height+1,C.width)
W.settitle('On The Run! (LD#21: Escape)')
W.textmode()
示例2: download
# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import textmode [as 别名]
import urllib
import WConio
from shutil import copy2, rmtree
from sys import exit
import os
WConio.settitle('MiniServ :: Update Tool')
WConio.textmode()
WConio.textcolor(7)
def download(url):
webFile = urllib.urlopen(url)
filename = url.split('/')[-1]
localFile = open(filename, 'w')
print '\n Downloading File:',filename,'...',
localFile.write(webFile.read())
webFile.close()
localFile.close()
WConio.textcolor(2)
print 'done'
WConio.textcolor(7)
def goto_dir(dir):
if not os.path.exists(dir):
os.mkdir(dir)
os.chdir(dir)
ini = open('settings.ini','r')
ini = ini.readlines()
示例3: reset
# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import textmode [as 别名]
def reset():
'''
Reset the entire terminal.
Used for things that want to exit the game cleanly.
'''
W.textmode()
示例4:
# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import textmode [as 别名]
logger.addHandler(hdlr)
logger.setLevel(logging.DEBUG)
import sys
import os
if 'nt' not in os.name:
import XConio
import curses
import game
game.start = curses.wrapper(game.start)
import WConio as W
defaultcolor = W.gettextinfo()[4]
import game
try:
game.start()
except game.GameShutdown:
W.textmode()
pass
except KeyboardInterrupt:
W.textmode()
raise
except:
raise
finally:
logger.debug("Shutting down")
logging.shutdown()
W.clreol()
W.textattr(defaultcolor)
W.setcursortype(1)
示例5: init
# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import textmode [as 别名]
def init():
W.textmode()
setcursortype(0)