repl.it
@anonymous/

BriskDarkgraySoftwareengineer

Python 2.7

No description

fork
loading
Files
  • main.py
  • set.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# showdown export -> smogon analysis format converter
# made by dom
# just paste the import of the set into set.txt (look on your left), then go back to this file and click "run" up there^
# note: the set name is auto-generated by the first move if there is no nickname. you might have to edit it.

set = open('set.txt', 'r')
mylist = []
for line in set:
  if len(line) > 1:
    mylist.append(line.replace("(F) ", "").replace("(M) ", "").replace ("  ", "").replace("\n", ''))

print "[SET]"
moves = []
ability = ''
nature = ''
evs = ''
for item in mylist:
  if "- " in item:
    moves.append(item[1:])
  elif "Ability:" in item:
    ability = item.partition('Ability: ')[2]
  elif "Nature" in item:
    nature = item.partition(' Nature')[0]
  elif 'EVs:' in item:
    evs = item.partition('EVs: ')[2]
x = 0
if "(" in mylist[0]:
  print 'name: ' + mylist[0].partition('(')[0]
else:
  print 'name: ' + moves[0][1:]
for move in moves:
  x += 1
  print 'move ' + str(x) + ':' + str(move)
item = mylist[0].partition('@')[2][1:]
print 'item: ' + item
print 'ability: ' + ability
print 'nature: ' + nature
print 'evs: ' + evs