[Tutor] NEWBIE is it possible to use HTML and Python together?

john public apython101@yahoo.com
Fri, 22 Mar 2002 16:40:13 -0800 (PST)


--0-72270782-1016844013=:87925
Content-Type: text/plain; charset=us-ascii


On my way home, I am buying a new book. Glad I saw this one at Media Play a week ago, know right where to go. this will bring my python collection to 5 ( the new Deitel & Deitel book, A. Gauld book, Python in 24 hours (YUCK), O'Riley/Mark Lutz book Learning python)ANymore that you would recomend, I should consider?
========================================================================================

http://www.ibiblio.org/obp/thinkCSpy/ How to think like a computer scientist  at the link to the left, Alan Gaulds book and Learning Python have been the three that have been working best for me.

 I like Richard Baldwins style  http://www.phrantic.com/scoop/tocpyth.htm the set is incomplete and I could'nt get some of the links to work right. He said that would be fixed soon. So maybe they are working now
Thanks
Robert

---------- Original Message ----------------------------------
From: Kirby Urner 
Date: Fri, 22 Mar 2002 09:22:34 -0800

>At 07:40 AM 3/22/2002 -0500, you wrote:
>>I there any way to set the python up to run on a client side.
>>I don think it's planned to run on the web, it's just his own
>>little game. is there away to use something like py2exe to
>>solve this?
>>
>>Thank you for your time in helping me solve this.
>>Robert
>
>Is there a web server in this picture at all -- even just
>a local one on the same machine as the client? It's
>perfectly possible for a standalone machine not permanently
>connected to the internet with static, public IP to run a
>web server "facing inward" (i.e. to be a "host" and to
>"run a web server" are not the same thing).
>
>Perhaps your friend is using HTML to sort of mock up an
>interface, i.e. is using the browser as a front end for
>an app? This is trendy, as various flavors of XML for
>GUI-design are popping up and programmers will be taking
>this approach quite a bit.
>
>However, without a server in the picture, web pages need
>something running client side to be dynamic. Either that,
>or use Python to take the place of the missing server,
>i.e. you could write a tiny server in Python and point
>the browser to it. This is easier than it sounds.
>However, you should make sure this code never handles
>HTTP requests originating outside your box.
>
>For example, put some html file (say thefile.html) in
>your Python root directory and enter the following two
>lines of code in IDLE. Then point your browser to
>http://127.0.0.1/thefile.html and it should come up in
>your browser:
>
> >>> import SocketServer.CGIHTTPServer
> >>> SocketServer.ThreadingTCPServer(('127.0.0.1',80),\
> CGIHTTPServer.CGIHTTPRequestHandler).serve_forever()
>
>You may need to kill your Python process from outside
>when you're done with this demo.
>
>A good resource here is 'The Python 2.1 Bible' Chapter 15,
>from where I copied the above. From here, you can go on
>to write CGI handlers that handle requests.
>
>Kirby
>
>

_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor



---------------------------------
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
--0-72270782-1016844013=:87925
Content-Type: text/html; charset=us-ascii

<BLOCKQUOTE style="BORDER-LEFT: #1010ff 2px solid; MARGIN-LEFT: 5px; PADDING-LEFT: 5px">
<P>On my way home, I am buying a new book. Glad I saw this one at Media Play a week ago, know right where to go. this will bring my python collection to 5 ( the new Deitel &amp; Deitel book, A. Gauld book, Python in 24 hours (YUCK), O'Riley/Mark Lutz book Learning python)ANymore that you would recomend, I should consider?<BR>========================================================================================</P>
<P><A href="http://www.ibiblio.org/obp/thinkCSpy/">http://www.ibiblio.org/obp/thinkCSpy/</A>&nbsp;How to think like a computer scientist&nbsp; at the link to the left, Alan Gaulds book and Learning Python have been the three that have been working best for me.</P>
<P>&nbsp;I like Richard Baldwins style  <A href="http://www.phrantic.com/scoop/tocpyth.htm">http://www.phrantic.com/scoop/tocpyth.htm</A>&nbsp;the set is incomplete and I could'nt get some of the links to work right. He said that would be fixed soon. So maybe they are working now<BR>Thanks<BR>Robert<BR><BR>---------- Original Message ----------------------------------<BR>From: Kirby Urner <URNERK@QWEST.NET><BR>Date: Fri, 22 Mar 2002 09:22:34 -0800<BR><BR>&gt;At 07:40 AM 3/22/2002 -0500, you wrote:<BR>&gt;&gt;I there any way to set the python up to run on a client side.<BR>&gt;&gt;I don think it's planned to run on the web, it's just his own<BR>&gt;&gt;little game. is there away to use something like py2exe to<BR>&gt;&gt;solve this?<BR>&gt;&gt;<BR>&gt;&gt;Thank you for your time in helping me solve this.<BR>&gt;&gt;Robert<BR>&gt;<BR>&gt;Is there a web server in this picture at all -- even just<BR>&gt;a local one on the same machine as the client? It's<BR>&gt;perfectly possible for a standalone machine not permanently<BR>&gt;connected to the internet with static, public IP to run a<BR>&gt;web server "facing inward" (i.e. to be a "host" and to<BR>&gt;"run a web server" are not the same thing).<BR>&gt;<BR>&gt;Perhaps your friend is using HTML to sort of mock up an<BR>&gt;interface, i.e. is using the browser as a front end for<BR>&gt;an app? This is trendy, as various flavors of XML for<BR>&gt;GUI-design are popping up and programmers will be taking<BR>&gt;this approach quite a bit.<BR>&gt;<BR>&gt;However, without a server in the picture, web pages need<BR>&gt;something running client side to be dynamic. Either that,<BR>&gt;or use Python to take the place of the missing server,<BR>&gt;i.e. you could write a tiny server in Python and point<BR>&gt;the browser to it. This is easier than it sounds.<BR>&gt;However, you should make sure this code never handles<BR>&gt;HTTP requests originating outside your box.<BR>&gt;<BR>&gt;For example, put some html file (say thefile.html) in<BR>&gt;your Python root directory and enter the following two<BR>&gt;lines of code in IDLE. Then point your browser to<BR>&gt;http://127.0.0.1/thefile.html and it should come up in<BR>&gt;your browser:<BR>&gt;<BR>&gt; &gt;&gt;&gt; import SocketServer.CGIHTTPServer<BR>&gt; &gt;&gt;&gt; SocketServer.ThreadingTCPServer(('127.0.0.1',80),\<BR>&gt; CGIHTTPServer.CGIHTTPRequestHandler).serve_forever()<BR>&gt;<BR>&gt;You may need to kill your Python process from outside<BR>&gt;when you're done with this demo.<BR>&gt;<BR>&gt;A good resource here is 'The Python 2.1 Bible' Chapter 15,<BR>&gt;from where I copied the above. From here, you can go on<BR>&gt;to write CGI handlers that handle requests.<BR>&gt;<BR>&gt;Kirby<BR>&gt;<BR>&gt;<BR><BR>_______________________________________________<BR>Tutor maillist - Tutor@python.org<BR>http://mail.python.org/mailman/listinfo/tutor</P></BLOCKQUOTE><p><br><hr size=1><b>Do You Yahoo!?</b><br>
<a href="$rd_url/tag/http://movies.yahoo.com/">Yahoo! Movies</a> - coverage of the 74th Academy Awards®
--0-72270782-1016844013=:87925--