示例#1
0
def main():
	if len(sys.argv)>=2 and sys.argv[1].lower()=="server":
		s = threading.Thread(target=server.start_server)
		s.setDaemon(True)
		s.start()
		while True:
			pass
	else:
		gui.build()
		gui.guiApp.setLabel(network.ip(network.iface))
		server.s_thread = threading.Thread(target=server.start_server)
		server.s_thread.setDaemon(True)
		server.s_thread.start()
		gui.launch()
示例#2
0
文件: MVP5.py 项目: dfitz360/Drop-py
def main():
	if len(sys.argv)>=2 and sys.argv[1].lower()=="server":
		s = threading.Thread(target=server.start_server)
		s.setDaemon(True)
		s.start()
		while True:
			pass
	else:
		#g = threading.Thread(target=gui.launch)
		#g.setDaemon(True)
		#g.start()
		gui.build()
		gui.guiApp.setLabel(network.ip(network.iface))
		#print(type(network.ip("wlan0")))
		#client.update_available_ips()
		#files = client.get_file_list()
		#gui.guiApp.setFiles(files)
		server.s_thread = threading.Thread(target=server.start_server)
		server.s_thread.setDaemon(True)
		server.s_thread.start()
		gui.launch()
示例#3
0
    boundaries = [(tok.start, tok.end) for tok in tokens]
    return token_array, lines, boundaries


data_a = get_tokens(args.filename_a)
data_b = get_tokens(args.filename_b or args.filename_a)
tokens_a = data_a[0]
tokens_b = data_b[0]

matrix = numpy.zeros([len(tokens_a), len(tokens_b)], numpy.uint8)
for i, value in enumerate(tokens_a):
    matrix[i, :] = (tokens_b == value)

if args.gui:
    if can_use_gui:
        gui.launch(matrix, data_a, data_b)
    else:
        print("ERROR: Cannot load GUI. Try doing a `sudo apt-get install "
              "python3-pil.imagetk`. If that doesn't help, open a python3 "
              "shell, `import gui`, and see what's going wrong.")
        sys.exit(1)
else:
    # Only import matplotlib if we're going to use it. There's some weird
    # behavior on Macs in which matplotlib works fine on its own, and PIL works
    # fine on its own, but if you import matplotlib and then try *using* PIL for
    # the GUI, we have an uncaught NSException. Consequently, we don't import
    # matplotlib at the top of the file, and instead only import it if we're
    # actually going to use it.
    from matplotlib import pyplot

    # WARNING: Converting large arrays to images can take up so many resources