Michel van der List via plug on 18 Feb 2021 11:29:11 -0800 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: [PLUG] Slightly off topic, debugging python |
What brent timothy saner said earlier.
A simple snippet: #!/usr/bin/python import requests import logging logging.basicConfig(level=logging.DEBUG) r = requests.get("https://www.google.com") print(r.status_code) print(r.content)
You can get much fancier. But that hopefully show the idea.
On 2/18/21 1:01 PM, Michael Lazin via plug wrote:
I wrote a script which makes api calls over the internet and I am getting unexpected results. It is making a web request. I am using pycharm. Can anyone tell me how to set pycharm for verbose output so I can see the web server's response code? I suspect that I am getting an http error code which causes the unexpected output. I hope that this isn't too much to ask. I am an experienced Linux user but I am new to python programming. Thanks for your help.Sincerely,Michael Lazin___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug
___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug