|
|
|
|
|
by jhallenworld
3937 days ago
|
|
One issue is the problem of indirect documentation, and it comes down to this one line: "import sys, os, subprocess, glob". How do you find which module you need? Search on the web may be the best answer. In shell at least you have "man -k". Once I know the module, how do I get its documentation? Here at least there is an answer: import glob; help(glob); But how good is this documentation? If I do it I get: glob(pathname)
Return a list of paths matching a pathname pattern.
The pattern may contain simple shell-style wildcards a la fnmatch.
Already python is telling me that the "man" documentation is going to be better :-). |
|
Experience, stdlib reference, web searches. Same as with bash.
> In shell at least you have "man -k".
I really disagree here. Since you took `glob` as an example, how do you get to the explanation of `for test in *.in`? Go on, try that with "man -k".
> Already python is telling me that the "man" documentation is going to be better
I'm not trying to say python is good here (well, the stdlib documentation on the web is actually pretty good, it's just not easily available from the console). But the idea that bash/man is more discoverable is just wrong... You can find the glob under "Pattern Matching" section which is all right, but you need to understand most of the expansion mechanism of shell to know it applies to "for". Then again "for" itself has a definition that belongs more to a CS material, than to a usage guide.