Sign in with
Sign up | Sign in
Your question

Python problem

Last response: in Applications
Share
September 18, 2012 10:49:18 PM

i'm new to python when I run this script
  1. import wap
  2. import speech
  3.  
  4. speech.say("Awaiting Command")
  5. question = speech.input("Awaiting Command")
  6. appid = '3HA463-A3RT78PEA8' # Use your app id
  7. waeo = wap.WolframAlphaEngine(appid)
  8. waeq = wap.WolframAlphaQuery(question, appid)
  9. waeq.ScanTimeout = '3.0'
  10. waeq.Async = False
  11. waeq.ToURL() # After configuring the waeq must call ToURL()
  12.  
  13. result = waeo.PerformQuery(waeq.Query) # result is in xml format
  14. print result
  15. waeq = wap.WolframAlphaQueryResult(result)
  16.  
  17. for pod in waeq.Pods():
  18. waep = wap.Pod(pod)
  19. print '\n%s: (%d subpods)' % (waep.Title(), waep.NumSubpods())
  20. speech.say('\n%s: (%d subpods)' % (waep.Title(), waep.NumSubpods()))


it gives me this error http://pastebin.com/NhCEPZPv Can anyone diagnose this problem. Thanks in advanced

More about : python problem

a b L Programming
September 19, 2012 4:27:08 AM

I'm no expert in python, but it looks like it's trying to convert a string into a number, that's why it's failing.
m
0
l
!