Guest User

Untitled

a guest
Jan 17th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. -w, --windows print Windows form of NAMEs (C:WINNT)
  2.  
  3. [cfati@cfati-5510-0:/cygdrive/e/Work/Dev/StackOverflow/q054237800]> cygpath.exe -w /cygdrive/c/location/of/file.html
  4. C:locationoffile.html
  5.  
  6. >>> import subprocess
  7. >>>
  8. >>>
  9. >>> def get_win_path(cyg_path):
  10. ... p = subprocess.Popen(["cygpath", "-w", cyg_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  11. ... o, _ = p.communicate()
  12. ... return o.strip(b"n").decode()
  13. ...
  14. >>>
  15. >>> print(get_win_path("/cygdrive/c/location/of/file.html"))
  16. C:locationoffile.html
Add Comment
Please, Sign In to add comment