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