Python Forum

Full Version: Which IDE comes with help ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am newb to python. I am used to AutoTI programming that as help file thats no match to any help file on earth.
If you hover over a function and press F1, it takes you straight to help page where it explains what this function is, what library it requires to include and give example and return values as well as links to related functions.

Is there an IDE that does anything remotely close to what AutoIT help does ?
AutoIT uses Scite version specifically made for AutoIT.

Can you guys help ?
I dont want to go https://docs.python.org/3/py-modindex.html#cap-_ every time i need to know some basic function and what library it requries, i need it to be supplied with the editor.


I have pycharm, but i dont see how it helps me at all except for helping with typing the code (very poorly compared to AutoIT)
It a little bit too ambiguous for me. Please define more narrowly what do you mean by 'help'.

Python have built-in help which is accessible from interactive interpreter by entering 'help'.

>>> help()

Welcome to Python 3.8's help utility!

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at https://docs.python.org/3.8/tutorial/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, symbols, or topics, type
"modules", "keywords", "symbols", or "topics".  Each module also comes
with a one-line summary of what it does; to list the modules whose name
or summary contain a given string such as "spam", type "modules spam".


If help about specific function or method needed use 'help' with specific term (hit Q to exit help):


>>> help(str.join)
Help on method_descriptor:

join(self, iterable, /)
    Concatenate any number of strings.
    
    The string whose method is called is inserted in between each given string.
    The result is returned as a new string.
    
    Example: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'


Regarding IDE I believe that all of them have some sort help/hinting built-in. My personal bias is toward VS Code.
Why go to the module index? I always go to the Library Reference. It's organized by topic, so it's much easier to navigate. But even a general web search of "python whatever" usual gives me a direct link to the documentation for whatever.
This is not a direct answer but as I work on Linux, I always have a terminal open on my desktop. I created a small program named 'pyman', so that when I type in the console for example
Output:
pyman xmlrpc
it will open these search results in the default web browser. Here is this command's code. Enjoy the rich features Wink
#!/usr/bin/env python3
# -*-coding: utf8-*-
# pyman -- program to browse python documentation.
import argparse
import webbrowser

__version__ = '2019.11.8'

def main(word, version):
    assert version in (2, 3)
    url = "https://docs.python.org/{}/search.html".format(
        version) + ('?q=' + word if word else '')
    webbrowser.open(url)

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description="Search python documentation")
    parser.add_argument('-v', '--version', dest='version', type=int, help='Python version 2 or 3. Defaults to 3.', default=3)
    parser.add_argument('word', metavar='WORD', help='The word to search',
                        default='', nargs='?')
    ns = parser.parse_args()
    main(ns.word, ns.version)
(Nov-08-2019, 01:51 PM)ichabod801 Wrote: [ -> ]Why go to the module index? I always go to the Library Reference. It's organized by topic, so it's much easier to navigate. But even a general web search of "python whatever" usual gives me a direct link to the documentation for whatever.

I dont like to use internet for that. I was hoping that pressing F1 over a key word of interest would bring up the help documentation pointing directly at it, providing explanation and examples.
Instead it goes to online page.

Also: Library Reference does not include win32gui library which in my opinion should be shipped with python as well as many other popular libraries that are used in almost any project for Windows users.

What makes my life hard is that i came from a language that has it all. Learning python seems like a downgrade in terms of help and orientation, as well as something basic as to: visually being able to identify a variable (seems impossible when every word i see looks the same)
Once again, can you be more specific about your problem(s)? If you look for advice you should let know what editor you use etc.

Regarding 'visually being able to identify a variable' - what do you mean by that?

Maybe some tidbits about dynamic typing (Ned Batchelder: Facts and Myths about Python names and values)

Quote:Names are Python’s variables: they refer to values, and those values can change (vary) over the course of your program.

Any name can refer to any value at any time. Python is dynamically typed, which means that names have no type. Any name can refer to any value at any time. A name can refer to an integer, and then to a string, and then to a function, and then to a module.

Names have no type, values have no scope. Just as names have no type, values have no scope. When we say that a function has a local variable, we mean that the name is scoped to the function: you can’t use the name outside the function, and when the function returns, the name is destroyed. But if the name’s value has other references, it will live on beyond the function call. It is a local name, not a local value.
(Nov-18-2019, 08:36 AM)perfringo Wrote: [ -> ]Once again, can you be more specific about your problem(s)? If you look for advice you should let know what editor you use etc.
Regarding 'visually being able to identify a variable' - what do you mean by that?
Maybe some tidbits about dynamic typing (Ned Batchelder: Facts and Myths about Python names and values)

I am using pycharm. When i press F1 over something, it takes me to wesite.
For example, if i have a code tk.Entry, pressing F1 over word Entry will take me to a website that has very very base explanation of what Entry is and how it works without giving any examples.

I was hoping there is an IDE that will open up a well made documentation specific for Python coding and pressing F1 would take you directly to specific page you request help for, Entry in this case.

Visually identifying variable: I mean being able to look at a name and be able to tell INSTANTLY its a variable.
If it has some kind of obvious prefix such as $Variable, then it would be easily visually identifiable.

For a newb like me, all those "names" are confusing and pycharm does very little to differentiate then with color.
In fact, PyCharm has no clue that one or another "name" is actually a variable. (i mean it cannot color it specifically because they are not unique by any means)

If variable had prefix symbol or any kind, it would be easier to tell what is a variable and what is not without the need to somewhat study the code. It would be extremely obvious and make learning/understanding the code easier.
Look+think= Aha, its a variable, vs Look=Aha its a variable is 33% efficiency gain.
I identified following issues from your post:

1. website that has very very base explanation of what Entry is and how it works without giving any examples.

2. being able to look at a name and be able to tell INSTANTLY its a variable.

regarding # 1:

Everybody has is own learning curve as well as personal preferences. Some ideas regarding help:

- use built-in interactive help
- use VS Code IntelliSense or equivalents in other editors
- use Kite and it's Copilot (kite.com)

Quality of help documentation is varying. One must understand, that Python is open source and core developers annual salary is $0 (as one of core-developers Raymond Hettinger has put it: 'Guido doubles my salary every year'). We enjoy the results of good work of core developers for free and it would be unfair to blame them for help documentation which don't include examples.

regarding # 2:

Everything in Python is an object. So every name is 'variable'. There is visual clue of creating variable - it's assignment =.

Never used a PyCharm, but I believe numerics, strings etc values (not names) are in different colors as well as built-in keywords.

Python uses duck typing and easier to ask for forgiveness than permission. One approach could be to focus on what you do with your data not what type it is.