Y = highTempCommandPreffix + str(highTempCounter) + vizCommandPreffix2 + inputFromXML + vizCommandSuffix #x = print (highTempCommandPreffix + str(highTempCounter) + vizCommandPreffix2 + inputFromXML + vizCommandSuffix) X = da圜ommandPreffix + str(da圜ounter) + vizCommandPreffix2 + inputFromXML + vizCommandSuffix #x = print (da圜ommandPreffix + str(da圜ounter) + vizCommandPreffix2 + inputFromXML + vizCommandSuffix) #print (f'MAIN_SCENE*TREE*$day01*FUNCTION*ControlText*input SET ') HighTempCommandPreffix = '0 MAIN_SCENE*TREE*$' #highTempCommandPreffix = '0 MAIN_SCENE*TREE*$high_temp0' Here is the script: The last socket send line at the bottom is where i am so far. Is there a way to convert the values from the xml to a string? I tried the encode function you suggested but it give another error. It always returns the error of "NameError: name 'inputFromXML' is not defined. I have tried every combination i can think of to convert the value to a string. The only problem left is the values for the days and temperature to be converted to a string. I reworked it a bit to work with python 3.
I am using the script you made that worked in python 2.0. The problem i am having is that the values that are coming from the function need a certain format to be treated as a string instead of an integer/float. The script you sent works for a value that is defined as a string or equals a string. nd(b'0 MAIN_SCENE*TREE*$high_temp01*FUNCTION*ControlText*input SET 43345' ) #nd(b'0 print (highTempCommandPreffix) + str(highTempCounter) + vizCommandPreffix2 + inputFromXML + vizCommandSuffix') Socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) PORT = 6100 # The same port as used by the server WeekReport = wxMiguelXML.getElementsByTagName("report")ĭayReport = weekReport.getElementsByTagName("forecast") WxMiguelXML = minidom.parse(readXMLfromURL) HighTempCommandPreffix = '0 MAIN_SCENE*TREE*$high_temp0' If anyone is a python/viz expert.ĭa圜ommandPreffix = '0 MAIN_SCENE*TREE*$day0' I can get the information to populate from the xml and i can see it in python but i cant get the syntax to fill the containers. Still having some issues with this script. If you find out why this thing is not working please post it I don't know why it does not want to take either of the types I am sending TypeError: a bytes-like object is required, not 'str'īut if I change the info I am sending to byte-object I get the following error With python 3.X and engine 3.8.1 I get the following error message #nd('0 MAIN_SCENE*TREE*$tickerSponsor*IMAGE SET IMAGE*KFMB_VER01/MASTER_CONTROL/TICKER_SPONSORS/' + 'name of the image' + '\0') in this case I am changing the image on a container from ('0 MAIN_SCENE*TREE*$tickerSponsor*IMAGE SET this is part of the command this IMAGE*KFMB_VER01/MASTER_CONTROL/TICKER_SPONSORS/ is the path to the image in my gfx hub The script when it worked I ran out of Textwrangler on a mac, I would just feed it some text via a variable and run the script which would connect to the artist engine, which was on air mode, and i was able to change the text on a container, or I could parse an xml and get the info I needed and then i would send it to the engineĪs per the scene, there was nothing special about it, the one thing you have to pay attention to is the hierarchy on your tree, which in the script would be the command you send to the engine for example Shotski2 sorry I have not been able to respond, I was using python 2.X to run this, I am now running python 3.X and the script I send you doesn't work any longer, I have been trying to make it work but haven't been able to. Print vizCommandPreffix, ' ', currentSponsorImage, ' ', vizCommandSuffix Test to make sure the engine is reading what I'm sending nd( vizCommandPreffix + currentSponsorImage + vizCommandSuffix) # declared at the top, this are just variable with viz commands, see the above line that starts, #soc.send. # Next line is used to send a command to the engine, preffix and suffix were #nd('0 MAIN_SCENE*TREE*$tickerSponsor*IMAGE SET IMAGE*KFMB_VER01/MASTER_CONTROL/TICKER_SPONSORS/' + 'name of the image' + '\0')
#nd('0 RENDERER*FUNCTION*DataPool*Data SET tickerSponsorImage=' + str(currentHouseNumber) + '\0') #Commands I was sending to the different engines #print >sys.stderr, 'connecting to %s port %s' % server_address # this is the ticker engine, this is to confirm I could talk to other engines # this is the artist machine, where I was testing # Connect the socket to the port where the server is listening Sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#Vizrt artist salary code
#This is a variable I used in another part of the code