ANNOUNCE; Try python beta

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

    #16
    Re: ANNOUNCE; Try python beta


    [Richie][color=blue]
    > I think it's your JavaScript '\r' processing that's broken. Certainly the
    > error ("unexpected EOF while parsing") is consistent with having a \r on the
    > end of the expression.[/color]

    [Mike][color=blue]
    > Python doesn't care about the trailing newline.[/color]

    That's a carriage return, not a newline:
    [color=blue][color=green][color=darkred]
    >>> eval("1+2\r")[/color][/color][/color]
    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "<string>", line 1
    1+2
    ^
    SyntaxError: unexpected EOF while parsing
    [color=blue]
    > My assumption is that if splitting on '\n' leaves us with one
    > thing, we may have gotten a string that used \r for newlines[/color]

    Ah, OK. Your comment talks about DOS - that won't happen on DOS (or
    Windows) which uses \r\n. I don't know about the Mac. But the \r\n pair
    isn't handled by your code - strip() on the server side will make it work if
    that's the problem:
    [color=blue][color=green][color=darkred]
    >>> eval("1+2\r".st rip())[/color][/color][/color]
    3

    --
    Richie Hindle
    richie@entrian. com

    Comment

    • Mike Meyer

      #17
      Re: ANNOUNCE; Try python beta

      Richie Hindle <richie@entrian .com> writes:[color=blue][color=green]
      >> My assumption is that if splitting on '\n' leaves us with one
      >> thing, we may have gotten a string that used \r for newlines[/color]
      > Ah, OK. Your comment talks about DOS - that won't happen on DOS (or
      > Windows) which uses \r\n. I don't know about the Mac. But the \r\n pair
      > isn't handled by your code - strip() on the server side will make it work if
      > that's the problem:[/color]

      You mean there's a difference between DOS and Windows?

      The Mac stuff I can test, so that's easier to get right.
      [color=blue][color=green][color=darkred]
      >>>> eval("1+2\r".st rip())[/color][/color]
      > 3[/color]

      I actually did wind up doing it this way. MSIE works now, but still
      doesn't seem very reliable.

      Thanks,
      <mike
      --
      Mike Meyer <mwm@mired.or g> http://www.mired.org/home/mwm/
      Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

      Comment

      • Eric

        #18
        Re: ANNOUNCE; Try python beta

        On 20 December 2005, Mike Meyer wrote:[color=blue]
        > Ok, I've given it the interface I want, and made it less of an
        > attractive nuisance.
        >
        > http://www.mired.org/home/mwm/try_python/ is now ready for people to
        > play with. There's no tutorial information on it yet, that's the next
        > thing to do. However, I won't be able to work on it for a while, so if
        > you want to make suggestions about what that should look like, all
        > such suggestions will be given proper consideration.[/color]

        I'm not sure about everyone else, but I find the big warnings about
        CSS and JavaScript almost as annoying as the fact that it doesn't do
        anything. At all, even with JavaScript enabled. Then again, my main
        browser is elinks, so my opinion is somewhat biased.

        If you get it working in Lynx, supporting other browsers should be
        easier than the other posts make this solution sound.

        - Eric

        Comment

        • Maravilloso

          #19
          Re: ANNOUNCE; Try python beta

          I'm afraid that I've spoiled the "try_python " working by means of
          executing the sentence:

          open("try.py"). write("\n")

          Sorry. I hope it don't be difficult for you to restore the module again
          to the default folder.

          In any case, I think it should include some control for malicious code
          like that one.

          Comment

          • Mike Meyer

            #20
            Re: ANNOUNCE; Try python beta

            "Maravillos o" <maravilloso@gm ail.com> writes:[color=blue]
            > I'm afraid that I've spoiled the "try_python " working by means of
            > executing the sentence:
            >
            > open("try.py"). write("\n")
            >
            > Sorry. I hope it don't be difficult for you to restore the module again
            > to the default folder.[/color]

            No problem - I'm not crazy enough to leave unreplaceable data on a
            machine with open incoming ports.
            [color=blue]
            > In any case, I think it should include some control for malicious code
            > like that one.[/color]

            Normally, it is. I must have left the module writeable after updating
            it :-(. It's been replaced, and if you try that now you'll get an
            IOError.

            Thanks for reporting it.

            <mike
            --
            Mike Meyer <mwm@mired.or g> http://www.mired.org/home/mwm/
            Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

            Comment

            • Mike Meyer

              #21
              Re: ANNOUNCE; Try python beta

              Eric <groups@brainsh ell.org> writes:[color=blue]
              > I'm not sure about everyone else, but I find the big warnings about
              > CSS and JavaScript almost as annoying as the fact that it doesn't do
              > anything. At all, even with JavaScript enabled. Then again, my main
              > browser is elinks, so my opinion is somewhat biased.[/color]

              Well, if you have CSS working properly and JavaScript enabled, you
              won't get the warnings. Would you honestly prefer that it just quietly
              not work at all, rather than tell you why it doesn't work? At least it
              doesn't insult your intelligence by telling you how to enable them for
              browsers you aren't using.
              [color=blue]
              > If you get it working in Lynx, supporting other browsers should be
              > easier than the other posts make this solution sound.[/color]

              True. On the other hand, it was designed from the ground up to use
              AJAT, to keep the traffic required to update the page at a sane
              level. Future plans also depend on JavaScript, since it's required for
              the basic functionality in any case.

              A version could be designed that didn't keep the history around that
              would work in lynx (though I'd test it in my preference: w3m) and used
              the same evaluation back end. That would look a lot less like the
              python interpreter, though. If you want to do that, I'd be more than
              happy to provide a link to it, or even host it. Otherwise, I'll think
              about it after I finish the currently planned version.

              <mike
              --
              Mike Meyer <mwm@mired.or g> http://www.mired.org/home/mwm/
              Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

              Comment

              Working...