Wrox Programmer Forums
BOOK: Beginning Python: Using Python 2.6 and Python 3.1
This is the forum to discuss the Wrox book Beginning Python: Using Python 2.6 and Python 3.1 by James Payne; ISBN: 978-0-470-41463-7
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Python: Using Python 2.6 and Python 3.1 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 July 3rd, 2010, 06:07 PM
Registered User
Join Date: Jul 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error in the book on format specifiers?

In the book Beginning Python by James Payne it says "Whenever you right a negative (-) in your format specifier, the format occurs to the left of the word. If there is just a number with no negative it occurs to the right". )

Well.... I must not understand what he means, or there must be an error in his writing. When I type the first example with the negative, it moves to the right. In the second, it moves to the left.

I also noticed that he wrote right instead of write, so this whole sentence might be an error.

>>> "%-30s %s" % ("Hello", "Hi")

>>> "%30s %s" % ("Hello", "Hi")
'______________________________Hello Hi'

The underlines represent spaces, the spaces don't show on the post if I don't underline the area.

Similar Threads
Thread Thread Starter Forum Replies Last Post
electronic format of book patelc75 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 23 November 6th, 2006 03:00 PM
"Invalid object format name" Error welles Crystal Reports 2 September 27th, 2006 04:42 AM
Is the book available in text format sawyer4444 BOOK: Access 2003 VBA Programmer's Reference 7 September 22nd, 2004 07:53 AM
Error: Invalid PInvoke metadata format shahchi1 General .NET 1 May 26th, 2004 08:16 AM

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