cyb.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 #
00003 # Copyright 2011 Shadow Robot Company Ltd.
00004 #
00005 # This program is free software: you can redistribute it and/or modify it
00006 # under the terms of the GNU General Public License as published by the Free
00007 # Software Foundation, either version 2 of the License, or (at your option)
00008 # any later version.
00009 #
00010 # This program is distributed in the hope that it will be useful, but WITHOUT
00011 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
00013 # more details.
00014 #
00015 # You should have received a copy of the GNU General Public License along
00016 # with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 #
00018 file = open("cyberglovetoshadowhand.map")
00019 
00020 first = True
00021 matrix = []
00022 
00023 for line in file.readlines():
00024     if first:
00025         first = False
00026         continue
00027     else:
00028         line = line.strip("\n")
00029         line = line.split(" ")
00030         matrix.append(line)
00031 
00032 file.close()
00033 
00034 matrix_t = []
00035 
00036 for i in range(0, len(matrix[0])):
00037     matrix_t.append(range(0,len(matrix)))
00038 
00039 for i in range(0, len(matrix)):
00040     for j in range(0, len(line)):
00041         matrix_t[j][i] = matrix[i][j]
00042 
00043 file = open("cyberglovetoshadowhand_transposed.map", "w")
00044 for line in matrix_t:
00045     for col in line:
00046         file.write(col+ " ")
00047     file.write("\n")
00048 file.close()
00049 
00050 
00051 


sr_remappers
Author(s): Ugo Cupcic
autogenerated on Fri Jan 3 2014 12:05:01