|
|
 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Python section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

August 19th, 2007, 11:10 PM
|
|
Registered User
|
|
Join Date: Aug 2007
Location: Seattle, , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Displaying _doc_
I'm confused over the _doc_ method on page 63, Chapter 5. It says here to:
"..exit the interactive session that you entered in the last example and re-invoke ch5.py, since it now has the docstring added to in_fridge. After you do that, you can do the following:
>>>print "%s" % in_fridge._doc_
This is a function to see if the fridge has a food.
fridge has to be a dictionary defined outside of the function.
the food to be searched for is in the string wanted_food.
"
WHAT??????
When I do this, nothing happens but a syntax error.
God, you people write books? I hope the authors are fired from their writing jobs, they obviously don't know how to explain programming languages well at all.
For the record, I work on an application development team but use .NET with Visual Studio. I've heard great things about Python but so far the code editor really sucks. The explanations in this book surely do not help.
Tip to the authors: If you are going to waste time writing a book for beginners and then charge them almost $50 to buy it, then you OWE it to them to correctly explain how the editor works so they do not get hung up on it.
This book really sucks, I want my money back.
|

June 3rd, 2008, 02:11 PM
|
|
Registered User
|
|
Join Date: Jun 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hey although this user probably already got an answer to his/her issue with the syntax error associated with ._doc_, I had to continue searching and so will post the answer here for those who come upon this page with the same problem:
use TWO underscores, not ONE--> ._doc_ won't work, instead use .__doc__
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |