Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Open Source > Python
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Python section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 19th, 2007, 10:10 PM
Ave Ave is offline
Registered User
 
Join Date: Aug 2007
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.

 
Old June 3rd, 2008, 01:11 PM
Registered User
 
Join Date: Jun 2008
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__





Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying the remainder curiaquita C++ Programming 1 October 2nd, 2008 01:10 PM
Image not displaying shoakat ASP.NET 2.0 Professional 2 June 22nd, 2007 10: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 09:48 AM
Displaying images inbox Classic ASP XML 2 May 4th, 2005 03:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.