程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python adds or deletes a line of content in yaml file

編輯:Python

Locations:
MAIN_0001: [-1.3401, -8.2084, 1.2036]
MAIN_0002: [-1.3918, -6.0548, 1.2036]
MAIN_0003: [-1.2194, -3.5139, 1.2036]
MAIN_0004: [-1.1109, -1.3228, 1.2036]
MAIN_0005: [-1.0324, 1.2392, 1.2036]
MAIN_0006: [-1.1030, 2.5668, 1.2036]
MAIN_0007: [-1.1669, 4.7799, 1.2036]
MAIN_0008: [-1.2177, 6.0613, 1.2036]
MAIN_0009: [-1.1781, 10.0640, 1.2036]
PICKING_0001: [-11.9054, -7.9195, 0.0100]
PICKING_0002: [-9.9039, -7.8358, 0.0100]
PICKING_0003: [-7.9513, -7.8522, 0.0100]
PICKING_0004: [-6.0331, -8.0235, 0.0100]
PICKING_0005: [-4.1481, -7.9870, 0.0100]
PICKING_0006: [-2.1453, -8.0850, 0.0100]
PICKING_0007: [-0.2846, -6.6251, 1.5708]
PICKING_0008: [-0.2846, -6.6251, 2.0344]
PICKING_0009: [-4.0708, -6.0565, 3.1416]
Route:

  • [PICKING_0001, PICKING_0002]
  • [PICKING_0002, PICKING_0003]
  • [PICKING_0003, PICKING_0004]
  • [PICKING_0004, PICKING_0005]
  • [PICKING_0005, PICKING_0006]
  • [PICKING_0007, PICKING_0008]
  • [PICKING_0009, PICKING_0010]
  • [PICKING_0010, PICKING_0011]
  • [PICKING_0011, PICKING_0012]
  • [PICKING_0012, PICKING_0013]
  • [PICKING_0013, PICKING_0014]
  • [PICKING_0015, PICKING_0016]
  • [PICKING_0016, PICKING_0017]
  • [PICKING_0017, PICKING_0018]
    Like above yaml file , It's made up of two parts :
    Locations: What is recorded inside is the name of the point / coordinate
    Route: It records the path between points
    How to use python The script implements the following operations :
    One ,python3 x.py locations_delete MAIN_0001
    Delete the above yaml In file Locations Inside MAIN_0001: [-1.3401, -8.2084, 1.2036] This business
    Two ,python3 x.py routes_delete PICKING_0001 PICKING_0002
    Delete the above yaml In file ,Route Inside , - [PICKING_0001, PICKING_0002]
    3、 ... and , Two ,python3 x.py routes_add PICKING_0001 PICKING_0002
    above yaml In file ,Route Inside , add to , - [PICKING_0001, PICKING_0002]
    I study by myself python, The level is not high , Thought for a long time and failed to realize , Thanks for your help , Thank you for

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved