xxxxxxxxxx
# use rospkg to get a list of all the packages and their paths
import rospkg
# get an instance of RosPack with the default search paths
rospack = rospkg.RosPack()
# list all packages, equivalent to rospack list
rospack.list()
# get the file path for rospy_tutorials
rospack.get_path('rospy_tutorials')