Home python How to get a full path to the file or Windows program?...

How to get a full path to the file or Windows program? Python

Author

Date

Category

How to get the full path to the file or program in Windows, for its / its further opening using subprocess?


Answer 1, Authority 100%

import os
Print (os.path.abspath ("MyDir / MyFile.txt"))
'C: /Example/cwd/Mydir/myFile.txt'

borrowed here
https://stackoverflow.com/questions/51520/how- to-get-an-absolute-file-path-in-python

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions