python - How to get the absolute path relative to the project root without double slashes? -


I have defined this function to get the absolute path relative to the project root:

 < Code> def refight (* x): return os path.normpath (os.path.join (os.path.dirname (__ file__), '..', * x) gET_PATH = (replay ('Django / DIR The problem is that I get a path with double slash (on Windows) like:  
  C: \ \\\ user \\\\ Fuiba \\\\\\\\\\\\\\\\ django \\\\ dir  

me with 4 slashes Why do you get the path?
Is there any way to avoid this behavior or can I reduce it again and again?

Thank you!

I am using Yuneepath in my projected projects. It is making it very easy to try. It is really good and self-explanation.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -