473,385 Members | 1,355 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Python CGI Scripting Documentation

Hello,

I would like to learn web scripting with Python (sure, everyone uses
PHP, but I don't like the syntax and Python is more general-purpose
and... well, I guess you people know the advantages better than me).
Where can I get a thorough introduction to both CGI and using Python
for CGI? That includes installing my own web server (at home, for
testing) and starting from scratch (by that I mean I have near null
experience with CGI).

I have tried looking through the source code of MoinMoin, but it's just
too advanced for me -- I simply don't know where to start. Right now,
I'll take any and all suggestions. However, please suggest books or
articles that are up-to-date on Python programming; I'd hate to see
that I'm studying obsolete texts or the like.

Thanks in advance,
Vlad

--
If I make any mistake, be it regarding English or Usenet, do point it
out to me. Thank you.

Jul 2 '06 #1
3 1696

Vlad Dogaru wrote:
Hello,

I would like to learn web scripting with Python (sure, everyone uses
PHP, but I don't like the syntax and Python is more general-purpose
and... well, I guess you people know the advantages better than me).
Where can I get a thorough introduction to both CGI and using Python
for CGI? That includes installing my own web server (at home, for
testing) and starting from scratch (by that I mean I have near null
experience with CGI).

I have tried looking through the source code of MoinMoin, but it's just
too advanced for me -- I simply don't know where to start. Right now,
I'll take any and all suggestions. However, please suggest books or
articles that are up-to-date on Python programming; I'd hate to see
that I'm studying obsolete texts or the like.
Chapter 12 of Programming Python 2nd Edition by Mark Lutz

Jul 2 '06 #2
Vlad Dogaru <dd****@gmail.comwrote:
Hello,

I would like to learn web scripting with Python (sure, everyone uses
PHP, but I don't like the syntax and Python is more general-purpose
and... well, I guess you people know the advantages better than me).
Where can I get a thorough introduction to both CGI and using Python
for CGI? That includes installing my own web server (at home, for
testing) and starting from scratch (by that I mean I have near null
experience with CGI).

I have tried looking through the source code of MoinMoin, but it's just
too advanced for me -- I simply don't know where to start. Right now,
I'll take any and all suggestions. However, please suggest books or
articles that are up-to-date on Python programming; I'd hate to see
that I'm studying obsolete texts or the like.
In terms of learning, Steve Holden's "Python Web Programming" is still
unbeatable -- it teaches you just enough of the many underlying
technologies, from HTTP to HTML to relational databases, as well as
Python. However, it IS an old version of Python (sigh). But it's very
easy to learn the relatively small enhancements to the Python language
since the time Steve penned his masterpiece... anything that used to
work then still works now, you have better ways to perform many tasks
(particularly thanks to additions to the standard library, and third
party extension modules matured in the meantime) but those are easy to
learn "afterwards" (and meanwhile, a solid understanding of the basics
of, say, HTTP and entity-relation design, will stand you in good stead
for years and years to come!-). Steve's book is really the best you can
get, for "learning" purposes such as yours. However...L

If you insist on getting coverage of the latest and greatest version of
Python, you might want to get the 2nd edition of my "Python in a
Nutshell", due out later this month; it strives to cover Python 2.5
(also due out later this month;-) as well as 2.4 (the still-now current
version, on which the new Nutshel focuses), and does have a chapter
specifically on CGI (not much changed from the first edition's, of
course, since CGI itself has not changed much over the years;-).

To have a look at my book (and just about any other O'Reilly book... and
not just O'Reilly either!) for free, subscribe to O'Reilly's "Safari"
online library -- I believe the first two weeks are free, so, as long as
you cancel in time, you should not have to pay a penny for the
privilege; thus, it may be a good idea (I personally like having access
to said library for searches etc, but that's a separate issue). It will
be a while before the 2nd edition gets online -- but as I said the CGI
part is basically unchanged anyway.

But, talking of web resources...:

A Google search for Python CGI gives you 20 million hits, and quite a
few of those appear to be good tutorials on the subject -- why don't you
give those a try, first? Sure, most of the pages will be using older
versions of Python -- but most of the differences should be of little
importance. One crucial one: you *DO* want to use the cgitb auxiliary
module to get good tracebacks in case of errors, and older sites may not
mention it -- however, that's pretty simple indeed...:

import cgitb; cgitb.enable()

just place this line at the very top of your CGI script (after the
"shebang" line and the docstring, heh:-) and you're all set. Any
further info you need for "advanced" usage of cgitb is in one tiny page
at <http://docs.python.org/lib/module-cgitb.html>.
Alex
Jul 2 '06 #3
Alex Martelli wrote:
<snip>

Wow, I'm new in the field, but even I know your name. It's truly
inspiring to be aswered to by you. Thank you, all of you, for your
suggestions. I will try to look into the matter using the starting
points you've given me, as well as read more about Django.

Thanks,
Vlad.

Jul 3 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: John Benson | last post by:
Hi, I'm in a tightly-secured environment where I may not be allowed to use Python for some scripting work, and may have to fall back on what came with Windows 2K. I'm cracking "VBScript in a...
2
by: Terry Reedy | last post by:
According to PCGamer, Jan05, p52: "*Civilization IV* has been designed to fully support the mod community. The game is written using flexible XML data files and the Python scripting language...
217
by: gyromagnetic | last post by:
The following url points to an article written by Damian Conway entitled "Ten Essential Development Practices": http://www.perl.com/pub/a/2005/07/14/bestpractices.html Althought the article has...
5
by: James Owens | last post by:
I anticipate working with XML and XSL a lot over the next few years (I'm in technical documentation). I also happen to be looking for a new scripting language for some CGI interfaces I'll be...
47
by: John Salerno | last post by:
I have to say, I'm having a very enjoyable time learning and using Python. I spent a year playing around with C# and I feel like I learned/know less about it than I do about Python from just the...
34
by: nicolasfr | last post by:
Hi, I am a bit disapointed with the current Python online documentation. I have read many messages of people complaining about the documentation, it's lack of examples and the use of complicated...
145
by: Dave Parker | last post by:
I've read that one of the design goals of Python was to create an easy- to-use English-like language. That's also one of the design goals of Flaming Thunder at http://www.flamingthunder.com/ ,...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.