Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
how to display the return type of an os method?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Robert P. J. Day  
View profile  
 More options Nov 8, 5:12 am
Newsgroups: comp.lang.python
From: "Robert P. J. Day" <rpj...@crashcourse.ca>
Date: Sat, 7 Nov 2009 13:12:27 -0500 (EST)
Local: Sun, Nov 8 2009 5:12 am
Subject: how to display the return type of an os method?

  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:

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

<class 'posix.stat_result'>


  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
========================================================================


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bruno Desthuilliers  
View profile  
 More options Nov 8, 4:29 am
Newsgroups: comp.lang.python
From: Bruno Desthuilliers <bdesth.quelquech...@free.quelquepart.fr>
Date: Sat, 07 Nov 2009 18:29:58 +0100
Local: Sun, Nov 8 2009 4:29 am
Subject: Re: how to display the return type of an os method?
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:

>>>> x=os.stat('/etc/passwd')
>>>> type(x)
> <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)


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert P. J. Day  
View profile  
 More options Nov 8, 5:50 am
Newsgroups: comp.lang.python
From: "Robert P. J. Day" <rpj...@crashcourse.ca>
Date: Sat, 7 Nov 2009 13:50:19 -0500 (EST)
Local: Sun, Nov 8 2009 5:50 am
Subject: Re: how to display the return type of an os method?

  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
========================================================================


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google