Python embedded in HTML returns error when there is no input -


i've written code:

http://pastebin.com/e3azzqvb

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

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -