本文整理汇总了Python中track.Track.hasFacilities方法的典型用法代码示例。如果您正苦于以下问题:Python Track.hasFacilities方法的具体用法?Python Track.hasFacilities怎么用?Python Track.hasFacilities使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类track.Track
的用法示例。
在下文中一共展示了Track.hasFacilities方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: enumerate
# 需要导入模块: from track import Track [as 别名]
# 或者: from track.Track import hasFacilities [as 别名]
latLong = point.strip().split(",")
curPath.append((latLong[1], latLong[0]),)
attributes.append({"w": w, "f": f, "s": s})
paths.append(curPath)
# for path in e.iter(PREFIX + "coordinates"):
# curPath = []
# for point in path.text.strip().split(",0.0")[0:-1]:
# latLong = point.strip().split(",")
# curPath.append((latLong[1], latLong[0]),)
# paths.append(curPath)
for j, i in enumerate(paths):
print("----------------{0}-----------------".format(j))
t = Track(i)
t.hasFacilities = attributes[j]["f"]
t.hasStairs = attributes[j]["s"]
t.hasWater = attributes[j]["w"]
print(t.dist)
print(t.maxIncline)
print(t.meanIncline)
print("w:{0},f:{1},s:{2}".format(attributes[j]["w"], attributes[j]["f"], attributes[j]["s"]))
tracks.append(t)
with open("./tracks.pickle", 'wb') as f:
pickle.dump(tracks, f)
elif sys.argv[1] == "read":
with open("./tracks.pickle", "rb") as f:
tracks = pickle.load(f)
else: