Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -w, --windows print Windows form of NAMEs (C:WINNT)
- [cfati@cfati-5510-0:/cygdrive/e/Work/Dev/StackOverflow/q054237800]> cygpath.exe -w /cygdrive/c/location/of/file.html
- C:locationoffile.html
- >>> import subprocess
- >>>
- >>>
- >>> def get_win_path(cyg_path):
- ... p = subprocess.Popen(["cygpath", "-w", cyg_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- ... o, _ = p.communicate()
- ... return o.strip(b"n").decode()
- ...
- >>>
- >>> print(get_win_path("/cygdrive/c/location/of/file.html"))
- C:locationoffile.html
Add Comment
Please, Sign In to add comment