Files
S4-P3-Projet/pcbdevice/utils/TestUtils.py
Marc-Antoine Lafreniere 46a3a02b2a Add functions description
Add python documentation
2019-02-26 17:51:53 -05:00

33 lines
605 B
Python

def readIntFile(filePath):
"""
Read a matrix file
:param filePath: File path to read from
:return: The matrix in int
"""
completeFile = []
file = open(filePath, 'r')
lines = file.readlines()
file.close()
for line in lines:
tempArray = []
for val in line.split():
tempArray.append(int(val))
completeFile.append(tempArray)
return completeFile
def readStringFile(filePath):
"""
Read all lines of a file
:param filePath: File path to read from
:return: Array of all lines in the file
"""
file = open(filePath, 'r')
lines = file.readlines()
file.close()
return lines