Hey, guys! I'm a bit stuck at problem set 5, problem 11 where we need to write a function that reads in a file containing information about what triggers with what names should be created. I may overcomplicate this but I'm not sure what the output should be. A dictionary of trigger names as keys, maybe, with the content stored as corresponding values? Any ideas?
this one? Problem 11. Finish implementing readTriggerConfig(filename). We’ve written code to open the file and throw away all the lines that don’t begin with instructions (e.g. comments, blank spaces). Your job is to finish the implementation. readTriggerConfig should return the list of triggers specified in the configuration file. "return the list of triggers specified in the configuration file"
Yeah, but I mean what does that mean? What is a trigger? I can create a list of lists where each element is a trigger's representation (name, type, arguments) but I hardly think that solves the problem. An idea is that the function should "create" (with assignment) triggers that have the specified names and can be used outside the functions scope. But that seems just way too complicated. So what am I missing? :)
well the docstring for the function that they partially wrote for us says that it returns a list of trigger objects. if you look at the initial main_thread() function they wrote for us, you can see that it is supposed to be a list
Okay, yes, I overcomplicated it, creating and enlisting Trigger objects does not require any magical name assignments. Thanks for the help :) The code works now, although, it's pretty annoying that I don't know how to stop the thread (the one that gathers RSS feeds) once it has started... Other than by quitting IDLE.
ctrl-c seems to work but the docs say it may not - http://dpaste.com/909558/ for the newsreader; I tried ctrl-c to get the shell prompt back then thread.exit() - that does not work
Join our real-time social learning platform and learn together with your friends!