Re: [Tutor] Which version of python should i use?

2013-05-21 Thread Albert-Jan Roskam
> Subject: Re: [Tutor] Which version of python should i use? > > Hello Amal, > > On Mon, May 20, 2013 at 11:24 PM, Amal Thomas > wrote: >> Thank you very much..!! I am starting to learn python for my Bioinformatics >> work, so I would look for the version that has libraries helpful for me..

Re: [Tutor] reducing lists within list to their set of unique values

2013-05-21 Thread Treder, Robert
> Message: 6 > Date: Tue, 21 May 2013 09:45:17 +1000 > From: Steven D'Aprano > To: tutor@python.org > Subject: Re: [Tutor] reducing lists within list to their set of unique > values > Message-ID: <519ab58d.9020...@pearwood.info> > Content-Type: text/plain; charset=UTF-8; format=flowed > > On

Re: [Tutor] reducing lists within list to their set of unique values

2013-05-21 Thread Oscar Benjamin
On 21 May 2013 14:31, Treder, Robert wrote: > Steven wrote: >> >> py> L = ['b', 'd', 'c', 'a', 'b'] >> py> list(set(L)) >> ['a', 'c', 'b', 'd'] >> >> >> If keeping the order is important, you cannot use set, and you'll need >> another way to extract only the unique values. Ask if you need help on

[Tutor] Hi Folks...Need help with a modified version of the Subset sum problem.

2013-05-21 Thread spiff007
Hi there Tutor folks I need your help with a modified version of the subset sum problem [ http://en.wikipedia.org/wiki/Subset_sum_problem]. The problem i am facing is a bit hard to describe (as most complex problem always are :D ), so please bear with my longish articulation :) Here it goes : A

Re: [Tutor] Hi Folks...Need help with a modified version of the Subset sum problem.

2013-05-21 Thread Peter Otten
spiff007 wrote: > Hi there Tutor folks > > I need your help with a modified version of the subset sum problem [ > http://en.wikipedia.org/wiki/Subset_sum_problem]. > > The problem i am facing is a bit hard to describe (as most complex problem > always are :D ), so please bear with my longish art

[Tutor] Configuring Emacs for Python development?

2013-05-21 Thread boB Stepp
Okay. Since I first joined this list I have played around (as time permitted) with these editors/IDEs: PyCharm, Eclipse with PyDev, Notepad++, Emacs, IDLE, PyScripter, IdleX, Sublime Text, and possibly others. Of course, I have far from mastered any of them, but I think that I have a sense of what

[Tutor] nose error

2013-05-21 Thread Jim Mooney
I'm trying a nose test on a simple prog. Once I got past the huge traceback in Wing that made me think nose didn't work I realized the prog tested okay. But I noticed at the end of the traceback nose says this: "c:\Python27\Lib\site-packages\nose-1.3.0-py2.7.egg\nose\core.py", line 200, in runTest

[Tutor] still nosing around

2013-05-21 Thread Jim Mooney
Okay, why is nose saying this run is OK when I purposely screwed it up? import nose def stand_and_deliver(): return 52 def stupid_error(): '''This is my stupid error''' assert stand_and_deliver() == 17 if __name__ == '__main__': nose.runmodule() nose result: Ran 0 tests in 0.0

Re: [Tutor] still nosing around

2013-05-21 Thread Mark Lawrence
On 22/05/2013 01:25, Jim Mooney wrote: Okay, why is nose saying this run is OK when I purposely screwed it up? import nose def stand_and_deliver(): return 52 def stupid_error(): '''This is my stupid error''' assert stand_and_deliver() == 17 if __name__ == '__main__': nose.

Re: [Tutor] still nosing around

2013-05-21 Thread Steven D'Aprano
On 22/05/13 10:25, Jim Mooney wrote: Okay, why is nose saying this run is OK when I purposely screwed it up? import nose def stand_and_deliver(): return 52 def stupid_error(): '''This is my stupid error''' assert stand_and_deliver() == 17 if __name__ == '__main__': nose.ru

Re: [Tutor] nose error

2013-05-21 Thread eryksun
On Tue, May 21, 2013 at 8:09 PM, Jim Mooney wrote: > > "c:\Python27\Lib\site-packages\nose-1.3.0-py2.7.egg\nose\core.py", > line 200, in runTests > sys.exit(not self.success) > SystemExit: False > > As i said, nose works and says Okay on the asserts (or not if I give > things a bad value). I w

Re: [Tutor] still nosing around

2013-05-21 Thread Steven D'Aprano
On 22/05/13 10:50, Mark Lawrence wrote: Do you ever bother to investigate anything before posing a question? That's rather harsh. The OP is doing a fine job at investigating new tools, and he's far more adventurous than I was at his level of expertise. (Or now, for that matter...) I think w

Re: [Tutor] Tutor Digest, Vol 111, Issue 72

2013-05-21 Thread Jim Mooney
> Do you ever bother to investigate anything before posing a question? Actually, I did notice that tests were zero, but the book I am using does not mention needing the word 'test' as part of the regex. There is only so much time in a day and so many books I can buy (and not all comprehensive, app

[Tutor] challenge-chapter 2

2013-05-21 Thread Andrew Triplett
I am on chapter two for Python Programming working on the challenges and the question is: 1. Create a list of legal and illegal variable names. Describe why each is either legal or illegal. Next, create a list of "good" and "bad" legal variable names. Describe why each is either a good or bad c

[Tutor] try..except - what about that ton of **Error statements?

2013-05-21 Thread Jim Mooney
I'm looking at Try..Except Try: Except SomethingError as err: The list of error statements is huge. How do I know which error statement to put in place of SomethingError (or multiple errors for that matter)? Or is it best to just leave SomethingError blank until I know more? ( I have a

Re: [Tutor] try..except - what about that ton of **Error statements?

2013-05-21 Thread Jim Mooney
> Keep the try block small. For example if it's for a call to > open(filename, "r") the only possible errors (assuming correct syntax) > are NameError for using an undefined variable and IOError for > specifying a file which doesnt exist. Thanks. Since I'm new at this the error lists I saw just ha

Re: [Tutor] try..except - what about that ton of **Error statements?

2013-05-21 Thread Bod Soutar
On 22 May 2013 07:20, Jim Mooney wrote: >> Keep the try block small. For example if it's for a call to >> open(filename, "r") the only possible errors (assuming correct syntax) >> are NameError for using an undefined variable and IOError for >> specifying a file which doesnt exist. > > Thanks. Sin