Skip to content

Instantly share code, notes, and snippets.

@lorenzoriano
Created May 21, 2012 23:33
Show Gist options
  • Save lorenzoriano/2765394 to your computer and use it in GitHub Desktop.
Save lorenzoriano/2765394 to your computer and use it in GitHub Desktop.
Get Paths Script
#!/usr/bin/env python
import sys
rospkgs = sys.argv[1:]
import roslib
for rospkg in rospkgs:
roslib.load_manifest(rospkg)
paths = [path for path in sys.path if not path.startswith('/usr')]
#create a set to remove repetitions
path_set = set(paths)
pathstr = ':'.join(path_set)
print pathstr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment