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


Python WConio.wherey方法代码示例

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


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

示例1: writeout

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import wherey [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

示例2: run

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import wherey [as 别名]
    def run ( self ):
        time.sleep(3)
        oldLen = 0
        while 1:
            newLen = len(l)
            WConio.textcolor(WConio.LIGHTCYAN)
            posX = WConio.wherex()
            posY = WConio.wherey()
	    WConio.gotoxy(0,4)
	    if newLen < oldLen:
                for n in range(oldLen+1):
                    WConio.cputs("                                  \n\r")
            else:
                for n in range(len(l)+1):
                    WConio.cputs("                                  \n\r")
            WConio.gotoxy(0,4)
	    for i in range(len(l)):
                try:
                    print str(i) + ': ' + str(l[i][2])
                except:
                    print str(i) + ': ' + str(l[i][1][0])
            if posX > 16:
                WConio.gotoxy(posX,22)
            else:
                WConio.gotoxy(17,22)
            oldLen = len(l)
            time.sleep(3)
开发者ID:r0ot,项目名称:ArxBot-old,代码行数:29,代码来源:control.py

示例3: menu

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import wherey [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

示例4: run

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import wherey [as 别名]
    def run ( self ):
        WConio.textcolor(WConio.LIGHTGREEN)
        IPs = []
        time.sleep(1)
        while 1:
	    r = open('C:\\PyBot\\connections.txt', 'r')
	    str = r.read().split("\n")
	    r.close()
	    for i in str:
	    	if i != '':
                    try:
			IPs.index(i)
                    except:
			IPs.append(i)
            f = open('C:\\PyBot\\update.txt', 'w')
            x = WConio.wherex()
            y = WConio.wherey()
            for st in IPs:
                f.write(st + '\n')
		WConio.gotoxy(0,4)
		WConio.cputs(st + '\n\r')
            f.close()
            WConio.gotoxy(x, y)
            time.sleep(2)
开发者ID:r0ot,项目名称:ArxBot-old,代码行数:26,代码来源:old-control.py


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