I code in python, and I have two python
files.
In the first I make
:
import cgi, cgitb,
os
export REMOTE_ADDR
def main(addr,
name):
t =
open('recei.py').read()
having =
string.Template(template).substitute(
name = name,
addr =
cgi.escape(os.environ["REMOTE_ADDR"])
)
in the second python
file I have my HTML code ( I put only a part of the form )
:
name="sendData" method="get" action="echo
${addr}">
but I
have a big error
:
File "./send.py", line 12, in
main(addr, name)
File "./send.py", line 45, in
main
addr = cgi.escape(os.environ["REMOTE_ADDR"])
File
"/usr/lib/python2.6/UserDict.py", line 22, in __getitem__
raise
KeyError(key)
KeyError:
'REMOTE_ADDR'
No comments:
Post a Comment