File: lelevs2xml.py

package info (click to toggle)
pysiogame 4.20.01-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 27,876 kB
  • sloc: python: 48,742; xml: 3,813; sh: 30; makefile: 11
file content (22 lines) | stat: -rw-r--r-- 485 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# -*- coding: utf-8 -*-

import os
import sys

os.chdir(os.path.abspath(os.path.dirname(sys.argv[0])))

lst = ["3, 3, 2", "3, 5, 2", "3, 7, 2", "4, 3, 2", "4, 5, 2", "4, 7, 2", "5, 3, 2", "5, 5, 2", "6, 3, 2", "6, 5, 2"]

if __name__ == "__main__":
    fin = ""
    i = 1
    for each in lst:
        s = """
                <level n="%i" data="[%s]" />""" % (i, each)
        fin = fin + s
        i += 1

    FILE = "genlvls.xml"
    with open(FILE, "w") as f:
        f.write(fin)