2017-08-16 28 views
-8

我有這個curl命令,我需要在Python運行:如何在Python中執行這樣的curl請求?

curl "https://tts.voicetech.yandex.net/generate?format=wav&lang=ru-RU&speaker=zahar&emotion=good&key=<API‑key>" -G --data-urlencode "text=This text is ready" > speech.wav 
+2

看看Python的'requests'庫。還有一個'pycurl'包裝可用。 –

+0

我的意思是如何在Python中執行「>」命令? –

+0

@AliTlekbay'>'是在[UNIX shell](https://en.wikipedia.org/wiki/Redirection_(computing))中找到的重定向命令。請重新說明您的問題,以澄清您想要做什麼以及問題的確切位置。爲您的第一次嘗試提供代碼永遠不會傷害。 –

回答

0

嘗試使用此命令= curl -X POST -d @/diskless/desktop/file.txt http://username:[email protected]/uploadlink/