Python embedded in HTML returns error when there is no input -
i've written code:
loading page:
nimasa.heliohost.org/rj/
the problem comes no-input returns error, although there no problem on interpreter seen at:
repl.it/v88/2
waiting suggestions,
what should change/or add/ make not return error on no-input?
thanks,
nima
form.getvalue("b")
return none
if there's no value b
in request. trying slice none
(at line 19 : s = b[35:]
) - or apply string method or function fwiw - (obviously) raise typeerror
.
for record, took me 30 seconds find out:
# python python 2.7.3 (default, jun 22 2015, 19:33:41) [gcc 4.6.3] on linux2 type "help", "copyright", "credits" or "license" more information. >>> import cgi >>> f = cgi.fieldstorage() >>> f.getvalue("foo") none true
Comments
Post a Comment