You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ERROR:picoweb:30.000 <HTTPRequest object at 3fffd830> <Stream object at 3fffd4a0> TypeError("'NoneType' object isn't iterable",)
Traceback (most recent call last):
File "/lib/picoweb/init.py", line 206, in _handle
TypeError: 'NoneType' object isn't iterable
{'ir': 'S'}
here is my code
`import picoweb
def qs_parse(qs):
parameters = {}
ampersandSplit = qs.split("&")
for element in ampersandSplit:
equalSplit = element.split("=")
parameters[equalSplit[0]] = equalSplit[1]
return parameters
app = picoweb.WebApp(name)
@app.route("/move")
def index(req, resp):
try:
cmd = {x[0] : x[1] for x in [x.split("=") for x in req.qs[1:].split("&") ]}
print(cmd)
'''
if cmd == 'F': robot.forward()
if cmd == 'B': robot.backward()
if cmd == 'L': robot.turnleft()
if cmd == 'R': robot.turnright()
if cmd == 'S': robot.stop()
'''
except: pass
ERROR:picoweb:30.000 <HTTPRequest object at 3fffd830> <Stream object at 3fffd4a0> TypeError("'NoneType' object isn't iterable",)
Traceback (most recent call last):
File "/lib/picoweb/init.py", line 206, in _handle
TypeError: 'NoneType' object isn't iterable
{'ir': 'S'}
here is my code
`import picoweb
def qs_parse(qs):
parameters = {}
ampersandSplit = qs.split("&")
for element in ampersandSplit:
equalSplit = element.split("=")
parameters[equalSplit[0]] = equalSplit[1]
return parameters
app = picoweb.WebApp(name)
@app.route("/move")
def index(req, resp):
try:
cmd = {x[0] : x[1] for x in [x.split("=") for x in req.qs[1:].split("&") ]}
print(cmd)
'''
if cmd == 'F': robot.forward()
if cmd == 'B': robot.backward()
if cmd == 'L': robot.turnleft()
if cmd == 'R': robot.turnright()
if cmd == 'S': robot.stop()
'''
except: pass
@app.route("/action")
def index(req, resp):
try:
cmd = qs_parse(req.qs)['type']
if cmd == '1': robot.beep(20)
except: pass
import ulogging as logging
logging.basicConfig(level=logging.INFO)
app.run(host='0.0.0.0', port=80)
`
The text was updated successfully, but these errors were encountered: