Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4983

Raspberry Pi OS • Re: Use of curl vs. pycurl and correct syntax

$
0
0
Thonny reports a SyntaxError at the quote after the closing }"
Are you trying to run the command from a console/terminal in Linux, or are you trying to run the command from Python using subprocess?

If you are trying to grab the output from the command in Python, you could try to use something like:

Code:

from subprocess import check_outputpost_json = '{"command": "sendCameraCommand","cameras": ["GoPro 9464"],"cameraCommand": "startRecording"}'curl_out = check_output(['curl', '-d', post_json, 'http://192.168.0.108:809'])#Do something with "curl_out"

Statistics: Posted by NotRequired — Fri Apr 12, 2024 5:24 pm



Viewing all articles
Browse latest Browse all 4983

Trending Articles