Python at the command line with relative paths

Solution for Python at the command line with relative paths
is Given Below:

I have a directory structure as follows:

eclipse-workspace/simple_python

I can successfully call a python file at the command line from within the ‘simple_python’ folder as follows:

%python3.8 external.py 

Now I wish to call the same file from a relative path, that is the folder above ‘simple_python’ as follows:

%python3.8 external.py /simple_python 

However, I get an error message saying ‘can’t open file ‘external.py”

What is the correct format for relative path addressing thanks ?

You have to enter the it in the format <directoryname>/<filename.py>

So if you are in eclipse-workspace directory then you need to run it as :

%python3.8 simple_python/external.py