I need to open a file that is in another directory that is being worked on, I tried with:
open("../carpeta/subcarpeta1/subcarpeta2/archivo.log")
but when I run the script I get:
FileNotFoundError: [Errno 2] No such file or directory: 'folder / subfolder1 / subfolder2 / file.log'
The complete code is:
!/usr/local/bin/python3.5
import sendMail
from sendgrid.helpers.mail import *
from subprocess import call
import sys
import subprocess
import os.path
import unittest
from importlib import util
os.getcwd()
result = open("../ISV1/testing/log/testResult.log")
print (result)
The structure of my project is as follows:
code
├── ISV1
│ ├── testing (acá tengo los scripts de los test)
│ ├── log
│ └── archivo1.py (archivo que quiero leer)
│── server-test
│ └── script.py
What am I doing wrong? I put the inverted bars as they recommended me, and nothing.