[python] quote % in shell script

Wolfgang Wilhelm muelltonne2003 at etechnik.fh-koblenz.de
Sun May 11 05:00:19 EDT 2003


Hi,

i wrote a small Python shell script but ran into probs,
maybe you can help me. Here it is:

cgi-bin/error404.py

#! /usr/bin/env python
import os
print'''Content-type: text/html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
 <head>
 <title>Whoops -  Error 404</title>
 </head>
<body>
Die Seite %s konnte nicht gefunden werden
<table width="100%">
 <tr>
  <td>link 1</td>
  <td>link 2</td>
 </tr>
</table>'''%(os.environ['REQUEST_URI'])

The % (percent) in <table width="100%"> causes the error.
How do i escape the percent correct?

greetings from Germany
-- 
Wolfgang Wilhelm         http://rz-home.de/wwilhelm/
"I heard if you play the NT-4.0-CD  backwards, you get a satanic message."
"Thats nothing, if you play it forward, it installs NT-4.0"





More information about the Python-list mailing list