If I run the following code in CMD, I get the following output:.
curl -d "text=Hello there" http://bark.phon.ioc.ee/punctuator
Hello, there.
How do I run the same code using Python and store the output, i.e. "Hello, There" in a string
I tried the following python code:
import os
a=os.system('curl -d "text=Hello There" http://bark.phon.ioc.ee/punctuator')
type(a)
print(a)
I want to store the output in a variable, however type(a)
gives int class <int>
as output. How do I put my output in the form of a string and store Hello, there
in a variable?