victorsubervi at gmail.com
Sat Jan 9 19:18:26 CET 2010
On Sat, Jan 9, 2010 at 11:56 AM, Gary Herron <gherron at islandtraining.com>wrote:
> Victor Subervi wrote:
>> I have a string.join statement on a variable that comes from a
>> cgi.FieldStorage().getlist. The variable may be a list or a single value. I
>> need to treat it differently depending on which it is. How can I distinguish
>> it? len(var) will obviously give me the length of the string if it's a
>> string and the length of the list if it's a list.
> Like this:
> if isinstance(var, list):
> ... join ...
> ... ??? ...
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list