Hi, Im new to programming and to Python. Im making a program to get weather information from online, parse it the way I want to, then have Festival read it aloud to me. I got the weather info and parsing done exactly how I want but am getting an error while having Festival read it back to me. I haven't had any problems with festival before and use similar code with no problem. I think it may have to do with the data type some how. Here is the code followed by the error message:
import subprocess
os.system('modprobe pcspkr')
logfile = open("weather.txt", "r").readlines()
line = logfile[34]
print (line)
line = line.replace("-", "will be")
line = line.replace("<br />", "")
line = line.replace(":", " temperature is,")
line = line.replace("Low", ", Low ")
subprocess.call('echo '+line+' | festival --tts', shell=True)
print(line)
/bin/sh: 2: Syntax error: "|" unexpected
Wed will be Mostly Sunny. High temperature is, 54 , Low temperature is, 34
Any idea of whats going on here?