-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastercart_reorder.py
More file actions
31 lines (23 loc) · 863 Bytes
/
astercart_reorder.py
File metadata and controls
31 lines (23 loc) · 863 Bytes
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
#!/bin/env python
import os
hotkeys = [ '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' ]
directory = './prg'
programs = []
for prg in os.listdir(directory):
programs.append(str(prg))
programs = sorted(programs)
count = len(programs)
print str(count) + " programs found."
outputfile = open('order.txt', 'w')
gamenumber = 1
for item in range(count):
item = int(item)
oldname = programs[item]
newname = hotkeys[item] + '_' + oldname
print '\t' + newname
astername = 'Game' + str(gamenumber) + '.prg'
command = '/usr/bin/cp ' + directory + '/' + oldname + ' ./' + astername
os.system(command)
outputfile.write( astername + ' = ' + newname + '\n')
gamenumber = gamenumber + 1
outputfile.close()