Quantcast

A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Ante

  • 2 years ago

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 Question is Closed
  1. bwCA
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    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"

  2. Ante
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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? :)

  3. bwCA
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    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

  4. bwCA
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    http://dpaste.com/906384/

  5. Ante
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  6. bwCA
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    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

  7. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.