Rename modules
Rename modules with better name and move the arduino code to its own folder
This commit is contained in:
33
gcodeextractor/utils/TestUtils.py
Normal file
33
gcodeextractor/utils/TestUtils.py
Normal file
@@ -0,0 +1,33 @@
|
||||
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
|
||||
Reference in New Issue
Block a user