Mad Hacker
September 1st, 2009, 05:53 PM
i am trying to write a script to generate part of the backrounds.xml file, and have encountered an error that i don't understand
the error is
File "wallpaper_script.py", line 4
"""<name>""", """</name>""", \
^
SyntaxError: invalid syntax
from sys import argv
template = [ """<wallpaper deleted="false">, \
"""<name>""", """</name>""", \
"""<filename>""", """</filename>""", \
"""<options>stretched</options>""", \
"""<shade_type>solid</shade_type>""",\
"""<pcolor>#ffffffffffff</pcolor>""",\
"""<scolor>#000000000000</scolor>""",\
"""</wallpaper>""" ]
prefix = ""
end = []
curlist = []
for curarg in argv:
if curarg == argv[1]: #curarg[1](first argument) should be the path to the files
prefix = curarg
curlist = template
curlist.insert(2, prefix + curarg) #insert curarg in the name field
curlist.insert(5, prefix + curarg) #insert curarg in the filename field
end.append(curlist)
for j in end:
for i in j:
print i
the error is
File "wallpaper_script.py", line 4
"""<name>""", """</name>""", \
^
SyntaxError: invalid syntax
from sys import argv
template = [ """<wallpaper deleted="false">, \
"""<name>""", """</name>""", \
"""<filename>""", """</filename>""", \
"""<options>stretched</options>""", \
"""<shade_type>solid</shade_type>""",\
"""<pcolor>#ffffffffffff</pcolor>""",\
"""<scolor>#000000000000</scolor>""",\
"""</wallpaper>""" ]
prefix = ""
end = []
curlist = []
for curarg in argv:
if curarg == argv[1]: #curarg[1](first argument) should be the path to the files
prefix = curarg
curlist = template
curlist.insert(2, prefix + curarg) #insert curarg in the name field
curlist.insert(5, prefix + curarg) #insert curarg in the filename field
end.append(curlist)
for j in end:
for i in j:
print i