0
req = requests.get("google.com")

When I use the above command and I try to use the req variable, the IDE doesn't give me the available methods for the object - which is a requests.response object. Any hint would be appreciated.

enter image description here

  • Did you try ``print(repr(req))``? – Cyrus Mar 03 '21 at 23:18
  • i have but how would that help me? `repr(req)` gives me the status code and `type(req)` gives me pip._vendor.request.models.Response – user1504725 Mar 03 '21 at 23:25
  • Does this answer your question? -> https://stackoverflow.com/questions/34439/finding-what-methods-a-python-object-has – Cyrus Mar 03 '21 at 23:27
  • @Cyrus, that question is 12 years old. i am hoping updates were made since then. i just want autocomplete/intellisense to tell me the available methods for the object. in other languages and IDE's it's normally a drop down that appears – user1504725 Mar 03 '21 at 23:36
  • Why don't you just use dir() ? – Spiros Gkogkas Mar 03 '21 at 23:49
  • @SpirosGkogkas, i looked up the `dir()` method. i see how 'print(dir(ObjName))' gives you a list of methods, but i am looking for something on the run - while i am typing. is this not available on pycharm? its basically intellisense. – user1504725 Mar 04 '21 at 00:06
  • Can you be more specific? – Spiros Gkogkas Mar 04 '21 at 00:15
  • @SpirosGkogkas, i added a picture. why is it the object `req` doesnt show available methods for the class ? – user1504725 Mar 04 '21 at 00:36
  • @user1504725 Try to check the settings there i have to use a long time pycharm. **Settings > Editor > General > Code Completion > Insert selected variant by typing dot, space, etc.** Hope that helps. – Spiros Gkogkas Mar 04 '21 at 00:45
  • @SpirosGkogkas, didnt work. ty – user1504725 Mar 04 '21 at 00:51
  • @user1504725 give a loot at this [link](https://stackoverflow.com/questions/15022804/pycharm-code-completion-not-giving-recommendations) – Spiros Gkogkas Mar 04 '21 at 00:59
  • @SpirosGkogkas, i figured out the issue. the version of python i was using was 3.8. i updated to 3.9.2. Either it was a bad install or incompatible version. but it works now. ty for your time. – user1504725 Mar 04 '21 at 01:22

1 Answers1

0

Solution: Download and installed the newest python package - https://www.python.org File -> Settings -> Project:<ProjectName> -> Python Interpreter -> select version.