visual indentation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hilbert

    visual indentation

    Hello,

    I'm using python to output RIB streams for Renderman.
    The RIB stream is a bunch of statements which describes
    a 3d image. The Rib standard allows for blocks which we
    usually indent for better visualization for example:

    WorldBegin
    Color [1 1 1]
    Surface "constant"
    Sphere(1.0, -1.0, 1.0, 360)
    WorldEnd

    I'm using CGKit in python which has a Renderman binding,
    so to output the same RIB I'd write:

    RiWorldBegin()
    RiColor(1.0,1.0 ,1.0)
    RiSurface('cons tant')
    RiSphere(1.0,-1.0,1.0,360)
    RiWorldEnd()

    But I get an error, because python interprets my indentation
    as a block in the python code. So the only way to write this
    is without the indentation:

    RiWorldBegin()
    RiColor(1.0,1.0 ,1.0)
    RiSurface('cons tant')
    RiSphere(1.0,-1.0,1.0,360)
    RiWorldEnd()

    But this is a lot harder to read.

    Is there any way to use such "visual" indentation in python?

    Thanks,
    Hilbert

    hilbert@panka.c om


  • achrist@easystreet.com

    #2
    Re: visual indentation

    Hilbert wrote:[color=blue]
    >
    > Hello,
    >
    > I'm using python to output RIB streams for Renderman.
    > The RIB stream is a bunch of statements which describes
    > a 3d image. The Rib standard allows for blocks which we
    > usually indent for better visualization for example:
    >
    > WorldBegin
    > Color [1 1 1]
    > Surface "constant"
    > Sphere(1.0, -1.0, 1.0, 360)
    > WorldEnd
    >
    > I'm using CGKit in python which has a Renderman binding,
    > so to output the same RIB I'd write:
    >
    > RiWorldBegin()
    > RiColor(1.0,1.0 ,1.0)
    > RiSurface('cons tant')
    > RiSphere(1.0,-1.0,1.0,360)
    > RiWorldEnd()
    >
    > But I get an error, because python interprets my indentation
    > as a block in the python code. So the only way to write this
    > is without the indentation:
    >
    > RiWorldBegin()
    > RiColor(1.0,1.0 ,1.0)
    > RiSurface('cons tant')
    > RiSphere(1.0,-1.0,1.0,360)
    > RiWorldEnd()
    >
    > But this is a lot harder to read.
    >
    > Is there any way to use such "visual" indentation in python?
    >[/color]

    If the code is purely sequential, how about something like this:

    import string
    def RunTheseStateme nts(s):
    stmts = map(string.stri p, s.split("\n"))
    for stmt in stmts:
    eval(stmt)

    RunTheseStateme nts("""


    RiWorldBegin()
    RiColor(1.0,1.0 ,1.0)
    RiSurface('cons tant')
    RiSphere(1.0,-1.0,1.0,360)
    RiWorldEnd()


    """)


    Al

    Comment

    • Peter Otten

      #3
      Re: visual indentation

      Hilbert wrote:
      [color=blue]
      > Is there any way to use such "visual" indentation in python?[/color]

      Whitespace *is* significant in Python, and you should not try to circumvent
      this using dirty tricks. Why not structuring your world definitions in the
      standard way, putting the things that belong together in separate functions
      or classes?

      #disclaimer: no knowledge of CGKit involved in the following code
      WHITE = (1.0,1.0,1.0)

      def whitesurface():
      RiColor(*WHITE)
      RiSurface('cons tant')

      def firstworld():
      whitesurface()
      RiSphere(1.0,-1.0,1.0,360)

      def secondworld():
      whitesurface()
      RiSphere(1.0,-1.0,1.0,360)

      for world in [firstworld, secondworld]:
      RiWorldBegin()
      world()
      RiWorldEnd()

      I think the above is pretty readable, and you can always factor out
      repeating chunks of code

      Peter

      Comment

      • Greg Krohn

        #4
        Re: visual indentation


        "Hilbert" <Hilbert@panka. com> wrote in message
        news:slrnbkcja7 .s51.Hilbert@se rver.panka.com. ..[color=blue]
        > Hello,
        >
        > I'm using python to output RIB streams for Renderman.
        > The RIB stream is a bunch of statements which describes
        > a 3d image. The Rib standard allows for blocks which we
        > usually indent for better visualization for example:
        >
        > WorldBegin
        > Color [1 1 1]
        > Surface "constant"
        > Sphere(1.0, -1.0, 1.0, 360)
        > WorldEnd
        >
        > I'm using CGKit in python which has a Renderman binding,
        > so to output the same RIB I'd write:
        >
        > RiWorldBegin()
        > RiColor(1.0,1.0 ,1.0)
        > RiSurface('cons tant')
        > RiSphere(1.0,-1.0,1.0,360)
        > RiWorldEnd()
        >
        > But I get an error, because python interprets my indentation
        > as a block in the python code. So the only way to write this
        > is without the indentation:
        >
        > RiWorldBegin()
        > RiColor(1.0,1.0 ,1.0)
        > RiSurface('cons tant')
        > RiSphere(1.0,-1.0,1.0,360)
        > RiWorldEnd()
        >
        > But this is a lot harder to read.
        >
        > Is there any way to use such "visual" indentation in python?
        >
        > Thanks,
        > Hilbert
        >
        > hilbert@panka.c om
        >
        >[/color]

        What about an if statement:

        RiWorldBegin()
        if True:
        RiColor(1.0,1.0 ,1.0)
        RiSurface('cons tant')
        RiSphere(1.0,-1.0,1.0,360)
        RiWorldEnd()

        I realize it's ugly, but it's easy.


        Comment

        • Gary Herron

          #5
          Re: visual indentation

          On Friday 22 August 2003 11:28 am, achrist@easystr eet.com wrote:[color=blue]
          > Hilbert wrote:[color=green]
          > > Hello,
          > >
          > > I'm using python to output RIB streams for Renderman.
          > > The RIB stream is a bunch of statements which describes
          > > a 3d image. The Rib standard allows for blocks which we
          > > usually indent for better visualization for example:
          > >
          > > WorldBegin
          > > Color [1 1 1]
          > > Surface "constant"
          > > Sphere(1.0, -1.0, 1.0, 360)
          > > WorldEnd
          > >
          > > I'm using CGKit in python which has a Renderman binding,
          > > so to output the same RIB I'd write:
          > >
          > > RiWorldBegin()
          > > RiColor(1.0,1.0 ,1.0)
          > > RiSurface('cons tant')
          > > RiSphere(1.0,-1.0,1.0,360)
          > > RiWorldEnd()
          > >
          > > But I get an error, because python interprets my indentation
          > > as a block in the python code. So the only way to write this
          > > is without the indentation:
          > >
          > > RiWorldBegin()
          > > RiColor(1.0,1.0 ,1.0)
          > > RiSurface('cons tant')
          > > RiSphere(1.0,-1.0,1.0,360)
          > > RiWorldEnd()
          > >
          > > But this is a lot harder to read.
          > >
          > > Is there any way to use such "visual" indentation in python?[/color]
          >
          > If the code is purely sequential, how about something like this:
          >
          > import string
          > def RunTheseStateme nts(s):
          > stmts = map(string.stri p, s.split("\n"))
          > for stmt in stmts:
          > eval(stmt)
          >
          > RunTheseStateme nts("""
          >
          >
          > RiWorldBegin()
          > RiColor(1.0,1.0 ,1.0)
          > RiSurface('cons tant')
          > RiSphere(1.0,-1.0,1.0,360)
          > RiWorldEnd()
          >
          >
          > """)[/color]

          Here's another way -- inside a [..] or (...) construct

          [
          RiWorldBegin(),
          RiColor(1.0,1.0 ,1.0),
          RiSurface('cons tant'),
          RiSphere(1.0,-1.0,1.0,360),
          RiWorldEnd(),
          ]


          Or try this (this might be too ugly)

          RiWorldBegin()
          if 1:
          RiColor(1.0,1.0 ,1.0)
          RiSurface('cons tant')
          RiSphere(1.0,-1.0,1.0,360)
          RiWorldEnd()

          or make these all member functions of a class and try

          c. RiWorldBegin(),
          c. RiColor(1.0,1.0 ,1.0),
          c. RiSurface('cons tant'),
          c. RiSphere(1.0,-1.0,1.0,360),
          c. RiWorldEnd(),

          or

          Hmmmm -- I'll bet there's more possibilities.

          Gary Herron



          Comment

          • Ben Finney

            #6
            Re: visual indentation

            On Fri, 22 Aug 2003 13:06:46 -0700, Gary Herron wrote:[color=blue]
            > Hmmmm -- I'll bet there's more possibilities.[/color]

            All of which, like all possibilities for forcing different indentation
            on Python, presented so far, *reduce* readability instead of enhancing
            it.

            --
            \ "One time a cop pulled me over for running a stop sign. He |
            `\ said, 'Didn't you see the stop sign?' I said, 'Yeah, but I |
            _o__) don't believe everything I read.'" -- Steven Wright |
            Ben Finney <http://bignose.squidly .org/>

            Comment

            • Gary Herron

              #7
              Re: visual indentation

              On Friday 22 August 2003 11:28 am, achrist@easystr eet.com wrote:[color=blue]
              > Hilbert wrote:[color=green]
              > > Hello,
              > >
              > > I'm using python to output RIB streams for Renderman.
              > > The RIB stream is a bunch of statements which describes
              > > a 3d image. The Rib standard allows for blocks which we
              > > usually indent for better visualization for example:
              > >
              > > WorldBegin
              > > Color [1 1 1]
              > > Surface "constant"
              > > Sphere(1.0, -1.0, 1.0, 360)
              > > WorldEnd
              > >
              > > I'm using CGKit in python which has a Renderman binding,
              > > so to output the same RIB I'd write:
              > >
              > > RiWorldBegin()
              > > RiColor(1.0,1.0 ,1.0)
              > > RiSurface('cons tant')
              > > RiSphere(1.0,-1.0,1.0,360)
              > > RiWorldEnd()
              > >
              > > But I get an error, because python interprets my indentation
              > > as a block in the python code. So the only way to write this
              > > is without the indentation:
              > >
              > > RiWorldBegin()
              > > RiColor(1.0,1.0 ,1.0)
              > > RiSurface('cons tant')
              > > RiSphere(1.0,-1.0,1.0,360)
              > > RiWorldEnd()
              > >
              > > But this is a lot harder to read.
              > >
              > > Is there any way to use such "visual" indentation in python?[/color]
              >
              > If the code is purely sequential, how about something like this:
              >
              > import string
              > def RunTheseStateme nts(s):
              > stmts = map(string.stri p, s.split("\n"))
              > for stmt in stmts:
              > eval(stmt)
              >
              > RunTheseStateme nts("""
              >
              >
              > RiWorldBegin()
              > RiColor(1.0,1.0 ,1.0)
              > RiSurface('cons tant')
              > RiSphere(1.0,-1.0,1.0,360)
              > RiWorldEnd()
              >
              >
              > """)[/color]

              Here's another way -- inside a [..] or (...) construct

              [
              RiWorldBegin(),
              RiColor(1.0,1.0 ,1.0),
              RiSurface('cons tant'),
              RiSphere(1.0,-1.0,1.0,360),
              RiWorldEnd(),
              ]


              Or try this (this might be too ugly)

              RiWorldBegin()
              if 1:
              RiColor(1.0,1.0 ,1.0)
              RiSurface('cons tant')
              RiSphere(1.0,-1.0,1.0,360)
              RiWorldEnd()

              or make these all member functions of a class and try

              c. RiWorldBegin(),
              c. RiColor(1.0,1.0 ,1.0),
              c. RiSurface('cons tant'),
              c. RiSphere(1.0,-1.0,1.0,360),
              c. RiWorldEnd(),

              or

              Hmmmm -- I'll bet there's more possibilities.

              Gary Herron



              Comment

              • Dan Bishop

                #8
                Re: visual indentation

                Hilbert <Hilbert@panka. com> wrote in message news:<slrnbkcja 7.s51.Hilbert@s erver.panka.com >...[color=blue]
                > Hello,
                >
                > I'm using python to output RIB streams for Renderman.
                > The RIB stream is a bunch of statements which describes
                > a 3d image. The Rib standard allows for blocks which we
                > usually indent for better visualization for example:
                >
                > WorldBegin
                > Color [1 1 1]
                > Surface "constant"
                > Sphere(1.0, -1.0, 1.0, 360)
                > WorldEnd[/color]
                ....[color=blue]
                > Is there any way to use such "visual" indentation in python?[/color]

                If the code consists of nothing but expressions (which yours does), you can write:

                (RiWorldBegin() )
                ( RiColor(1.0,1.0 ,1.0))
                ( RiSurface('cons tant'))
                ( RiSphere(1.0,-1.0,1.0,360))
                (RiWorldEnd())

                or

                (
                RiWorldBegin(),
                RiColor(1.0,1.0 ,1.0),
                RiSurface('cons tant'),
                RiSphere(1.0,-1.0,1.0,360),
                RiWorldEnd()
                )

                Comment

                • Skip Montanaro

                  #9
                  Re: visual indentation


                  Hilbert> I'm using CGKit in python which has a Renderman binding, so to
                  Hilbert> output the same RIB I'd write:

                  Hilbert> RiWorldBegin()
                  Hilbert> RiColor(1.0,1.0 ,1.0)
                  Hilbert> RiSurface('cons tant')
                  Hilbert> RiSphere(1.0,-1.0,1.0,360)
                  Hilbert> RiWorldEnd()

                  Hilbert> But I get an error, because python interprets my indentation as
                  Hilbert> a block in the python code.

                  As it should, because whitespace is significant in Python.

                  Hilbert> So the only way to write this is without the indentation:

                  Hilbert> RiWorldBegin()
                  Hilbert> RiColor(1.0,1.0 ,1.0)
                  Hilbert> RiSurface('cons tant')
                  Hilbert> RiSphere(1.0,-1.0,1.0,360)
                  Hilbert> RiWorldEnd()

                  Hilbert> But this is a lot harder to read.

                  Hilbert> Is there any way to use such "visual" indentation in python?

                  In this case, just use "if 1:"

                  RiWorldBegin()
                  if 1:
                  RiColor(1.0,1.0 ,1.0)
                  RiSurface('cons tant')
                  RiSphere(1.0,-1.0,1.0,360)
                  RiWorldEnd()

                  Skip

                  Comment

                  • Cliff Wells

                    #10
                    Re: visual indentation

                    On Fri, 2003-08-22 at 11:10, Hilbert wrote:[color=blue]
                    > Hello,
                    >
                    > I'm using python to output RIB streams for Renderman.
                    > The RIB stream is a bunch of statements which describes
                    > a 3d image. The Rib standard allows for blocks which we
                    > usually indent for better visualization for example:
                    >
                    > WorldBegin
                    > Color [1 1 1]
                    > Surface "constant"
                    > Sphere(1.0, -1.0, 1.0, 360)
                    > WorldEnd
                    >
                    > I'm using CGKit in python which has a Renderman binding,
                    > so to output the same RIB I'd write:
                    >
                    > RiWorldBegin()
                    > RiColor(1.0,1.0 ,1.0)
                    > RiSurface('cons tant')
                    > RiSphere(1.0,-1.0,1.0,360)
                    > RiWorldEnd()
                    >
                    > But I get an error, because python interprets my indentation
                    > as a block in the python code. So the only way to write this
                    > is without the indentation:
                    >
                    > RiWorldBegin()
                    > RiColor(1.0,1.0 ,1.0)
                    > RiSurface('cons tant')
                    > RiSphere(1.0,-1.0,1.0,360)
                    > RiWorldEnd()
                    >
                    > But this is a lot harder to read.
                    >
                    > Is there any way to use such "visual" indentation in python?[/color]

                    How about this? It creates a bit of unnecessary overhead (a single
                    tuple creation), but looks okay visually (and Emacs correctly indents
                    it):

                    RiWorldBegin()
                    (
                    RiColor(1.0,1.0 ,1.0),
                    RiSurface('cons tant'),
                    RiSphere(1.0,-1.0,1.0,360),
                    )
                    RiWorldEnd()


                    Regards,

                    --
                    Cliff Wells, Software Engineer
                    Logiplex Corporation (www.logiplex.net)
                    (503) 978-6726 (800) 735-0555


                    Comment

                    • Cliff Wells

                      #11
                      Re: visual indentation

                      On Fri, 2003-08-22 at 11:10, Hilbert wrote:[color=blue]
                      > Hello,
                      >
                      > I'm using python to output RIB streams for Renderman.
                      > The RIB stream is a bunch of statements which describes
                      > a 3d image. The Rib standard allows for blocks which we
                      > usually indent for better visualization for example:
                      >
                      > WorldBegin
                      > Color [1 1 1]
                      > Surface "constant"
                      > Sphere(1.0, -1.0, 1.0, 360)
                      > WorldEnd
                      >
                      > I'm using CGKit in python which has a Renderman binding,
                      > so to output the same RIB I'd write:
                      >
                      > RiWorldBegin()
                      > RiColor(1.0,1.0 ,1.0)
                      > RiSurface('cons tant')
                      > RiSphere(1.0,-1.0,1.0,360)
                      > RiWorldEnd()
                      >
                      > But I get an error, because python interprets my indentation
                      > as a block in the python code. So the only way to write this
                      > is without the indentation:
                      >
                      > RiWorldBegin()
                      > RiColor(1.0,1.0 ,1.0)
                      > RiSurface('cons tant')
                      > RiSphere(1.0,-1.0,1.0,360)
                      > RiWorldEnd()
                      >
                      > But this is a lot harder to read.
                      >
                      > Is there any way to use such "visual" indentation in python?[/color]

                      How about this? It creates a bit of unnecessary overhead (a single
                      tuple creation), but looks okay visually (and Emacs correctly indents
                      it):

                      RiWorldBegin()
                      (
                      RiColor(1.0,1.0 ,1.0),
                      RiSurface('cons tant'),
                      RiSphere(1.0,-1.0,1.0,360),
                      )
                      RiWorldEnd()


                      Regards,

                      --
                      Cliff Wells, Software Engineer
                      Logiplex Corporation (www.logiplex.net)
                      (503) 978-6726 (800) 735-0555


                      Comment

                      • Cliff Wells

                        #12
                        Re: visual indentation

                        On Fri, 2003-08-22 at 11:10, Hilbert wrote:[color=blue]
                        > Hello,
                        >
                        > I'm using python to output RIB streams for Renderman.
                        > The RIB stream is a bunch of statements which describes
                        > a 3d image. The Rib standard allows for blocks which we
                        > usually indent for better visualization for example:
                        >
                        > WorldBegin
                        > Color [1 1 1]
                        > Surface "constant"
                        > Sphere(1.0, -1.0, 1.0, 360)
                        > WorldEnd
                        >
                        > I'm using CGKit in python which has a Renderman binding,
                        > so to output the same RIB I'd write:
                        >
                        > RiWorldBegin()
                        > RiColor(1.0,1.0 ,1.0)
                        > RiSurface('cons tant')
                        > RiSphere(1.0,-1.0,1.0,360)
                        > RiWorldEnd()
                        >
                        > But I get an error, because python interprets my indentation
                        > as a block in the python code. So the only way to write this
                        > is without the indentation:
                        >
                        > RiWorldBegin()
                        > RiColor(1.0,1.0 ,1.0)
                        > RiSurface('cons tant')
                        > RiSphere(1.0,-1.0,1.0,360)
                        > RiWorldEnd()
                        >
                        > But this is a lot harder to read.
                        >
                        > Is there any way to use such "visual" indentation in python?[/color]

                        I'm sending this again as the message I sent earlier apparently never
                        made it.

                        RiWorldBegin()
                        (
                        RiColor(1.0,1.0 ,1.0),
                        RiSurface('cons tant'),
                        RiSphere(1.0,-1.0,1.0,360),
                        )
                        RiWorldEnd()

                        There's a bit of added overhead (superfluous tuple creation) but it does
                        what you ask.

                        Regards,
                        Cliff

                        --
                        Should I stand midst the breakers, Should I lie with Death my bride?
                        -This Mortal Coil


                        Comment

                        • Hilbert

                          #13
                          Re: visual indentation

                          Thanks for all the suggestions!

                          I like both the tuple and the if 1: approach.

                          I don't want to define blocks in functions because that
                          would actually differ from how the RIB stream works.
                          I'd like to have my code reflect a real RIB stream.

                          Thanks again,
                          Hilbert

                          hilbert@panka.c om



                          In article <slrnbkcja7.s51 .Hilbert@server .panka.com>, Hilbert wrote:[color=blue]
                          > Hello,
                          >
                          > I'm using python to output RIB streams for Renderman.
                          > The RIB stream is a bunch of statements which describes
                          > a 3d image. The Rib standard allows for blocks which we
                          > usually indent for better visualization for example:
                          >
                          > WorldBegin
                          > Color [1 1 1]
                          > Surface "constant"
                          > Sphere(1.0, -1.0, 1.0, 360)
                          > WorldEnd
                          >
                          > I'm using CGKit in python which has a Renderman binding,
                          > so to output the same RIB I'd write:
                          >
                          > RiWorldBegin()
                          > RiColor(1.0,1.0 ,1.0)
                          > RiSurface('cons tant')
                          > RiSphere(1.0,-1.0,1.0,360)
                          > RiWorldEnd()
                          >
                          > But I get an error, because python interprets my indentation
                          > as a block in the python code. So the only way to write this
                          > is without the indentation:
                          >
                          > RiWorldBegin()
                          > RiColor(1.0,1.0 ,1.0)
                          > RiSurface('cons tant')
                          > RiSphere(1.0,-1.0,1.0,360)
                          > RiWorldEnd()
                          >
                          > But this is a lot harder to read.
                          >
                          > Is there any way to use such "visual" indentation in python?
                          >
                          > Thanks,
                          > Hilbert
                          >
                          > hilbert@panka.c om
                          >
                          >[/color]

                          Comment

                          • Hans Nowak

                            #14
                            Re: visual indentation

                            Hilbert wrote:[color=blue]
                            > Hello,
                            >
                            > I'm using python to output RIB streams for Renderman.
                            > The RIB stream is a bunch of statements which describes
                            > a 3d image. The Rib standard allows for blocks which we
                            > usually indent for better visualization for example:
                            >
                            > WorldBegin
                            > Color [1 1 1]
                            > Surface "constant"
                            > Sphere(1.0, -1.0, 1.0, 360)
                            > WorldEnd
                            >
                            > I'm using CGKit in python which has a Renderman binding,
                            > so to output the same RIB I'd write:
                            >
                            > RiWorldBegin()
                            > RiColor(1.0,1.0 ,1.0)
                            > RiSurface('cons tant')
                            > RiSphere(1.0,-1.0,1.0,360)
                            > RiWorldEnd()
                            >
                            > But I get an error, because python interprets my indentation
                            > as a block in the python code. So the only way to write this
                            > is without the indentation:
                            >
                            > RiWorldBegin()
                            > RiColor(1.0,1.0 ,1.0)
                            > RiSurface('cons tant')
                            > RiSphere(1.0,-1.0,1.0,360)
                            > RiWorldEnd()
                            >
                            > But this is a lot harder to read.
                            >
                            > Is there any way to use such "visual" indentation in python?[/color]

                            I can think of various ugly solutions, none of them very satisfying...

                            First, you can fake an indented block, e.g. like this:

                            RiWorldBegin()
                            if 1:
                            RiColor(1.0, 1.0, 1.0)
                            # etc...
                            RiWorldEnd()

                            Or you can put the function calls in a dummy list/tuple:

                            RiWorldBegin()
                            [
                            RiColor(1.0, 1.0, 1.0),
                            RiSurface('cons tant'),
                            RiSphere(1.0,-1.0,1.0,360),
                            ]
                            RiWorldEnd()

                            Or you can put some dummy statements in front...

                            RiWorldBegin()
                            (); RiColor(1.0, 1.0, 1.0)
                            (); RiSurface('cons tant')
                            (); RiSphere(1.0,-1.0,1.0,360)
                            RiWorldEnd()

                            I warned you they were ugly... :-)

                            Maybe the best solution would be judicious use of comments, e.g.

                            RiWorldBegin()
                            #
                            RiColor(1.0, 1.0, 1.0)
                            RiSurface('cons tant')
                            RiSphere(1.0,-1.0,1.0,360)
                            #
                            RiWorldEnd()

                            This doesn't give you indentation, but at least the statements in the "block"
                            stand out more.

                            But maybe somebody else has a better solution...?

                            --
                            Hans (hans@zephyrfal con.org)
                            Memimpin Angin Perubahan Teknologi




                            Comment

                            • Evan Simpson

                              #15
                              Re: visual indentation

                              Hilbert wrote:[color=blue]
                              > RiWorldBegin()
                              > RiColor(1.0,1.0 ,1.0)
                              > RiSurface('cons tant')
                              > RiSphere(1.0,-1.0,1.0,360)
                              > RiWorldEnd()
                              >
                              > Is there any way to use such "visual" indentation in python?[/color]

                              If all of the lines that you want to indent in this fashion are
                              expressions, not statments, then you could do this:

                              RiWorldBegin()
                              ( RiColor(1.0,1.0 ,1.0) )
                              ( RiSurface('cons tant') )
                              ( RiSphere(1.0,-1.0,1.0,360) )
                              RiWorldEnd()

                              If there are statements involved, you could do this:

                              RiWorldBegin()
                              1; RiColor(1.0,1.0 ,1.0)
                              1; RiSurface('cons tant')
                              1; RiSphere(1.0,-1.0,1.0,360)
                              RiWorldEnd()

                              Both are ugly, of course.

                              Cheers,

                              Evan @ 4-am



                              Comment

                              Working...