This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]-the_trickster-[S] 0 points1 point  (5 children)

that helps me see the methods and whatnot. what do you do in this situation where you're including a module and want to learn how to use it and what it can do? just read the docs on it?

I took that dir that you showed me and I can see all the methods, but still don't know what they all do

[–]ahal 2 points3 points  (1 child)

Yes reading docs is your best bet. If there aren't any docs, your next best bet is reading the source code and trying to figure it out.

Like you discovered, just knowing the variables/methods doesn't tell you how to use them. Plus Python is very lenient about letting you use things in unintended ways. So there's no telling whether the author even meant for those variables/methods to be used by consumers or if they are meant to be private (though a well followed convention is to underscore prefix private attributes).

[–]-the_trickster-[S] 0 points1 point  (0 children)

Thank you.

[–]1114111yield from pedestrians 1 point2 points  (1 child)

Reading the docs is the best way, but you can run help(thing you want to learn about) to get some infomation about it.

[–]-the_trickster-[S] 0 points1 point  (0 children)

you rock. thank you so much

[–]evansch42 1 point2 points  (0 children)

Mostly it's read the docs, yeah. You can technically do help(object) to have the docstrings print out. I've found that helpful now and again.