-
videohub writing software python
hi there all
i’m trying to write a app in python to build
a simple totalrecall program for our BM router.
since it will be used for 3 shows every week with different
router setup’s.i’m just starting programing in python and run into trouble.
lack of knowledge i guess 😉i have it already running the dirty way with the terminal command
nc 192.168.42.50 9990 < textfile.txt
textfile.txt contains all route’s in the format described in the manual.
this works but not all our operators are good in commandline foo 😉of coarse i can do it with a applescript too but want to make it in python
crossplatformin python
reading the setup on connecting to the router
works ok.
re sending this to the router works also.but rereading the router when route’s have changed
is going wrong all the time due to polution in the
input buffer are there any python guru’s here that can help me out.see code below
import socket
import struct, time
import os
from Tkinter import *
import tkMessageBoxHOST = “192.168.42.50”
PORT = 9990
#make socket and connect to BM router
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
#fill variables with all router settings
header = s.recv(4096)
setup = s.recv(4096)
labelsin = s.recv(4096)
labelsuit = s.recv(4096)
locked = s.recv(4096)
routes = s.recv(4096)def leesuit():
#read routes out of the BM router
#garbage = s.recv(4096)
global routes
s.send(“VIDEO OUTPUT ROUTING:nrnr”)
#command to get routes again from the router
routes = s.recv(4096)
returndef schrijfnaar():
#send routes to the BM router
#global routes
s.send(routes)
#garbage = s.recv(4096)
print routes
returngui =Tk()
gui.title(“blackmagic total recall test”)
gui.geometry(‘400×600+200+200’)
button1 = Button(gui, text=”Read From MTX” , width=20,command=leesuit)
button1.pack(padx=15,pady=15)
button2 = Button(gui, text=”Send to MTX” , width=20,command=schrijfnaar)
button2.pack(padx=15,pady=15)
gui.mainloop()thanks in front if you can help
sorry for the indention errors
kind regards
mauricePeople saying they don’t make mistake’s often make nothing at all!