This is the place for queries that don't fit in any of the other categories.
Perhaps someone can help with this problem. For info - Choicebox is an enigma2 gui class - this is not important for my question.
- Code: Select all
SELECTION = " "
def main(session, **kwargs):
res = openTest(session)
print "res =", res
session.openWithCallback(test1, ChoiceBox, title="Select playlist item?", list=[(_("Video1"), "Video1"), (_("Video2"), "Video2"), (_("Video3"), "Video3"), (_("Video4"), "Video4"), (_("Video5!"), "Video5")])
print "answer A:", answer
SELECTION = answer
Question :- This code prints res = None. Obviously the print line is executed before openTest is completed. Without changing def main - how can the correct reply 'res' be returned and printed ?
Last edited by Yoriz
on Thu May 22, 2014 9:32 pm, edited 1 time in total.
Reason: First post lock.
- Posts: 1
- Joined: Thu May 22, 2014 7:12 pm
Hi pcd, your function openTest returns the value of SELECTION, but that is never defined there. I assume this is why None is returned.
Other than that, can you show some code with the same error, but without openWithCallback or ChoiceBox etc, so we can actually run and test it ourselves?
Learn: How To Ask Questions
The Smart Way
Join the #python-forum IRC channel
and chat with uns directly!
- Posts: 396
- Joined: Thu Apr 04, 2013 1:17 pm
- Location: Germany, Europe
Return to General Coding Help
Who is online
Users browsing this forum: Baldyr, Bing [Bot], Google [Bot], pete1845, plas4844, tsummers and 4 guests