using CGIHTTPserver to test html forms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • William D. Gill

    using CGIHTTPserver to test html forms

    I use a notebook (win 98) because of its portability. Unfortunately it is
    very slow. When I try to develop and test python cgi scripts I use Xitami
    as a local server, but with python, Xitami, and my text editor running it
    becomes next to impossible to work. The keyboard and mouse are slowed to
    painful levels. Actual execution of the webpage/script is tolerable, but to
    edit I have to stop the server. I was wondering if using CGIHTTPserver
    would be a better solution and if anyone can give me an example script
    (simple enough for a newbie). Every reference I see to CGIHTTPserver says
    it's good for testing your web forms, but they don't show me how.

    Thanks

    Bill




  • bblochl

    #2
    Re: using CGIHTTPserver to test html forms

    William D. Gill schrieb:
    [color=blue]
    >I use a notebook (win 98) because of its portability. Unfortunately it is
    >very slow. When I try to develop and test python cgi scripts I use Xitami
    >as a local server, but with python, Xitami, and my text editor running it
    >becomes next to impossible to work. The keyboard and mouse are slowed to
    >painful levels. Actual execution of the webpage/script is tolerable, but to
    >edit I have to stop the server. I was wondering if using CGIHTTPserver
    >would be a better solution and if anyone can give me an example script
    >(simple enough for a newbie). Every reference I see to CGIHTTPserver says
    >it's good for testing your web forms, but they don't show me how.
    >
    >Thanks
    >
    >Bill
    >
    >
    >
    >
    >
    >[/color]
    #httpd.py

    from BaseHTTPServer import HTTPServer
    from CGIHTTPServer import CGIHTTPRequestH andler
    serveradresse = ("",8080)
    server = HTTPServer(serv eradresse, CGIHTTPRequestH andler)
    server.serve_fo rever()

    I have tried that on Win2k starting in the editor Window of IDle and
    Python will hang. (On other systems it works ok - I have not found the
    reason yet!) On my linux- system I have no problems of that kind. On a
    Windows-network I couldn`t get it to work at all.

    On my test-sytem (Win2k) it works well, if you start it from a
    DOS-Window from the DOS-Prompt by typing
    python httpd.py
    The html-files must be in the same directory a s the file httpd.py.
    cgi-files must reside in a subdirectory namend cgi-bin.

    To test for instance the html-file name.html, you start the local server
    by typing http://localhost:8080/name.html (or 127.0.0.1:8080/name.html)
    in the browser adress line.

    Best regards and good luck!
    Bernhard



    Comment

    • William D. Gill

      #3
      Re: using CGIHTTPserver to test html forms

      I'll try it and let you know.

      Thanks,

      Bill

      "bblochl" <bblochl@fh-lausitz.de> wrote in message
      news:mailman.20 9.1077551086.27 104.python-list@python.org ...[color=blue]
      > William D. Gill schrieb:
      >[color=green]
      > >I use a notebook (win 98) because of its portability. Unfortunately it[/color][/color]
      is[color=blue][color=green]
      > >very slow. When I try to develop and test python cgi scripts I use[/color][/color]
      Xitami[color=blue][color=green]
      > >as a local server, but with python, Xitami, and my text editor running it
      > >becomes next to impossible to work. The keyboard and mouse are slowed to
      > >painful levels. Actual execution of the webpage/script is tolerable, but[/color][/color]
      to[color=blue][color=green]
      > >edit I have to stop the server. I was wondering if using CGIHTTPserver
      > >would be a better solution and if anyone can give me an example script
      > >(simple enough for a newbie). Every reference I see to CGIHTTPserver[/color][/color]
      says[color=blue][color=green]
      > >it's good for testing your web forms, but they don't show me how.
      > >
      > >Thanks
      > >
      > >Bill
      > >
      > >
      > >
      > >
      > >
      > >[/color]
      > #httpd.py
      >
      > from BaseHTTPServer import HTTPServer
      > from CGIHTTPServer import CGIHTTPRequestH andler
      > serveradresse = ("",8080)
      > server = HTTPServer(serv eradresse, CGIHTTPRequestH andler)
      > server.serve_fo rever()
      >
      > I have tried that on Win2k starting in the editor Window of IDle and
      > Python will hang. (On other systems it works ok - I have not found the
      > reason yet!) On my linux- system I have no problems of that kind. On a
      > Windows-network I couldn`t get it to work at all.
      >
      > On my test-sytem (Win2k) it works well, if you start it from a
      > DOS-Window from the DOS-Prompt by typing
      > python httpd.py
      > The html-files must be in the same directory a s the file httpd.py.
      > cgi-files must reside in a subdirectory namend cgi-bin.
      >
      > To test for instance the html-file name.html, you start the local server
      > by typing http://localhost:8080/name.html (or 127.0.0.1:8080/name.html)
      > in the browser adress line.
      >
      > Best regards and good luck!
      > Bernhard
      >
      >
      >[/color]


      Comment

      • William D. Gill

        #4
        Re: using CGIHTTPserver to test html forms

        Sorry it took so long to get back. That worked fine.

        I may wrap things up in something like the pydocgui so that I can select
        different documents, and shut it down more gracefully. If I do, I'll post
        the code.

        Thanks again,

        Bill

        "William D. Gill" <wmgill@gcgroup .net> wrote in message
        news:30ea7$403a 277d$42a655ea$1 0432@msgid.mega newsservers.com ...[color=blue]
        > I'll try it and let you know.
        >
        > Thanks,
        >
        > Bill
        >
        > "bblochl" <bblochl@fh-lausitz.de> wrote in message
        > news:mailman.20 9.1077551086.27 104.python-list@python.org ...[color=green]
        > > William D. Gill schrieb:
        > >[color=darkred]
        > > >I use a notebook (win 98) because of its portability. Unfortunately it[/color][/color]
        > is[color=green][color=darkred]
        > > >very slow. When I try to develop and test python cgi scripts I use[/color][/color]
        > Xitami[color=green][color=darkred]
        > > >as a local server, but with python, Xitami, and my text editor running[/color][/color][/color]
        it[color=blue][color=green][color=darkred]
        > > >becomes next to impossible to work. The keyboard and mouse are slowed[/color][/color][/color]
        to[color=blue][color=green][color=darkred]
        > > >painful levels. Actual execution of the webpage/script is tolerable,[/color][/color][/color]
        but[color=blue]
        > to[color=green][color=darkred]
        > > >edit I have to stop the server. I was wondering if using CGIHTTPserver
        > > >would be a better solution and if anyone can give me an example script
        > > >(simple enough for a newbie). Every reference I see to CGIHTTPserver[/color][/color]
        > says[color=green][color=darkred]
        > > >it's good for testing your web forms, but they don't show me how.
        > > >
        > > >Thanks
        > > >
        > > >Bill
        > > >
        > > >
        > > >
        > > >
        > > >
        > > >[/color]
        > > #httpd.py
        > >
        > > from BaseHTTPServer import HTTPServer
        > > from CGIHTTPServer import CGIHTTPRequestH andler
        > > serveradresse = ("",8080)
        > > server = HTTPServer(serv eradresse, CGIHTTPRequestH andler)
        > > server.serve_fo rever()
        > >
        > > I have tried that on Win2k starting in the editor Window of IDle and
        > > Python will hang. (On other systems it works ok - I have not found the
        > > reason yet!) On my linux- system I have no problems of that kind. On a
        > > Windows-network I couldn`t get it to work at all.
        > >
        > > On my test-sytem (Win2k) it works well, if you start it from a
        > > DOS-Window from the DOS-Prompt by typing
        > > python httpd.py
        > > The html-files must be in the same directory a s the file httpd.py.
        > > cgi-files must reside in a subdirectory namend cgi-bin.
        > >
        > > To test for instance the html-file name.html, you start the local server
        > > by typing http://localhost:8080/name.html (or 127.0.0.1:8080/name.html)
        > > in the browser adress line.
        > >
        > > Best regards and good luck!
        > > Bernhard
        > >
        > >
        > >[/color]
        >
        >[/color]


        Comment

        Working...