I've found that bottom-up development favors testable code. That is,
rather than thinking of the problem to be solved, thinking in terms of
the tools (functions) one would use to solve the problem. These tools
can be written to be testable, and then it all builds up in this tower
of easily-testable
In general, write the unit test *before* you write the code. This way your code
is "designed" to be unit tested by default. It also provides a better way to
verify that your implementation of a desired feature actually works as
intended.
For example, when I'm writing a new module I document it fir
What are some of the strategies for designing code to be unit tested?
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On 04/01/12 18:28, brandon w wrote:
How do I capture a key like the bar or the key?
It depends on your OS.
For Windows use msvcrt and the getch() function.
For other OS your best bet is curses.
See the "Event Handling" topic in my tutorial for examples
using both.
There is a terminal modu
How do I capture a key like the bar or the key? Is there
anything that comes in the default Python2.6.6 installation?
I have found something called "termios" doing a search. Should I just use
Pygame? I would like it to go cross platform if possible.
Brandon
__
On 04/01/12 14:54, Joel Goldstick wrote:
two files' content is equal, just print "equal". Else, print the
rows And column number of the first different position.
while True:
line = f1.readline()
if line != f2.readline():
print lineNum, " : ", line
# in here I believe y
On Wed, Jan 4, 2012 at 9:36 AM, Alan Gauld wrote:
> On 04/01/12 14:13, David Palao wrote:
>>
>> Hi,
>> some hints:
>> 1) strings are iterables
>
>
> And so are files ;-)
>
>> 2) help(zip)
>> 3) help(enumerate)
>
>
>> Write a program that compare the two files given by users. If the
>> tw
On 04/01/12 14:13, David Palao wrote:
Hi,
some hints:
1) strings are iterables
And so are files ;-)
2) help(zip)
3) help(enumerate)
Write a program that compare the two files given by users. If the
two files' content is equal, just print "equal". Else, print the
rows And co
Hi,
some hints:
1) strings are iterables
2) help(zip)
3) help(enumerate)
Best regards.
2012/1/4 daedae11
> **
> Who can give me an example program about the exercise 6 in chapter 9 in
> ?
>
> The exercise is:
> Write a program that compare the two files given by users. If the two
> files' cont
Who can give me an example program about the exercise 6 in chapter 9 in ?
The exercise is:
Write a program that compare the two files given by users. If the two files'
content is equal, just print "equal". Else, print the rows And column number of
the first different position.
Thank you!
Hi daedae11,
2012/1/4 daedae11 :
> Who can give me an example program about the exercise 4 in chapter 9 in
> ?
>
> Thank you!
You're limiting the number of people who might help you by not posting
the excercise/problem you're having directly and instead only giving a
reference to a book the read
Who can give me an example program about the exercise 4 in chapter 9 in ?
Thank you!
daedae11___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Who can give me an example program about the exercise 4 in chapter 9 in ?
daedae11___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
13 matches
Mail list logo