Using absolute unix paths in windows with python

Use os.path.abspath(), and also os.path.expanduser() for files relative to the user’s home directory: print os.path.abspath(“/var/lib/blob_files/myfile.blob”) >>> C:\var\lib\blob_files\myfile.blob print os.path.abspath(os.path.expanduser(“~/blob_files/myfile.blob”)) >>> C:\Users\jerry\blob_files\myfile.blob These will “do the right thing” for both Windows and POSIX paths. expanduser() won’t change the path if it doesn’t have a ~ in it, so you can safely use it with all paths. … Read more

brew doctor says “Error: /usr/bin occurs before /usr/local/bin” how to fix?

$PATH is just a variable containing a string. To put something in front: % PATH=/usr/local/bin:$PATH % echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin This is not dangerous, since it only applies to the current shell you have open (it will not affect the path for your system or other shells). To change the path automatically for all shells you … Read more