Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Open Source > BOOK: Beginning Python: Using Python 2.6 and Python 3.1
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 3rd, 2010, 07: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")
'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.
Reply With Quote
Reply


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 05:42 AM
Is the book available in text format sawyer4444 BOOK: Access 2003 VBA Programmer's Reference 7 September 22nd, 2004 08:53 AM
Error: Invalid PInvoke metadata format shahchi1 General .NET 1 May 26th, 2004 09:16 AM



All times are GMT -4. The time now is 05:28 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.