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-list
python-list
Re: removing spaces from front and end of filenames
by Erik Max Francis other posts by this author
Jul 13 2003 1:49AM messages near this date
Re: removing spaces from front and end of filenames | Re: Small Python, Java comparison
hokiegal99 wrote:

>  This script works as I expect, except for the last section. I want the
>  last section to actually remove all spaces from the front and/or end
>  of
>  filenames. For example, a file that was named "  test  " would be
>  renamed "test" (the 2 spaces before and after the filename removed).
>  Any
>  suggestions on how to do this?

That's what the .strip method, which is what you're using, does.  If
it's not working for you you're doing something else wrong.

-- 
   Erik Max Francis && max@[...].com && http://www.alcyone.com/max/
 __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/  \ The meaning of life is that it stops.
\__/  Franz Kafka
-- 
http://mail.python.org/mailman/listinfo/python-list
Thread:
hokiegal99
Bengt Richter
Bengt Richter
Bengt Richter
hokiegal99
Stephen Horne
Stephen Horne
Erik Max Francis
hokiegal99
hokiegal99
Jeff Epler
Erik Max Francis

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