cheat.sh icon indicating copy to clipboard operation
cheat.sh copied to clipboard

Python lib for making calls

Open dstrohl opened this issue 7 years ago • 2 comments

If there was a python lib for this, it could be used within the python shell in my ide (PyCharm), or probably any other decent ide, with little or no special plugins needed. Secondarily, a windows command option would be helpful since the bash script nor curl works with windows without something like cywin. (and please no windows bashing, I prefer Linux as well, but you work with what you are given at many jobs).

dstrohl avatar Jul 17 '18 18:07 dstrohl

The requests module in python can get the job done.

natesales avatar Oct 30 '18 03:10 natesales

and there is a small snippet

def cht(query):
    import requests
    ans=requests.get("https://cht.sh/"+query+"?T")
    print(ans.text)

Then you can just call something cht("python/how+to+make+a+list")

dbeniamine avatar Oct 30 '18 08:10 dbeniamine