Glob returning an empty list when passed a variable

Steven D'Aprano steve at REMOVE.THIS.cybersource.com.au
Fri Feb 9 18:23:46 EST 2007


On Fri, 09 Feb 2007 14:15:51 +0000, Steve Holden wrote:

> area_name_string = '*% s*' % (Area_name)
> 
> Interesting, I never realised until now that you can have spaces between 
> the percent sign and th format effector.

Space is one of the flags. From the docs:


The conversion flag characters are:

Flag 	Meaning
# 	The value conversion will use the ``alternate form'' (where defined
        below).
0 	The conversion will be zero padded for numeric values. 
- 	The converted value is left adjusted (overrides the "0" conversion if
        both are given).
  	(a space) A blank should be left before a positive number (or empty
  	string) produced by a signed conversion.
+ 	A sign character ("+" or "-") will precede the conversion (overrides a
        "space" flag).


http://docs.python.org/lib/typesseq-strings.html



-- 
Steven.




More information about the Python-list mailing list