Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to detect the full directory in Python?

I want to detect the full directory ( Like… C:/path/to/file.py? ) in [python]. And I don’t really know what module to use, or something. So, let’s imagine this function exists:

some.important.modules.checc()

If the Python file is somewhere in C:/Users/Rix/Downloads/Path/to/file.py, it would return C:/Users/Rix/Downloads/Path/to/file.py, or if the file is in C:/Users/Rix/Downloads/Some/very/interesting/path/to/file.py then it would return C:/Users/Rix/Downloads/Some/very/interesting/path/to/file.py.

So, what function could do like the some.important.modules.checc() function?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I don’t have enough reputation to make a "comment", the "\n" in Egemem İm answer means to have a new line printed before each of your path.

Without the "\n":
enter image description here

With the "\n":
enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading