def attendeeInfo(): """ Outputs attendee information """ f = open("alist", "r") for line in f: name, email, company, state = line.split(',') a = Attendee(name, email, company, state) info = a.getInfo() print(info) f.close()
def getEmails(): """ Returns the email addresses of all the attendees """ f = open("alist", "r") print("Emails:") for line in f: name, email, company, state = line.split(',') a = Attendee(name, email, company, state) em = a.getEmail() print(em) f.close()
def nameAndEmail(): """ Returns the name and email address of every attendee """ f = open("alist", "r") print("Name: Email:") print("-----------------------------------") for line in f: name, email, company, state = line.split(',') a = Attendee(name, email, company, state) em = a.getEmail() na = a.getName() print("{0:20} {1:20}".format(na, em)) f.close()
def get_attendees_from_csv(csv_path: str, process_all_by: int = 0) -> list: """ Parameters ---------- csv_path Path to CSV file, of which data of attendees are recorded process_all_by Number of attendees in a group of attendees for one order. 0 means all attendees in one order Returns ------- List of list of attendees in one order """ attendee_list = list() with open(csv_path) as f: attendee_lines = f.read().splitlines() # Remove header line= attendee_lines.pop(0) for line in attendee_lines: attendee = Attendee.from_csv_string(line) attendee_list.append(attendee) attendee_list_collections = list() if process_all_by != 0: attendee_list_collections = [ attendee_list[i:i + process_all_by] for i in range(0, len(attendee_list), process_all_by) ] else: attendee_list_collections.append(attendee_list) return attendee_list_collections
def subscribe(course, attendeename): course.attendees.append(Attendee(attendeename))
#text based game #where you are a worker at a ball park #based on the one npr planet money episode about fenway hawkers from attendee import Attendee #import different classes of game from items import Item from weatherStuff import Weather bug = "sup" class Game: #main game class weather = Weather() bert = Attendee(5, ["beer", "fries", "chowder"], "bleechers", 15) bob = Attendee(10, ["coke, burger"], "home", 5) print(bert.seat) print(bob.seat)
def _load_attendees(self): for a in self.event.attendees(): att = Attendee(a.contact().email()) att.copy_from(a) self._attendees.append(att)