I have done a ton of searching but wasn't able to find an answer. I am a Python noob. I am having trouble getting the following code to work correctly:
import os
f = open('/home/pi/BGM/sound_config.cfg', 'r')
sound_config = f.read()
f.close()
internet_music = "wget -O - `wget -O - " + sound_config + "' | mpg123 -"
os.system(internet_music)
print "[Internet] Background music playing: " + sound_config
I receive the following error:
sh: 1: Syntax error: EOF in backquote substitution
I believe this is due to the ' character in the command I am trying to initiate (listed below)
wget -O - `wget -O - http://rainwave.cc/tune_in/4.mp3.m3u` | mpg123 -
I know this is probably an easy fix, but it has had me searching all over for the past hour or so.
This code is part of a script I am making to make music play in the background (streamed from the internet) which some later code will kill when other applications get launched.
If anyone could help me I would be very grateful. Thanks!