Newbie CGI Question

Michael Geary Mike at DeleteThis.Geary.com
Mon Oct 6 20:55:50 EDT 2003


> I'm having a problem when writing a cgi script that outputs content
> type: text/html. I can control the color of the screen with print
> '<back bgcolor="some color">' but I can't tile the screen with print
> '<back background="foo.gif">'. Is tiling not an option with Python
> CGI? A push in the right direction would be appreciated.
>
> I'm using Python 2.2.1 on Windows XP Pro running Apache 2.0.47 as
> localhost for debug purposes. Thanks for any help provided.

CGI is just a way to generate an HTML page (and the HTTP headers that go
with it). You're dealing with an HTML issue, not a Python issue.

So, you should start by forgetting about CGI completely. Use a text editor
to create a .html file by hand, and load the file in your browser to test
it. You can use any text editor and your favorite web browser and put them
side by side on the screen. Each time you edit and save the file, hit the
Refresh button in the browser to see how it's working.

Once you've got a working HTML page, then you can write the Python CGI code
to generate that same page.

Of course, you'll want to test your HTML in various browsers, but this will
get you started.

-Mike






More information about the Python-list mailing list