Total Complexity | 2 |
Total Lines | 15 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import os |
||
2 | |||
3 | |||
4 | def read_file(dir_path, file_path): |
||
5 | """ |
||
6 | Read contents of a .py file and return as text |
||
7 | :param dir_path: str |
||
8 | :param file_path: str |
||
9 | :return: str |
||
10 | """ |
||
11 | goal_dir = os.path.join(dir_path, file_path) |
||
12 | with open(os.path.abspath(goal_dir), 'r') as fp: |
||
13 | contents = fp.read() |
||
14 | return contents |
||
15 |