Specifying curl command in a python list of strings

I have been trying to use the following curl command in a python code like this : cmd_terms = [
‘curl’, ‘-v’, ‘-u’,
os.environ[username],
‘:’,
os.environ[password],
‘–verbose’,
‘-X’,
‘POST’,
https://triggeredbuild’,
‘–data-urlencode’,
‘json='{"parameter":[{“name”:“Numversion”, “value”:"“versionvalue”’"}]}',
]
but it errors out everytime I try to use the json line in the string. Could someone please help me with this?

Don’t be shy, tell us what sort of error you get. If you get a traceback with an exception, copy and paste the full traceback as text and post it between “code fences” like this:

```
paste your traceback here
```

That’s three backticks on their own line as the fences. Do the same for syntax errors.

If you’re getting some other error, please tell us exactly what error you get.

When I try using your code, I get a syntax error caused by the two asterisks at the start of the JSON line:

  File "<stdin>", line 11
    **'json=\'{\"parameter":[{"name":"Numversion", "value":""versionvalue"'"}]}',**
    ^^
SyntaxError: invalid syntax

I suggest you remove those two asterisks, and the pair at the end of the line, and see if that helps.

It’s best to post the exact actual code you are using, without inserting extra markup. Otherwise it is hard for us to tell which errors are caused by your code and which are caused by the modifications you made to the code when posting.