Re: [Tutor] argparse iterable

2013-04-01 Thread Jason Friedman
#!/usr/bin/python import argparse parser = argparse.ArgumentParser(description='Short sample app') parser.add_argument('-a', action="store_true", default=False) parser.add_argument('-b', action="store", dest="b") parser.add_argument('-c', action="store", dest="c", type=int) parser.parse_args() for

Re: [Tutor] Use __str__ method for int values

2013-03-10 Thread Jason Friedman
> Thank you for the response! I next modified the __str__ so it will also > include the values self. boredom and self. hunger. I am getting a bit > confused with how to set up strings from within a method. It is set up like > this: > > def __str__(self): > attrs = "Hunger: ", self.hunge

Re: [Tutor] Use __str__ method for int values

2013-03-10 Thread Jason Friedman
> I am trying to use a __str__ method to display the values of attribute mood > = self.hunger + self. boredom. > When I try to execute I get this error: > > Traceback (most recent call last): > File "C:/Users/Vincent/Documents/Programming Tutorials/Python Programming > for the Absolute Beginner -