[Tutor] Lost, and Asking for Dir()-ections

Curtis Larsen curtis.larsen@Covance.Com
Thu, 10 Feb 2000 08:58:15 -0600


Probably a silly question, but I'm new to this object-oriented stuff.

When doing a dir(object) to see what functions/methods are available in
a script, how do I know if something is a function or a method?  I ask
because after I use dir() on a script, I try doing a
"scriptname.functionname() to call up the likely thing I want to do --
"urllib.test()" for example.

I tried doing this with a recent script I picked up, and after doing the
same thing ("scriptname.blah()"), it returned "<scriptname.objectname
instance at memorylocation>".  It wouldn't actually do what I was
looking for until I gave it an equation such as "x=scriptname.blah()". 
Then an "x" object was created with property values, etc., that
contained what I was looking for.

How would I recognize the need for using this equation notation in the
future?
(What's the diff?)

Yes, I know I can just read the script to further understand it -- and I
do that a lot -- but (as part of the whole "learning Python" process)
I'm interested in writing a script that does that on it's own for me.  I
can write a script that does vars() and dir() against scripts, checks
out any __doc__ stuff it finds, and then prints the results, but how
would I tell it to perceive the difference between
"scriptname.something(args)" working and having to do an
"x=scriptname.something(args)" to get the "something" to work?

(Can you tell I'm confused about this?)

Any suggestions, advice, pointing-in-the-right-direction, or
go-read-the-specific-docs-at-this-site information is welcome.

Thanks!
Curtis
 

begin 644 TEXT.htm
M/"%$3T-465!%($A434P@4%5"3$E#("(M+R]7,T,O+T141"!(5$U,(#0N,"!4
M<F%N<VET:6]N86PO+T5.(CX-"CQ(5$U,/CQ(14%$/@T*/$U%5$$@8V]N=&5N
M=#TB=&5X="]H=&UL.R!C:&%R<V5T/6ES;RTX.#4Y+3$B(&AT='`M97%U:78]
M0V]N=&5N="U4>7!E/@T*/$U%5$$@8V]N=&5N=#TB35-(5$U,(#4N,#`N,C<R
M,BXQ,S`P(B!N86UE/4=%3D52051/4CX\+TA%040^#0H\0D]$62!B9T-O;&]R
M/2-F9F9F9F8@#0IS='EL93TB1D].5#H@,3!P="!!<FEA;#L@34%21TE.+4Q%
M1E0Z(#)P>#L@34%21TE.+51/4#H@,G!X(CX-"CQ$258^4')O8F%B;'D@82!S
M:6QL>2!Q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.SPO1$E6/@T*/$1)5CXH0V%N('EO=2!T96QL($DG;2!C;VYF=7-E9"!A8F]U
M="!T:&ES/RD\+T1)5CX-"CQ$258^)FYB<W`[/"]$258^#0H\1$E6/D%N>2!S
M=6=G97-T:6]N<RP@861V:6-E+"!P;VEN=&EN9RUI;BUT:&4M<FEG:'0M9&ER
M96-T:6]N+"!O<B`-"F=O+7)E860M=&AE+7-P96-I9FEC+61O8W,M870M=&AI
M<RUS:71E(&EN9F]R;6%T:6]N(&ES('=E;&-O;64N/"]$258^#0H\1$E6/B9N
M8G-P.SPO1$E6/@T*/$1)5CY4:&%N:W,A/"]$258^#0H\1$E6/D-U<G1I<SPO
B1$E6/@T*/$1)5CX@/"]$258^/"]"3T19/CPO2%1-3#X-"B!(
`
end


-----------------------------------------------------
Confidentiality Notice: This e-mail transmission 
may contain confidential or legally privileged 
information that is intended only for the individual 
or entity named in the e-mail address. If you are not 
the intended recipient, you are hereby notified that 
any disclosure, copying, distribution, or reliance 
upon the contents of this e-mail is strictly prohibited. 

If you have received this e-mail transmission in error, 
please reply to the sender, so that Covance can arrange 
for proper delivery, and then please delete the message 
from your inbox. Thank you.