File size: 473 Bytes
f7db77c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import json
import os


class File:
    def readFile(self, file):
        with open(file, 'r') as f:
            return f.read()

    def readJsonFile(self, file):
        with open(file, 'r') as f:
            return json.load(f)

    def writeFile(self, outputFilePath, data):
        with open(outputFilePath, 'w') as f:
            f.write(json.dumps(data))

    def exists(self, filePath):
        return os.path.exists(filePath)


file = File()