str().join() isn't working

Carsten Haese carsten at uniqsys.com
Mon Aug 20 14:31:54 EDT 2007


On Mon, 2007-08-20 at 13:16 -0500, Robert Dailey wrote:
> here is a more realized example of the lists I'm trying to join:
> 
> 
> _user_includes = [
> 	"../src",
> # [snip]
> 	]
> 
> _system_includes = [
> 	"../../../../../../Symbian/9.1/NGAGE_SDK_1.1/EPOC32/include",
> # [snip]
> 	]

>  includes = space.join ( system._user_includes ) + " " + space.join(
>  system._system_includes )

>  The above does not work. The interpreter states: "TypeError: sequence item
>  0: expected string, list found". I'm not sure what this means. Can anyone
>  help me figure out what I'm doing wrong? Thanks.

The error message means that join() expected the list to contain
strings, but it found a list instead.

There must be something else happening that you're not telling us.
Running that join expression on the lists you quoted works just fine.
Either the lists contain something other than what you claim, or the
expression you're using is different in reality.

We can't help you if you don't post the code you're running.

HTH,

-- 
Carsten Haese
http://informixdb.sourceforge.net





More information about the Python-list mailing list