github.com/GuanceCloud/cliutils@v1.1.21/pipeline/ptinput/funcs/md/use.en.md (about)

     1  ### `use()` {#fn-use}
     2  
     3  Function prototype: `fn use(name: str)`
     4  
     5  Parameter:
     6  
     7  - `name`: script name, such as abp.p
     8  
     9  Function description: call other scripts, all current data can be accessed in the called script
    10  
    11  Example:
    12  
    13  ```python
    14  # Data to be processed: {"ip":"1.2.3.4"}
    15  
    16  # Process script a.p
    17  use(\"b.p\")
    18  
    19  # Process script b.p
    20  json(_, ip)
    21  geoip (ip)
    22  
    23  # Execute the processing result of script a.p
    24  {
    25     "city" : "Brisbane",
    26     "country" : "AU",
    27     "ip" : "1.2.3.4",
    28     "province" : "Queensland",
    29     "isp" : "unknown"
    30     "message" : "{\"ip\": \"1.2.3.4\"}",
    31  }
    32  ```