Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Reading XML file for modification
#python 3.5.2 lines = '''<entry rowname="1">a</entry> <entry rowname="1">a</entry> <entry rowname="2">b</entry> <entry rowname="2">b</entry> <entry rowname="2">b</entry> <entry rowname="3">c</entry> <entry rowname="3">c</entry> <entry rowname="4">d</entry> <entry rowname="5">e</entry> <entry rowname="5">e</entry>''' last_num = "" lines = lines.split("\n") for i, line in enumerate(lines): arr = line.split('"') if arr[1] != last_num: lines[i-1] = lines[i-1] + "TEST" last_num = arr[1] print("\n".join(lines))
run
|
edit
|
history
|
help
0
Distribucion de cortes
Guessing game
Game4
Converion of dictionary to list of tuples (Stackoverflow problem)
check the browser existence one by one
Game4
kenken1
aaa
H.W 5-Solution
19.09.18