Re: Opening a csv file in python on a mac

2012-05-12 Thread MRAB
On 12/05/2012 23:50, Brian Heese wrote: I created a csv file called python test file.csv. It is stored on my Desktop directory. When I try to open it using the command open ('Desktop python test file.csv') I get the following error: "No such file or directory". The same thing happens if I use op

Re: Opening a csv file in python on a mac

2012-05-12 Thread Dave Angel
On 05/12/2012 06:50 PM, Brian Heese wrote: > I created a csv file called python test file.csv. It is stored on my Desktop > directory. When I try to open it using the command open ('Desktop python > test file.csv') I get the following error: "No such file or directory". The > same thing happens

Re: Opening a csv file in python on a mac

2012-05-12 Thread Alec Taylor
Import csv Lookup usage in the python docs On 13/05/2012 9:22 AM, "Brian Heese" wrote: > I created a csv file called python test file.csv. It is stored on my > Desktop directory. When I try to open it using the command open ('Desktop > python test file.csv') I get the following error: "No such

Opening a csv file in python on a mac

2012-05-12 Thread Brian Heese
I created a csv file called python test file.csv. It is stored on my Desktop directory. When I try to open it using the command open ('Desktop python test file.csv') I get the following error: "No such file or directory". The same thing happens if I use open ('python test file.csv'). What I am

Re: Newbie naive question ... int() throws ValueError

2012-05-12 Thread Chris Angelico
On Sun, May 13, 2012 at 4:25 AM, Devin Jeanpierre wrote: > What having to try-it-and-see does is give me extra steps to know what > it does. Instead of only reading the documentation, now I have to both > read the documentation *and* try it out in the interactive interpreter > to see its behaviour

Re: Newbie naive question ... int() throws ValueError

2012-05-12 Thread Devin Jeanpierre
On Sat, May 12, 2012 at 8:27 AM, Karl Knechtel wrote: > I really wish gmail picked up the mailing list as a default reply-to > address... There is some labs thing that makes "reply to all" the default if you click the button on the top-right. Unfortunately, that applies for non-mailing-lists too

Re: Good data structure for finding date intervals including a given date

2012-05-12 Thread Neal Becker
Probably boost ITL (Interval Template Library) would serve as a good example. I noticed recently someone created an interface for python. -- http://mail.python.org/mailman/listinfo/python-list

Re: to solve the simple equation

2012-05-12 Thread Terry Reedy
On 5/12/2012 9:30 AM, contro opinion wrote: there is a simple equation, 50/((1+x)**0.9389)+50/((1+x)**1.9389)+1050/((1+x)**2.9389)-1045=0 i input : from sympy import * x=Symbol('x') solve(50/((1+x)**0.9389)+50/((1+x)**1.9389)+1050/((1+x)**2.9389)-1045, x) Traceback (most recent call last):

Re: Good data structure for finding date intervals including a given date

2012-05-12 Thread Jean-Daniel
> Since you say "intervals" in plural here, I assume that they can overlap? Yes, For instance, there are the following intervals : [[1, 10], [4, 7], [6, 15], [11, 17]] asking for the intervals including 5, the returned value should be [[1, 10], [4, 7]] The idea here to make it fast is to have

Re: Dealing with the __str__ method in classes with lots of attributes

2012-05-12 Thread Ethan Furman
Karl Knechtel wrote: On Thu, May 10, 2012 at 9:33 AM, Andreas Tawn wrote: And there's also something like... return "\n".join((": ".join((str(k), str(self.__dict__[k]))) for k in self.__dict__)) which is a nice length, but I lose control of the order of the attributes and the formatting is

Re: Newbie naive question ... int() throws ValueError

2012-05-12 Thread Ethan Furman
Devin Jeanpierre wrote: On Fri, May 11, 2012 at 11:21 PM, Chris Angelico wrote: There are times when you want to catch all exceptions, though. Top-level code will often want to replace exception tracebacks with error messages appropriate to some external caller, or possibly log the exception an

to solve the simple equation

2012-05-12 Thread contro opinion
there is a simple equation, 50/((1+x)**0.9389)+50/((1+x)**1.9389)+1050/((1+x)**2.9389)-1045=0 i input : >>> from sympy import * >>> x=Symbol('x') >>>solve(50/((1+x)**0.9389)+50/((1+x)**1.9389)+1050/((1+x)**2.9389)-1045, x) Traceback (most recent call last): File "", line 1, in File "/usr/lib/p

Re: Python web-framework with the widest scalability?

2012-05-12 Thread Tim Chase
On 05/12/12 03:30, Alec Taylor wrote: > I am building a project requiring high performance and scalability, > entailing: Most of the frameworks are sufficiently scalable. Scalability usually stems from design decisions (architecture and algorithm) and caching, and you'll usually hit bandwidth or

Re: Good data structure for finding date intervals including a given date

2012-05-12 Thread Mark Lawrence
On 12/05/2012 13:17, Jean-Daniel wrote: Hello, Do you know the best way to do this in Python with the stdlib? Sorry, not part of the stdlib but search for red black tree here http://pypi.python.org/pypi. While you're there also take a look at the blist package. -- Cheers. Mark Lawrence

Re: Dealing with the __str__ method in classes with lots of attributes

2012-05-12 Thread Karl Knechtel
On Thu, May 10, 2012 at 9:33 AM, Andreas Tawn wrote: > And there's also something like... > > return "\n".join((": ".join((str(k), str(self.__dict__[k]))) for k in > self.__dict__)) > > which is a nice length, but I lose control of the order of the attributes and > the formatting is fixed. It al

Re: Good data structure for finding date intervals including a given date

2012-05-12 Thread Karl Knechtel
On Sat, May 12, 2012 at 8:17 AM, Jean-Daniel wrote: > I am looking for a fast way to find the intervals > containing a given date, without having to check all intervals (less > than O(n)). Since you say "intervals" in plural here, I assume that they can overlap? -- ~Zahlman {:> -- http://mail.

Fwd: Newbie naive question ... int() throws ValueError

2012-05-12 Thread Karl Knechtel
I really wish gmail picked up the mailing list as a default reply-to address... -- Forwarded message -- From: Karl Knechtel Date: Sat, May 12, 2012 at 8:25 AM Subject: Re: Newbie naive question ... int() throws ValueError To: Devin Jeanpierre On Sat, May 12, 2012 at 12:11 AM,

Good data structure for finding date intervals including a given date

2012-05-12 Thread Jean-Daniel
Hello, I have a long list of n date intervals that gets added or suppressed intervals regularly. I am looking for a fast way to find the intervals containing a given date, without having to check all intervals (less than O(n)). Do you know the best way to do this in Python with the stdlib? A var

Re: Minor gripe about module names

2012-05-12 Thread Tim Chase
On 05/12/12 05:51, Chris Angelico wrote: > On Sat, May 12, 2012 at 8:41 PM, John O'Hagan > wrote: >> Not sure if this is only package-manager specific, but >> occasionally I come across a module that sounds interesting, >> install it (in my case by apt-get), and then can't find it, >> because the

Re: Minor gripe about module names

2012-05-12 Thread Chris Angelico
On Sat, May 12, 2012 at 8:41 PM, John O'Hagan wrote: > Not sure if this is only package-manager specific, but occasionally I come > across a module that sounds interesting, install it (in my case by apt-get), > and then can't find it, because the actual module has a different name from > what it s

Minor gripe about module names

2012-05-12 Thread John O'Hagan
Not sure if this is only package-manager specific, but occasionally I come across a module that sounds interesting, install it (in my case by apt-get), and then can't find it, because the actual module has a different name from what it says on the package - unlike the majority, which if they are ca

Python web-framework with the widest scalability?

2012-05-12 Thread Alec Taylor
I am building a project requiring high performance and scalability, entailing: - Role-based authenticationwith API-keylicensing to access data of specific users - A