powershell: execute python code passed as arguments

Viewed 28

This is what happens when I try to run python code through the powershell prompt.

PS > python -c 'import json; d = {"type": "info" }; print(json.dumps(d))'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'info' is not defined
PS >

What is the correct way to write the powershell statement to do this?

0 Answers
Related