Python Forum

Full Version: python documentation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Does anyone know where I can get a python 2 / 3 API? The documentation that ships with python is a disaster. Thanx for your help.
you can use the embedded help function in python for docs
>>> help(int)
or you could look at the online docs
https://docs.python.org/3/library/index.html
Quote:The documentation that ships with python is a disaster.
How so, it's extremely verbose, but this is what any good programmer begs for.
(Jun-11-2018, 02:26 PM)Larz60+ Wrote: [ -> ]
Quote:The documentation that ships with python is a disaster.
How so, it's extremely verbose, but this is what any good programmer begs for.

Maybe he means that he needs something more simple.. In that case I think it's better you rely on tutorials made by other people or even video tutorials because they explicitly focus on beginners, even then the documentation is supposed to be beginner friendly for the most part..
One of the quick references that I most like for python 2 is this one, with the nice feature that you can see in which version was each feature introduced (nice when you need to work with archaeological systems)
Unfortunately I do not know an equivalent for python 3...
(Jun-11-2018, 11:55 AM)j4py Wrote: [ -> ]Does anyone know where I can get a python 2 / 3 API? The documentation that ships with python is a disaster. Thanx for your help.
do you have an example of documentation, for something, that is not the disaster you think Python has?
Hi all, when i was doing java in school the api was so structured it was easy to find a method or a class... i was looking for. the problem with python's doc is it is too cumbersome with lots of unwanted outputs (at least in my case). Say type string, and all i want is methods i can apply to strings, but i get all kinds of results that i have to go through which is why i said it is a disaster. Java's api is so simple and clear, if i want methods related to strings, that's all i get, which saves me time. thank you all for your replies.
Btw: help(x) is really the kind of a simple output i was looking for & shame on me for not thinking about that, but thanx for pointing it out for me.
(Jul-05-2018, 09:37 AM)j4py Wrote: [ -> ]Say type string, and all i want is methods i can apply to strings, but i get all kinds of results that i have to go through which is why i said it is a disaster.
really?
>>> dir(str)
['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__
format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__get
slice__', '__gt__', '__hash__', '__init__', '__le__', '__len__', '__lt__', '__mo
d__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__',
 '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook
__', '_formatter_field_name_split', '_formatter_parser', 'capitalize', 'center',
 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'index
', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper',
'join', 'ljust', 'lower', 'lstrip', 'partition', 'replace', 'rfind', 'rindex', '
rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', '
strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
>>>
then use help, if you not able to navigate in the online docs
I don't know what you mean by Python API. You can write APIs, of many forms, in Python but I'm not aware of it having an API itself. Happy to learn otherwise.
(Jul-05-2018, 09:37 AM)j4py Wrote: [ -> ]Say type string, and all i want is methods i can apply to strings, but i get all kinds of results that i have to go through which is why i said it is a disaster.
Then you may using the wrong tool there a a lot of tools that will show method and help automatic.
REPL like IPython(or browser Jupyter notebook) | ptpython and editors to mention eg VS Code,PyCharm...ect.
The will show string method automatically when type . or for any other type used list,dict,int...ect.

What do i mean?
Here a collection as this can be useful for other to that may not know this.
VS Code:
[Image: PS6pe9.jpg]
Mouse over any code count() in this case,then IntelliSense step in.
[Image: prUCR0.jpg]
Cmder with ptpython:
[Image: oi6wqC.jpg]
Jupter Notebook:
[Image: RuThtG.jpg]
Cmder IPython:
[Image: AA12FQ.jpg]
Pages: 1 2