Hi, I am reading values from a form and writing them to a text file. I keep 
getting 
a syntax error for outfile=open("filename", "a")I cant see it, does any body 
else.


fileName = "requests.txt"
# Create instance of FieldStorage 
Form = cgi.FieldStorage()

# Get data from fields
if Form and Form['submit'].value == "Submit":
        
        the_name = Form.getvalue('name')
        the_email = Form.getvalue('email')
        the_address = Form.getvalue('address')
        the_telephone = Form.getvalue('telephone')
        
    
        IpAddress =  cgi.escape(os.environ["REMOTE_ADDR"]);
        Time = "(time.localtime()):", time.asctime(time.localtime())

        entry = name + '|' + email + '|' + address + '|' + telephone + '|' + 
IpAddress + '|' + Time + "\n"




        outfile=open("fileName", "a")
        outfile.write(entry)
        outfile.close()

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to