p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Open Source > Python
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read

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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 19th, 2007, 11:10 PM
Ave Ave is offline
Registered User
 
Join Date: Aug 2007
Location: Seattle, , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old June 3rd, 2008, 02:11 PM
Registered User
 
Join Date: Jun 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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__
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying the remainder curiaquita C++ Programming 1 October 2nd, 2008 02:10 PM
Image not displaying shoakat ASP.NET 2.0 Professional 2 June 22nd, 2007 11:02 AM
gridview not displaying sarah lee ASP.NET 2.0 Basics 5 December 30th, 2006 05:28 AM
Displaying My Data jamil umar ASP.NET 2.0 Basics 0 June 5th, 2006 10:48 AM
Displaying images inbox Classic ASP XML 2 May 4th, 2005 04:08 AM



All times are GMT -4. The time now is 04:18 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc