Q:Pythonic way to create list of lists

2009-04-11 Thread grkuntzmd
I am just learning Python. I am trying to create a list of empty lists: [[], [], [], ...] (10 items total). What is the most Pythonic way to do this? If I use a list comprehension (as in myList = [[] for item in xrange (0, 10)]), Netbeans warns me that 'item' is never used. If I use a for-loop

Q: "Best" book for teaching

2009-04-06 Thread grkuntzmd
I am considering teaching an "introduction to programming" course for continuing education adults at a local community college. These would people with no programming experience, but I will require a reasonable facility with computers. What would be a good book to use as the text for the course?

Re: Testing dynamic languages

2009-04-04 Thread grkuntzmd
This may be obvious but, clearly there are (at least) two general types of errors: those caused by data external to the program and those caused by bugs in the program. For all inputs coming into the program from outside, such as user inputs and data coming over a network, the inputs must be comple

Testing dynamic languages

2009-04-04 Thread grkuntzmd
I am a Java developer. There, I said it :-). When I am writing code, I can rely on the compiler to confirm that any methods I write will be called with parameters of the "right" type. I do not need to test that parameter #1 really is a String before I call some method on it that only works on Str

Re: Unit testing frameworks

2009-03-25 Thread grkuntzmd
In unittest, has anyone used the *NIX command "find" to automatically build a test suite file of all tests under a specified directory? I generally name my tests as _Test_ORIGINAL_MODULE_NAME.py where ORIGINAL_MODULE_NAME is the obvious value. This way, I can include/ exclude them from deployments

Unit testing frameworks

2009-03-24 Thread grkuntzmd
I am looking for a unit testing framework for Python. I am aware of nose, but was wondering if there are any others that will automatically find and run all tests under a directory hierarchy. Thanks, Ralph -- http://mail.python.org/mailman/listinfo/python-list

Re: Preparing teaching materials

2009-03-21 Thread grkuntzmd
Very nice. I printed out the PDF manual for sphinx. I'll take a look at it. -- http://mail.python.org/mailman/listinfo/python-list

Preparing teaching materials

2009-03-20 Thread grkuntzmd
I am considering teaching a beginning programming course using Python. I would like to prepare my class handouts in such a way that I can import the Python code from real ".py" files directly into the documents. This way I can run real unit tests on the code to confirm that they work as expected.

Re: Is python worth learning as a second language?

2009-03-19 Thread grkuntzmd
The other day one of our developers said that he thought learning assembler language in college was a total waste of time. I can't disagree more. Even if assembler language is specific to one architecture, the principles that it teaches are universal and fundamental to all other programming langua