Adds absolute path to open file command

This commit is contained in:
Wojciech Burda
2023-02-10 14:38:09 +01:00
parent 2721607bda
commit 8c84dc03ec
+4 -1
View File
@@ -1,7 +1,10 @@
import os
import re
import json
with open('access.log', 'r') as f:
absPath = os.path.dirname(os.path.abspath(__file__))
with open(absPath + os.sep + 'access.log', 'r') as f:
logs = f.readlines()
f.close()