URL
https://opencores.org/ocsvn/phr/phr/trunk
Subversion Repositories phr
[/] [phr/] [trunk/] [doc/] [gastos/] [comp_2012-09-10/] [list.py] - Rev 178
Go to most recent revision | Compare with Previous | Blame | View Log
#******************** IMPORT LIBRARY **************** import os import re #********************* BEGIN ALGORITHM *********************** print("\n ****** Para salir precione CTRL-C *****") try: cpld = open("cpld.cmp", "r") fpga = open("fpga.cmp", "r") OOCD_placa = open("OOCD_placa.cmp", "r") S3Proto_Power = open("S3Proto_Power.cmp", "r") for i in range(1,4,1): for j in range(0,(len(cpld)),1): pre_list = file_pre.next() pos_list = file_pos.next() pre_data = pre_list.rsplit("\t") pos_data = pos_list.rsplit("\t") for j in range(0,(len(pre_data)-2),1): error_data.append((float(pre_data[j])-float(pos_data[j]))); xx.append(float(j)) print error_data plt.plot(xx,error_data,"ro") plt.axis([0, len(pre_data)-2, -0.1, 0.1]) plt.draw() plt.show() plt.grid(True) input() print("\n Fin de programa") except ValueError: print("\n Error en el dato") except KeyboardInterrupt: print("\n Se cierra el programa") plt.axis([0, len(pre_data)-1, -0.01, 0.01]) plt.draw() plt.show() exit() except IOError: print("\n No se puede abrir el archivo.") exit() except EOFError: print("\n Se termino la lectura de archivos. \n Presione CTRL + C para salir"); finally: file_pre.close() file_pos.close()
Go to most recent revision | Compare with Previous | Blame | View Log