Re: [Tutor] implementing rot 13 problems

2013-03-11 Thread Jos Kerc
On Tue, Mar 12, 2013 at 6:57 AM, RJ Ewing wrote: > I am trying to implement rot 13 and am having troubles. My code is as > follows: > > class Rot_13(webapp2.RequestHandler): > def write_form(self, user=""): > self.response.out.write(rot_form % user) > def get(self): > self.write_form() > def p

Re: [Tutor] implementing rot 13 problems

2013-03-11 Thread Danny Yoo
The use of index() here to find the target place where the translation is going to occur is very fragile. Consider: we conceptually already should know where in the list we want the target to be, since we're walking across the characters in the list. We know that we're looking first at ls[0], tra

Re: [Tutor] Need help with python keyboard press/navigation commands

2013-03-11 Thread Danny Yoo
On Mon, Mar 11, 2013 at 8:59 PM, akuma ukpo wrote: > This is the problem > > Implement a function called get_direction which, on a particular character > , gives the > direction corresponding to that character. Do you know how to write a test case for this function? You had test cases for one o

[Tutor] implementing rot 13 problems

2013-03-11 Thread RJ Ewing
I am trying to implement rot 13 and am having troubles. My code is as follows: class Rot_13(webapp2.RequestHandler): def write_form(self, user=""): self.response.out.write(rot_form % user) def get(self): self.write_form() def post(self): user = self.request.get("text") s = self.rot_text(user) pr

[Tutor] Need help with python keyboard press/navigation commands

2013-03-11 Thread akuma ukpo
This is the problem Implement a function called get_direction which, on a particular character , gives the direction corresponding to that character. The correspondences are as follows:  The character ’w’ corresponds to the direction ’North’  The character ’a’ corresponds to the direction ’West’

Re: [Tutor] subprocess module: when to _NOT_ use shell=True

2013-03-11 Thread akleider
Thank you "Eryksun" and "EikeWek" for your responses. It is this sort of thing that begins to pull one out of the newbie into the intermediate category. I'm grateful. alex > I've not found anywhere a clear explanation of when not to set shell=True. > If the command line must be interpreted by the

Re: [Tutor] Print to file

2013-03-11 Thread Hugo Arts
On Mon, Mar 11, 2013 at 10:38 AM, Phil wrote: > On 11/03/13 18:35, Hugo Arts wrote: > >> On Mon, Mar 11, 2013 at 9:24 AM, Phil > > wrote: >> >> The usage of print to file is much like the Arduino print to serial >> device and it's got me curious to know what t

Re: [Tutor] Print to file

2013-03-11 Thread Alan Gauld
On 11/03/13 08:24, Phil wrote: Neither of the following is correct, but the second one seems closer to the mark. >>> print("test", file="/home/phil/Python/words") Traceback (most recent call last): File "", line 1, in AttributeError: 'str' object has no attribute 'write' So this is obvio

Re: [Tutor] Print to file

2013-03-11 Thread Hugo Arts
On Mon, Mar 11, 2013 at 9:24 AM, Phil wrote: > The usage of print to file is much like the Arduino print to serial device > and it's got me curious to know what the correct syntax is. Neither of the > following is correct, but the second one seems closer to the mark. > > >>> print("test", file="/

[Tutor] Print to file

2013-03-11 Thread Phil
The usage of print to file is much like the Arduino print to serial device and it's got me curious to know what the correct syntax is. Neither of the following is correct, but the second one seems closer to the mark. >>> print("test", file="/home/phil/Python/words") Traceback (most recent call

Re: [Tutor] Bar Operator ??

2013-03-11 Thread Mark Lybrand
Thanks. I think I kind of get it. It probably will take a while for the nuances of the filter to sink. Some things are filters that don't seem like they should be, but that seems like my problem. Mark :) On Sun, Mar 10, 2013 at 11:33 PM, Danny Yoo wrote: > > > > It's a filter: > > > > https: