On Thu, May 22, 2014 at 12:54 AM, Alan Gauld <alan.ga...@btinternet.com> wrote: > But basically this just creates a text file in a folder somewhere. > Its only when that is accessed via a web server that it gets > sent to a browser, and only as a static file. > > If you wanted to do it dynamically you'd have a file called > something like mypage.cgi which looked like: > > print("<html><head><title>My web page</title></head>") > print("<body>This the body</body></html>") > > And provided the web server was configured to run python > on cgi files you could access it as > > http://myserver.addresss/mypage.cgi
Sadly, this is not the modern way to do it. These days, it’s recommended to use something like Flask, or Django, or whatnot. CGI is ancient, and problematic. -- Chris “Kwpolska” Warrick <http://kwpolska.tk> PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor