Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f = open ('file')
- xml = open ('background-1.xml', 'at')
- prev = None
- for img in f:
- img = img.strip ()
- if prev is not None:
- xml.write ('''\
- <static>
- <duration>595.0</duration>
- <file>''' + prev + '''</file>
- </static>
- ''')
- xml.write ('''\
- <transition>
- <duration>5.0</duration>
- <from>''' + prev + '''</from>
- <to>''' + img + '''</to>
- </transition>
- ''')
- else:
- first = img
- prev = img
- xml.write ('''\
- <transition>
- <duration>5.0</duration>
- <from>''' + img + '''</from>
- <to>''' + first + '''</to>
- </transition>
- ''')
- xml.close ()
- f.close ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement