Exemple #1
0
def dict_loop():
    import test
    while 1:
        word = input('\n#Please type the word/phrase you want to look up:')
        if word[-4:] != 'f**k':
            display.main(core.lookup(word))
        else:
            exit()
Exemple #2
0
def main():
    display.main()

    for a in agent_list:
        display.display_agent(a)
        a.main()

    display.update_display()
def main( xVRP, yVRP, zVRP, d, a, b, xt, yt, sf, *args ):
    
    UVN = TDview.main( a, b )
    alignedPoints = TDviewAlignment.main( xVRP, yVRP, zVRP, d, UVN[ 0 ], UVN[ 1 ], UVN[ 2 ], UVN[ 3 ], UVN[ 4 ], UVN[ 5 ], UVN[ 6 ], UVN[ 7 ], UVN[ 8 ], args )
    displayImage = display.main( d, xt, yt, sf, alignedPoints )

    return displayImage
Exemple #4
0
def main():
    display.main()

    for agent in agent_list:
        display.display_agent(agent)

    display.display_info_panel(0,
                               0,
                               None,
                               FPS=round(display.clock.get_fps(), 2),
                               Paused=paused,
                               MousePos=tuple(pygame.mouse.get_pos()),
                               Offset=(display.world_offset_x,
                                       display.world_offset_y))
    display.display_agent_panel(0, 72, agent_list)

    display.update_display()
Exemple #5
0
def main(matrix):
    global current_data
    first = True
    while True:
        try:
            response = urllib.urlopen(config.API_URL)
            data = json.loads(response.read())
            if first:
                display.drawIntro(matrix)
            if data != current_data or first:
                display.main(matrix, data)
            current_data = data
            first = False
        except Exception as e:
            print "Error fetching game state"
            print e
            break
        time.sleep(1)
def TDline(boardsize_x, boardsize_y, d, xt, yt, sf, x1, y1, z1, x2, y2, z2):

    print('Starting')

    array = [x1, y1, z1, x2, y2, z2]

    image = one_color.main(boardsize_x, boardsize_y, 245, 245, 245)
    frame = display.main(d, xt, yt, sf, array)
    image = add_to_image.main(image, frame, 255, 0, 0)

    write_ppm.main(image, 'test')
    print('Finish')
def TDline( boardsize_x, boardsize_y, d, xt, yt, sf, x1, y1, z1, x2, y2, z2 ):
    
    print ('Starting')

    array = [ x1, y1, z1, x2, y2, z2 ]
    
    image = one_color.main( boardsize_x, boardsize_y, 245, 245, 245 )
    frame = display.main( d, xt, yt, sf, array )
    image = add_to_image.main( image, frame, 255, 0, 0 )

    write_ppm.main( image, 'test' )
    print ('Finish')
Exemple #8
0
def main():
    if len(sys.argv) < 2:
        dict_loop()
    else:
        is_arg = sys.argv[1][0]
        if is_arg == '-':
            if sys.argv[1] == '-l':
                display.main(core.lookup(' '.join(sys.argv[2:])))
            if sys.argv[1] == '-d':
                display.main(core.lookup(' '.join(sys.argv[2:])))
                dict_loop()
        else:
            display.main(core.lookup(' '.join(sys.argv[1:])))
 def display():
     destroy()
     d.main()
     exit()
Exemple #10
0
import setting
import tap
import move
import display

from threading import Thread

s = setting.main()
if s.cfg_ok:
    all_key = []
    for i in range(s.keynum):
        all_key += [tap.key(*s.key_setting[i], **s.tap_setting)]
    akey = tap.allKey(**s.tap_setting)
    tap_main = tap.main(all_key, akey)
    move_main = move.main(20)
    dis_main = display.main(all_key, akey, move_main, s.keynum,
                            **s.dis_setting)

    bgtap_cal = Thread(target=tap_main.start)
    bgmove_cal = Thread(target=move_main.start)

    bgtap_cal.start()
    bgmove_cal.start()
    dis_main.start()
Exemple #11
0
def test_901(the_word):
    import core
    the_dick = core.lookup(the_word)
    import display
    display.main(the_dick)
Exemple #12
0
writetf('0 0 0')
sleep(1)

try:
    while 1:
        tobj1 = i2c.readU16(0x7)
        #print tobj1
        tobj1 = tobj1 * 0.02 - 273.15
        if tavg == 0:
            tavg = tobj1
        tavg = round(tavg * 0.9 + tobj1 * 0.1, 2)
        print tobj1  #, tavg

        #display the average
        if counter == 10:
            display.main(str(tavg), 50)
            counter = 0

        #control the RGB led
        if tobj1 > 30 and hot == 0:
            hot = 1
            writetf('100 0 0')
            print "wrote hot to file"
        if tobj1 < 30 and hot == 1:
            hot = 0
            writetf('0 5 50')
            print "wrote cold to file"

        counter += 1
        sleep(0.1)
Exemple #13
0
#! /home/pi/.local/bin/python3.7
from connector import Connection
import pathlib
import os
import json

if __name__ == "__main__":
    confpath = os.path.join(str(pathlib.Path.home()),".hwk/config.json")
    with open(confpath, "r") as fp:
        config = json.load(fp)

    router_ip, port = config["router"], config["port"]
    config["ip"] = Connection(router_ip, port).result
    with open(confpath, "w") as fp:
       json.dump(config, fp, indent=4)

    import LineDisplay
    import display
    import sys
    import functools

    if sys.argv[1] == "display0":
        display.main(LineDisplay.CookLineProtocol, 3)
    elif sys.argv[1] == "display1":
        client = functools.partial(LineDisplay.DrinkLineProtocol, exclude=["Bottled", "Pie", "Cake"])
        display.main(LineDisplay.DrinkLineProtocol, 2)