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


Python WConio.clrscr方法代码示例

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


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

示例1: ClearScreen

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import clrscr [as 别名]
def ClearScreen():
    # Clears the screen and moves the cursor to the upper left corner
    if gOS == "Windows":
        WConio.clrscr()
    elif gOS == "Linux":
        gConsole.erase()
        gConsole.move(0, 0)
开发者ID:henryeherman,项目名称:elixys,代码行数:9,代码来源:StateMonitor.py

示例2: main

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import clrscr [as 别名]
def main():
   
    WConio.clrscr() 
    print "Demonstration of GetConfig().\n"\
          "List of Installed Boards:\n"
           
    # Get the number of boards installed in system 
    NumBoards=USB1208LS.GetConfig (GLOBALINFO, 0, 0, GINUMBOARDS)
    USB1208LS.SetConfig (BOARDINFO, 0, 0, BINUMADCHANS,8)  # single ended
    #USB1208LS.SetConfig (BOARDINFO, 0, 0, BINUMADCHANS,4)  # diff ended
    
    for i in range(NumBoards):
        # Get board type of each board 
        BoardType=USB1208LS.GetConfig (BOARDINFO, i, 0, BIBOARDTYPE)

        # If a board is installed 
        if (BoardType > 0):
             # Get the board's name 
            BoardNameStr=USB1208LS.GetBoardName (i)
            print "    Board #%d = %s" %(i,BoardNameStr)

            # Get the board's base address 
            BaseAdr=USB1208LS.GetConfig (BOARDINFO, i, 0, BIBASEADR)
            print "    Base Address = 0x%x" %BaseAdr

            PrintADInfo (i)
            PrintDAInfo (i)
            PrintDigInfo (i)
            PrintCtrInfo (i)
            PrintExpInfo (i)
   
    raw_input("\npause")
开发者ID:countrymarmot,项目名称:mccdaq,代码行数:34,代码来源:ULGT03.py

示例3: display_once

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import clrscr [as 别名]
def display_once(firmware_version):
    """Display static information, call once."""
    WConio.textattr(0x70)
    WConio.clrscr()
    # Display Firmware Version or Firmware Status.
    WConio.gotoxy(2, 0)
    if firmware_version < 1.0:
        WConio.textattr(0xc0)
        WConio.cputs(' Firmware Unreliable!   ')
    else:
        WConio.textattr(0xa0)
        WConio.cputs(' Firmware Version %2.2f '%firmware_version)
    # Display servo static labels.
    WConio.gotoxy(0, 2)
    WConio.textattr(0x70)
    WConio.cputs(' S# Acc #Q Cyc Speed Pos mS\n')
    for i in range(1, 17):
        WConio.cputs(' %2i\n'%i)
    # Display analog channel labels.
    WConio.gotoxy(0, 20)
    WConio.textattr(0x70)
    WConio.cputs    (' C#  Voltage                             C#  Voltage')
    for i in range(1, 5):
        WConio.cputs('\n  %i                                       %i'%
                     (i, i+4))
开发者ID:philips,项目名称:feusb,代码行数:27,代码来源:TestRCS.py

示例4: play

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import clrscr [as 别名]
    def play(self):
        repeats = 0
        lastclick = None

        while True:
            #self.find_diamond()
            items = self.find_one()
            if items:
                self.click(items)
                #print "clicked", items
                if items == lastclick:
                    repeats += 1
                else:
                    lastclick = items
                #time.sleep(0.1)
            #os.system('cls')
            WConio.clrscr()
            print '\n'.join([' '.join(x) for x in self.get_matrix()])
            # else:
            #     #time.sleep(0.5)
            #     self.click(self.buffer[0])
            #     print "Clicked from buffer", self.buffer[0]
            #     self.buffer.remove(self.buffer[0])
            #     time.sleep(0.1)
            #     #print "Waiting..."
            #     # fails += 1

            if repeats >= 5:
                return "Finished!"
开发者ID:roddds,项目名称:DiamondDashBot,代码行数:31,代码来源:dash.py

示例5: robust_write

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import clrscr [as 别名]
 def robust_write(self, command = ''):
     """Write to the RCS with robust exception handling."""
     try:
         self.write(command)
     except DisconnectError:
         global servo_mode
         servo_mode = IDLE
         # Blank screen due to device disconnect.
         WConio.textattr(0xb0)
         WConio.clrscr()
         WConio.gotoxy(10, 10)
         WConio.cputs('USB-RCS has been disconnected during write. '
                      'Trying to reconnect. ')
         self.robust_reconnect()
         usb = rcs.robust_read('U')
         firmware_version = usb[2]
         display_once(firmware_version)
     except Exception, e:
         WConio.textattr(0xc0)
         WConio.clrscr()
         WConio.gotoxy(0, 10)
         print "Unexpected exception in robust_write: ", type(e)
         print
         print e
         print
         raw_input("Press enter to exit ->")
         exit()
开发者ID:philips,项目名称:feusb,代码行数:29,代码来源:TestRCS.py

示例6: main

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

示例7: makeArray

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import clrscr [as 别名]
def makeArray(size):
	WConio.clrscr()
	gameArray=None	
	gameArray=[[chr(250) for y in range(size[1])] for x in range(size[0])]
	printGrid(gameArray)
	printBoard(gameArray)
	return gameArray
开发者ID:marcgalang,项目名称:otto,代码行数:9,代码来源:otto.py

示例8: main

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

    USB1208LS=MCCDAQ()
    USB1208LS.FlashLED(0)
    
    USB1208LS.GetBoardName(0)
    i=USB1208LS.getStatus()
    print USB1208LS.GetErrMsg(i)

    print USB1208LS.GetConfig(BOARDINFO,0,0,BISERIALNUM)
    
    WConio.clrscr() 

    print "Demonstration of cbAOut() - chan0 pin13 - D/A 10bits"

    ExitFlag = False
    while (ExitFlag==False):

        WConio.gotoxy (0, 3)
        EngUnits = float ( raw_input('Enter a voltage between -5.0 and +5.0:  ') )

        DataValue=USB1208LS.FromEngUnits(0, BIP5VOLTS, EngUnits)
        USB1208LS.AOut (0, 0 , BIP5VOLTS, DataValue)
        
        print "%.2f volts has been sent to D/A 0.\n"\
               "Press Q to quit , any other key to continue: "  %EngUnits
        (ch,)=WConio.getch()
        
        if (ch=='q' or ch=='Q'): ExitFlag=True
开发者ID:countrymarmot,项目名称:mccdaq,代码行数:31,代码来源:ULAO01.py

示例9: selectBoard

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import clrscr [as 别名]
def selectBoard(arrows):
	WConio.clrscr()
	k=None
	comment = None
	size=[5,5]
	gameArray=makeArray(size)
	WConio.gotoxy(0,21)
	print "{0:^79}".format("Hit the spacebar to accept this board.")	
	while k<>" ":		
		k = WConio.getkey()
		if k in arrows[0]:
			d=arrows[0].index(k)
			size[0]=(size[0]+arrows[1][d]*2)
			size[1]=(size[1]+arrows[2][d]*2)
			if size[0]>21:
				size[0]=21
				comment = "That's as wide as you can go."
			elif size[0]<5:
				size[0]=5
				comment = "That's as narrow as you can go."
			elif size[1]>9:
				size[1]=9
				comment = "That's as tall as you can go."
			elif size[1]<5:
				size[1]=5
				comment = "That's as short as you can go."
			else:
				comment = ""
		gameArray=makeArray(size)
		WConio.gotoxy(0,21)
		print "{0:^79}".format("{} {}".format(size,comment))
		if size[0]*size[1]>50:
			print "{0:^79}".format("This size board will get some random tokens thrown on.")	
		print "{0:^79}".format(" Hit the spacebar to accept this board.")
	#init pieces
	gameArray[0][0]=chr(1)
	gameArray[0][len(gameArray[0])-1]=chr(2)
	gameArray[len(gameArray)-1][0]=chr(2)
	gameArray[len(gameArray)-1][len(gameArray[0])-1]=chr(1)
	if len(gameArray)*len(gameArray[0])>50:
		c=0
		WConio.gotoxy(0,21)
		
		while c< len(gameArray)*len(gameArray[0])-40:
			m=randint(0,len(gameArray)-1)
			n=randint(0,len(gameArray[0])-1)
			p=randint(0,len(gameArray)-1)
			q=randint(0,len(gameArray[0])-1)
			if gameArray[m][n]==chr(250) and gameArray[p][q]==chr(250) and m<>p:
				gameArray[m][n]=chr(1)
				gameArray[p][q]=chr(2)
				c=c+2
	clearLines()
	return (gameArray)
开发者ID:marcgalang,项目名称:otto,代码行数:56,代码来源:otto.py

示例10: clrscr

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import clrscr [as 别名]
def clrscr():
    """
    Limpia la pantalla.

    :return: void
    :rtype: None
    """
    if _IMPORTED[0]:
        try:
            WConio.clrscr()  # @UndefinedVariable
        except:
            pass
    else:
        if not is_windows():
            os.system("clear")
开发者ID:ppizarror,项目名称:korektor,代码行数:17,代码来源:colors.py

示例11: __draw

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import clrscr [as 别名]
 def __draw(self):
    WConio.clrscr()
    
    # make walls
    for i in xrange(len(self.__walls)):
       self.__walls[i].draw()
       
    self.__worldInfo.player.draw((1,1))
    for z in self.__worldInfo.zombies:
       z.draw((1,1))
    for h in self.__worldInfo.healthPacks:
       h.draw((1,1))
    
    self.__drawHUD()
       
    WConio.gotoxy(0,self.__size[1] + 2)
开发者ID:elizabeth-matthews,项目名称:atlasChronicle,代码行数:18,代码来源:gameManager.py

示例12: printAsciiArtServer

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import clrscr [as 别名]
def printAsciiArtServer():
    """
    Imprime el arte ascii de la introducción del servidor
    :return: void
    """
    if _wconio:
        WConio.clrscr()
    try:
        # se obtiene el largo de la consola para dejarlo centrado
        (width, height) = getTerminalSize()  # @UnusedVariable
        asciiart = open("data/doc/other/asciiartserver.txt", "r")
        for i in asciiart:
            print " " * (int((width - 26) / 2) - 1), i.rstrip()
        asciiart.close()
    except:
        pass
开发者ID:ppizarror,项目名称:Hero-of-Antair,代码行数:18,代码来源:lib.py

示例13: main

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

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

    print "\n\nNote: Please make certain that the board you are using supports\n"\
           "      the gain you are choosing and if it is not a programmable\n"\
           "      gain that the switches on the board are set correctly.\n\n"
    
    BoardNum = 0
    Gain = BIPPT625VOLTS
    
    # collect the sample with cbAIn() */
    while (Gain > 0):
        # select gain */
        WConio.gotoxy(0,10)
        while 1:
            Gain = int ( raw_input ("Please select one of the following ranges(1 to 4):\n"\
                                    "                           10 VOLTS UNIPOLAR --> 1\n"\
                                    "                           10 VOLTS BIPOLAR ---> 2\n"\
                                    "                            5 VOLTS UNIPOLAR --> 3\n"\
                                    "                            5 VOLTS BIPOLAR ---> 4\n"\
                                    "                                       Quit ---> 0\n\n"\
                                    "                                Your Choice ---> "))
            if  ( (Gain >= 0) and (Gain <= 4) ): break
        
        # Set Gain, MaxVal, and MinVal */
        if   (Gain==0): sys.exit(1)
        elif (Gain==1): Gain = UNI10VOLTS
        elif (Gain==2): Gain = BIP10VOLTS
        elif (Gain==3): Gain = UNI5VOLTS
        elif (Gain==4): Gain = BIP5VOLTS

        if (Gain >= 0):
            DataValue=USB1208LS.AIn (BoardNum, Chan, Gain)
            EngUnits =USB1208LS.ToEngUnits(BoardNum, Gain, DataValue)
            print "\nThe voltage on channel %d is %.2f " %(Chan, EngUnits)
            
        Gain = BIPPT625VOLTS
开发者ID:countrymarmot,项目名称:mccdaq,代码行数:46,代码来源:ULAI11.py

示例14: main

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

    USB1208LS=MCCDAQ()

    WConio.clrscr() 
    print "Demonstration of DOut()\n"\
           "Press any key to quit."

    USB1208LS.DConfigPort (0, FIRSTPORTA, DIGITALOUT)
    
    # get a user value to write to the port 
    DataValue=256
    while ((DataValue < 0) or (DataValue > 255)):
        DataValue = int ( raw_input('Enter a value to send to FIRSTPORTA (0-255):     ') )

    USB1208LS.DOut(0, FIRSTPORTA, DataValue)
    print "\nThe value %u was written to FIRSTPORTA. \n" \
           "see pin21-PA0    pin28-PA7"    %DataValue
    raw_input('\nPause')
开发者ID:countrymarmot,项目名称:mccdaq,代码行数:21,代码来源:ULDO01.py

示例15: summaryTable

# 需要导入模块: import WConio [as 别名]
# 或者: from WConio import clrscr [as 别名]
def summaryTable(builds):
    WConio.clrscr()
    WConio.textcolor(WConio.WHITE)
    print "PROJECT NAME".ljust(90) + "STATUS".ljust(10)
    print "=" * 100
    good = bad = 0
    for item in builds:
        if item['status'] == 'ok':
            WConio.textcolor(WConio.LIGHTGREEN)
            good += 1
        else:
            WConio.textcolor(WConio.RED)
            bad += 1
        print item['project'].ljust(90) + item['status'].ljust(4)
    WConio.textcolor(WConio.WHITE)
    print "=" * 100
    WConio.textcolor(WConio.GREEN)
    print "GOOD :".rjust(90) + str(good).rjust(10, '.')
    WConio.textcolor(WConio.RED)
    print "BAD  :".rjust(90) + str(bad).rjust(10, '.')
开发者ID:AArhin,项目名称:delphimvcframework,代码行数:22,代码来源:build.py


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