{
"apps": [{
"name": "app_name",
"script": "/the/app/path/my_app.py",
"args": ["-c", "my_config.prod.json"],
"instances": "1",
"wait_ready": true,
"autorestart": false,
"max_restarts": 5,
"interpreter" : "/path/to/venv/bin/python",
}]
}
arr = string.split('|')
arr[1], arr[2] = arr[2], arr[1]
newString = '|'.join(arr)
import re
newString = re.sub(r'(\|\d+)(\|\d+)', r'\2\1', string, 1)