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


Python WConio.gettextinfo方法代码示例

本文整理汇总了Python中WConio.gettextinfo方法的典型用法代码示例。如果您正苦于以下问题:Python WConio.gettextinfo方法的具体用法?Python WConio.gettextinfo怎么用?Python WConio.gettextinfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WConio的用法示例。


在下文中一共展示了WConio.gettextinfo方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import gettextinfo [as 别名]
    def __init__(self):
    #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        object.__init__(self)
        self.origCursor = 1
        self.curCursor = 1
        self.origState = wc.gettextinfo()[4] & 0x00FF
        t = wc.gettextinfo()

        self.sx = 0
        self.sy = 0
        self.ex = t[2]
        self.ey = t[3]
        self.wd = t[2]
        self.ht = t[3]
开发者ID:chyser,项目名称:bin,代码行数:16,代码来源:conio.py

示例2: log_color

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import gettextinfo [as 别名]
 def log_color ( self, message, record ):
     """ Testing """
     if record.levelno in self.LEVEL_ID:
         old_setting = WConio.gettextinfo()[4] & 0x00FF
         WConio.textcolor( self.LEVEL_ID[record.levelno] )
         return message
     WConio.textcolor( old_setting )
开发者ID:chipsec,项目名称:chipsec,代码行数:9,代码来源:logger.py

示例3: writeout

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import gettextinfo [as 别名]
def writeout(s, o, c=True, replace_lines=0):
    '''Writes out a string to the stdout or appends it to a file'''
    if not o:

        if c:
            s = deutfize(s)

        if replace_lines and sys.platform in WINDOWS:
            try:
                import WConio
                pos = WConio.wherex(), WConio.wherey()
                for i in range(replace_lines):
                    sys.stdout.write(' '*(WConio.gettextinfo()[-3]-1) + '\n')
                WConio.gotoxy(pos[0], pos[1])
            except:
                replace_lines=0

        sys.stdout.write(s)

        if replace_lines and sys.platform in WINDOWS:
            WConio.gotoxy(pos[0], pos[1])

    else:
        with open(o, mode='a', encoding='utf-8') as o_file:
            o_file.write(s)
开发者ID:gneposis,项目名称:gntools_old,代码行数:27,代码来源:filepath.py

示例4: main

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import gettextinfo [as 别名]
def main():

    USB1208LS=MCCDAQ()

    WConio.clrscr() 
    print "Demonstration of cbDIn()\n"\
           "Press any key to quit.\n\n"\
           "You may change a bit by applying a TTL high or\n"\
           "a TTL low to the corresponding pin# on port A.\n"

    print "The first 7 bits are: pin32 to pin 39\n"\
           "0  1  2  3  4  5  6  7\n "
    (a,a,a,a,a,a,a,a,a,a,row)=WConio.gettextinfo() 
    
    USB1208LS.DConfigPort (0, FIRSTPORTB, DIGITALIN)

    while (WConio.kbhit()==False):
        DataValue=USB1208LS.DIn(0, FIRSTPORTB)
        WConio.gotoxy(0,row)  
        print "Port Value: %d         " %DataValue

        # parse DataValue into bit values to indicate on/off status */
        for I in range (8):
            if (DataValue & 2**I):  BitValue = 1
            else:  BitValue = 0
            print "%d " %BitValue,
开发者ID:countrymarmot,项目名称:mccdaq,代码行数:28,代码来源:ULDI01.py

示例5: log_color

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import gettextinfo [as 别名]
 def log_color( fg_color, text ):
     """
     Store current attribute settings
     """
     old_setting = WConio.gettextinfo()[4] & 0x00FF
     WConio.textattr( COLOR_ID[ fg_color ] )
     print text
     WConio.textattr( old_setting )
开发者ID:abazhaniuk,项目名称:chipsec,代码行数:10,代码来源:logger.py

示例6: _write_color_nt

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import gettextinfo [as 别名]
def _write_color_nt(fp, text, color):
    """Assumes WConio has been imported at module level."""
    oldcolor = WConio.gettextinfo()[4]
    oldtextcolor = oldcolor & 0x000F
    if ";" in color:
        color = color.split(";", 1)[1]
    WConio.textcolor(WConioColor.get(color, oldtextcolor))
    fp.write(text)
    WConio.textattr(oldcolor)
开发者ID:HomeRad,项目名称:TorCleaner,代码行数:11,代码来源:ansicolor.py

示例7: __init__

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import gettextinfo [as 别名]
    def __init__(self, display_keys=True, display_header=True, outfile=sys.stdout):
        self.display_keys = display_keys
        self.display_header = display_header
        self.interactive = False
        self.print_lines = 0
        self.termrows = 0
        self.outfile = outfile
        # XXX if stdin is not a tty, it seems that the command fails.

        if os.isatty(sys.stdout.fileno()) and os.isatty(sys.stdin.fileno()):
            if sys.platform == 'win32':
                self.termrows = WConio.gettextinfo()[8]
            else:
                self.termrows = int(subprocess.Popen('stty size', shell=True, stdout=subprocess.PIPE).communicate()[0].split()[0])
开发者ID:eirmag,项目名称:weboob,代码行数:16,代码来源:iformatter.py

示例8: menu

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import gettextinfo [as 别名]
def menu(options, deletepreviouslines=0):
    _sel()
    _otr() # Initialize terminal conditions

    home = WConio.wherey() # Gets original y coordinate
    startup = home - deletepreviouslines - 2
    y = 0
    draw(options, y)
    multiple = []
    escolha = ''
    while escolha != '\r':  #\r = enter
        escolha = WConio.getkey()

        if escolha == 'up':
                if y != 0:
                    y-=1

        if escolha == 'down':
                if y != len(options)-1:
                    y+=1

        if escolha == '+':
            multiple.append(options[y])
            if options[y][-1] != '+':
                options[y] += '+'

        # To do: add option to remove from list

        WConio.gotoxy(0, home)
        draw(options,y)

    _otr()

    for i in range(WConio.wherey(), startup, -1):
        WConio.gotoxy(0, i)
        sys.stdout.write(' '*WConio.gettextinfo()[8])
    WConio.gotoxy(0, startup)

    if len(multiple)>0:
        return multiple
    else:
        return [options[y]]
开发者ID:roddds,项目名称:idler,代码行数:44,代码来源:menu.py

示例9: emit

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import gettextinfo [as 别名]
 def emit(self, record):
     WConio = self.WConio
     try:
         msg = self.format(record)
         levelname = record.levelname
         out = sys.__stdout__  # in case redirected by filelogger, etc
         if levelname in msg:
             part1, part2 = msg.split(levelname, 1)
             out.write(part1)
             out.flush()
             saved_color = WConio.gettextinfo()[4]
             WConio.textattr( self.colormap.get(levelname,
                 WConio.LIGHTGREY) )
             if levelname == 'CRITICAL':  WConio.textbackground(WConio.RED)
             WConio.cputs(levelname)
             WConio.textattr(saved_color)  # restore
             print >> out, part2
         else:
             print >> out, msg
         out.flush()
     except:
         self.handleError(record)
开发者ID:TobiasAAM,项目名称:scala-tests,代码行数:24,代码来源:scalalib.py

示例10: main

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import gettextinfo [as 别名]
def main():
    USB1208LS=MCCDAQ()
    
    WConio.clrscr() 
    print "Demonstration of AIn()\n"\
           "Press any key to quit.\n"

    # get the A/D channel to sample 
    Chan = int ( raw_input('Enter the channel to display: ') )

    print "\nThe raw data value on Channel %u is: " %Chan,
    (a,a,a,a,a,a,a,a,a,col,row)=WConio.gettextinfo() 
    print "\nThe voltage on Channel %u        is: " %Chan,
    
    # collect the sample from the channel until a key is pressed 
    while (WConio.kbhit()==False):
        DataValue=USB1208LS.AIn (0, Chan, BIP5VOLTS)
        EngUnits =USB1208LS.ToEngUnits (0, BIP5VOLTS, DataValue)

        WConio.gotoxy(col,row)  
        print "%5d" %DataValue,
        WConio.gotoxy(col,row+1)  
        print "%.2fV" %EngUnits,
开发者ID:countrymarmot,项目名称:mccdaq,代码行数:25,代码来源:ULAI01.py

示例11: GetConnections

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import gettextinfo [as 别名]
import sys
import socket
import string
import os
import io
import time
import random
import urllib2
import re
import WConio
import threading
import sys

#(2,24)
old_setting = WConio.gettextinfo()[4] & 0x00FF
WConio.clrscr()
WConio.settitle("PyBot Control Center")
WConio.gotoxy(2,2)
WConio.cputs("Welcome to the PyBot Control Center\n\r")
f = open('C:\\PyBot\\connections.txt', 'w')
j = open('C:\\PyBot\\update.txt', 'w')
p = open('C:\\PyBot\\cmd.txt', 'w')
f.write('')
j.write('')
p.write('')
f.close()
j.close()

class GetConnections ( threading.Thread ):
    def run ( self ):
	WConio.textcolor(WConio.LIGHTRED)
开发者ID:r0ot,项目名称:ArxBot-old,代码行数:33,代码来源:old-control.py

示例12:

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import gettextinfo [as 别名]
hdlr = logging.FileHandler('debug.log')
formatter = logging.Formatter('%(asctime)s %(name)s:%(levelname)s %(message)s')
hdlr.setFormatter(formatter)
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()
开发者ID:jtruscott,项目名称:ld21,代码行数:32,代码来源:main.py

示例13: getCursorPos

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import gettextinfo [as 别名]
def getCursorPos():
#-------------------------------------------------------------------------------
    t = wc.gettextinfo()
    return t[9], t[10]
开发者ID:chyser,项目名称:bin,代码行数:6,代码来源:conio.py


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