CGI questions
John J. Lee
jjl at pobox.com
Tue Jun 4 17:26:10 EDT 2002
On Wed, 5 Jun 2002, Michael Hall wrote:
> 1.
> Does Python have the same or a similar problem that PHP had until recently
> with regard to automatic global registration of GET, POST and COOKIE
> variables within a script's namespace? My guess is that it doesn't, but
[...]
Of course not -- Python itself knows nothing about CGI. I don't think the
cgi module does any tricky implicit stuff along those lines, either.
[...]
> alphanumeric string I'd expect from PHP. Most of it is definitely not
> [a-zA-Z0-9], and it is around 10 characters long. How can I get a PHP
> style md5 result?
Use the hexdigest method.
> 3.
> What is the decimal bit on the end of time.time()'s output? Hundredths of
> a second?
The seconds element of the time tuples that the standard Python library
function uses is a decimal number, in seconds.
> 4.
> Is the following Python the (best) equivalent to the PHP?
>
> PHP Python
> ereg("bit","bigbits") re.compile("bit").search("bigbits",1)
No idea, but Python uses Perl-style regular expressions, which aren't
exactly the same as 'extended' regexps.
All this stuff is in the std. library docs.
John
More information about the Python-list
mailing list