Python Forum
Trivial novice question: information gathering tools in Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trivial novice question: information gathering tools in Python
#1
I am enrolled in a number of learn-to-code Python Udemy courses. I can’t find the specific tutorial now which covered the different type of built in functions that Python developers have available to them in the Python shell. The only one I remember is type(), where you can enter a parameter such as a variable and then the interpreter returns “str” or “int” or “boolean”, depending on what kind of variable it is. There are similar common tools or functions which will show the docstring (and other information) of builtin functions and methods right in the Python interpreter, without having to look up official documentation on Python’s official website in your web browser. Does anyone know what I a referring to? There are at least 2 more “information gathering” commands but I can’t for the life of me remember what they are called.

I am really not looking forward to sifting through all 25+ hours worth of course content just to find out these essential operations. It’s like finding a needle in a haystack.

I obviously resorted to Google (with the intention of finding the most relevant Stackoverflow answer) but I am having trouble finding the right search terms. For example, I tried searching for term combinations including:
  • ‘python tools for detail methods’
  • ‘python builtin gathering functions’
  • ‘python type function similar’
(and variations)

But I am just not using the right search terms.

I realize my initial question will have a trivial answer.

Even though I feel like I haven’t done the best job explaining, I hope that some forum member knows what I am trying to get at.

Found it!

Here are the functions I was thinking of:
dir()
help()
type()
__doc__
Reply
#2
Quote:where you can enter a parameter such as a variable and then the interpreter returns “str” or “int” or “boolean”,
print(type(variablename))
if you have python interpreter loaded, use:
if for external package, import package first, then
help(packagename) where name can be package name,, function, etc.
example:
>>> import tkinter

>>> help(tkinter)
...
>>> help(tkinter.grid)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Need help for a python script to extract information from a list of files lephunghien 6 1,033 Jun-12-2023, 05:40 PM
Last Post: snippsat
  Help gathering Temperature from API response road102 5 1,019 Dec-16-2022, 08:30 PM
Last Post: road102
  Choosing animation / simulation tools J_Miller 0 1,012 Apr-18-2022, 07:03 PM
Last Post: J_Miller
  [Solved] Novice question to OOP: can a method of class A access attributes of class B BigMan 1 1,267 Mar-14-2022, 11:21 PM
Last Post: deanhystad
  Python Complete novice: Want to run a vulnerability script bhanney23 1 2,945 Sep-18-2020, 09:27 AM
Last Post: Aspire2Inspire
  (Complete Novice) Code not working PythonGainz 9 4,019 Mar-21-2020, 05:53 PM
Last Post: buran
  Novice use of a CSV preliator 1 2,084 Dec-26-2019, 08:05 PM
Last Post: Axel_Erfurt
  video processing tools sveto4ka 2 1,816 Oct-23-2019, 01:27 PM
Last Post: sveto4ka
  Help with pyGenealogical-Tools (Updated) Matan_ran 5 106,902 Oct-16-2019, 08:48 PM
Last Post: Larz60+
  How to gather information from remote host using ansible module in python amritjsr 0 2,005 Jul-20-2019, 01:17 AM
Last Post: amritjsr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020