I try to get the relative path to open a txt document using the following code:
imports os
filePath = os.path.relpath('../ProyectoLenguajeInterprete/Test')
txt = open(filePath)
print "Content for: %r:" % filePath
print txt.read()
But he throws me the following error:
Traceback (most recent call last):
File "C: \ Users \ team \ Documents \ NetBeansProjects \ ProjectInterpreteChange \ src \ projectinterguageinterprete.py", line 114, in < module > txt = open (filePath)
IOError: [Errno 2] No such file or directory: '.. \ Interpreter Project \ Test'