str().join() isn't working
beginner
zyzhu2000 at gmail.com
Mon Aug 20 14:25:23 EDT 2007
On Aug 20, 1:16 pm, "Robert Dailey" <rcdai... at gmail.com> wrote:
> here is a more realized example of the lists I'm trying to join:
>
> _user_includes = [
> "../src",
> "../resource",
> "../inc",
> "../src",
> "../data",
> "../gui",
> "../script",
> "../script/actions",
> "../gui/dispatch",
> "../gui/factories",
> "../gui/frames",
> "../gui/getters",
> "../gui/localization",
> "../gui/player",
> "../gui/setters",
> "../gui/utilities",
> "../sis",
> "../player",
> "../platform/ngi",
> "../../engine",
> "../../engine/audio/NGI",
> "../../engine/io",
> "../../engine/io\NGI",
> "../../engine/math",
> "../../engine/math/fixed",
> "../../engine/path/NGI",
> "../../engine/text/NGI",
> "../../engine/mem",
> "../../engine/text",
> "../../engine/observer",
> "../../sdk/tiny_xml",
> "../../sdk/zlib",
> "../../sdk/lpng",
> "../../sdk/IFDLib/Source/Precompile",
> "../../sdk/IFDLib/Source/CoreLib",
> "../../sdk/IFDLib/inc",
> "../../sdk/IFDLib/Source/UtilLib",
> "../../sdk/IFDLib/Source/GameLib",
> "../../sdk/IFDlib/Source/OSLib/_NGI",
> "../../sdk/stl-port/NGI",
> "../../sdk/mini-boost/NGI",
> "../../sdk/mini-boost/COMMON",
> ]
>
> _system_includes = [
> "../../../../../../Symbian/9.1/NGAGE_SDK_1.1/EPOC32/include",
> "../../../../../../Symbian/9.1/NGAGE_SDK_1.1/EPOC32/include/osextensions/rga",
> "../../../../../../Symbian/9.1/NGAGE_SDK_1.1/EPOC32/include/osextensions/stdapis",
> "../../../../../../Symbian/9.1/NGAGE_SDK_1.1/EPOC32/include/osextensions/stdapis/stlport",
> "../../../../../../Symbian/9.1/NGAGE_SDK_1.1/epoc32/include/variant"
> ]
>
> On 8/20/07, Robert Dailey <rcdai... at gmail.com> wrote:
>
>
>
> > Hi,
>
> > First have a look at the following code:
>
> > In main.py:
> > -----------------------------------------------------------------------------------
> > space = " "
>
> > includes = space.join ( system._user_includes ) + " " + space.join(
> > system._system_includes )
>
> > In system.py:
> > -----------------------------------------------------------------------------------
> > _user_includes = [
> > ]
>
> > _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.
>
> > PS: I've also tried putting strings in the lists above just to make sure
> > that them being empty wasn't the problem. I got no different results.- Hide quoted text -
>
> - Show quoted text -
I have no system.py, but when I run
includes = space.join (_user_includes ) + " " +
space.join(_system_includes )
with the lists given in your post, I get no error. I am using v2.5.1
on Windows XP.
More information about the Python-list
mailing list