ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-tutor
python-tutor
Re: [Tutor] Alternative File I/O for Tuples (fwd)
by Don Parris other posts by this author
Jun 29 2005 10:09PM messages near this date
Re: [Tutor] Alternative File I/O for Tuples (fwd) | [Tutor] Windows user variable ?
On Wed, 29 Jun 2005 14:09:41 -0400
Kent Johnson <kent37@[...].net>  wrote:

>  Don Parris wrote:
>  > ### playing with wrapfunc (all other args are the same) ###
>  > wrapfunc=lambda x:wrap_onspace(str(rows), x))
>  > 
>  > also
>  > wrapfunc=lambda x:str(wrap_onspace(rows, x)))
>  
>  This is way off base. wrap_onspace takes two arguments - the string to
>  wrap, and the width to wrap to. You are passing it two arguments - the
>  tuple of tuples to print, and the string to wrap.
>  
>  > 

Success!!!  

    mbrPhone = open('mbrPhone.txt', 'w')
    mbrPhone.write(indent(Results, hasHeader=False, separateRows=False,
    prefix='', postfix='', justify='left', wrapfunc=lambda x:str(x)))   
    mbrPhone.close()

I went back to your e-mail where you told me to use x:str(x) and re-tried
that.  I must have broken (or re-broken) something, while fixing something
else. when I tried your suggestion, it wouldn't work.  So I was trying to
fix the wrong break.  Anyway, it works beautifully- 100% accurate data:


James     | Austin    | 704-111-1234
Janet     | Austin    | 704-111-1234
James     | Austin    | 704-111-1234
Julie     | Austin    | 704-111-1234
Robert    | Bates     | 704-222-2345
Rachael   | Bates     | 704-222-2345
Bob       | Brown     | None        
David     | Carter    | 704-111-2345

That's just a sample of the complete file.

And thanks for not giving up on me!

Don
-- 
evangelinux    GNU Evangelist
http://matheteuo.org/                   http://chaddb.sourceforge.net/
"Free software is like God's love - you can share it with anyone anytime
anywhere."
_______________________________________________
Tutor maillist  -  Tutor@[...].org
http://mail.python.org/mailman/listinfo/tutor
Thread:
Danny Yoo
Kent Johnson
Don Parris
Don Parris
Kent Johnson
Don Parris
Kent Johnson
Don Parris
Kent Johnson
Don Parris
Kent Johnson
Don Parris

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved