how to display the return type of an os method?

  • Thread starter Bruno Desthuilliers
  • Start date
B

Bruno Desthuilliers

Robert P. J. Day a écrit :
once again, a thoroughly newbie question but what's the quickest way
to display the return type of, say, os.stat()? i can obviously do
this in two steps:

<class 'posix.stat_result'>

i'd just like to see that os.stat() returns a posix.stat_result
object in one line.

=> type(os.stat('/etc/passwd'))

But reading the doc might help too:

=> help(os.stat)
 
R

Robert P. J. Day

once again, a thoroughly newbie question but what's the quickest way
to display the return type of, say, os.stat()? i can obviously do
this in two steps:

i'd just like to see that os.stat() returns a posix.stat_result
object in one line. how dumb a question is that?

rday
--

========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA

Linux Consulting, Training and Kernel Pedantry.

Web page: http://crashcourse.ca
Twitter: http://twitter.com/rpjday
========================================================================
 
R

Robert P. J. Day

Robert P. J. Day a écrit :

=> type(os.stat('/etc/passwd'))

But reading the doc might help too:

=> help(os.stat)

never mind, i realize now it was a dumb question since the return
type is based on the routine logic, of course. argh. carry on.

rday
--

========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA

Linux Consulting, Training and Kernel Pedantry.

Web page: http://crashcourse.ca
Twitter: http://twitter.com/rpjday
========================================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top