Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-05 Thread Rustom Mody
On Saturday, April 5, 2014 11:27:08 AM UTC+5:30, Chris Angelico wrote: > On Sat, Apr 5, 2014 at 4:29 PM, Ben Finney wrote: > > Without actual data - which neither of us has on this matter - all of > > these hypotheses are unfounded speculation. Let's not draw any > > conclusions in the absence of e

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-05 Thread Chris Angelico
On Sat, Apr 5, 2014 at 5:48 PM, Mark H Harris wrote: > On 4/5/14 1:01 AM, Ben Finney wrote: >> >> Mark H Harris writes: >> >>> On 4/5/14 12:02 AM, Ian Kelly wrote: A fork is undesirable because it fragments the community. I don't think "fear" or "panic" are the right words for it.

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-05 Thread Chris Angelico
On Sat, Apr 5, 2014 at 5:59 PM, Rustom Mody wrote: > Professionalism implies at bottom that a client is God even if > he is being an asshole. Not really :) Sometimes, your employer or client just has to go jump. Professionalism implies that you treat your client at least as well as s/he deserves,

Python streaming media server

2014-04-05 Thread Wesley
Hi, Anyone knows open source streaming media server written by Python? I am trying to setup a streaming media server in python, wanna find an existing one and have a look. Thanks. Wesley -- https://mail.python.org/mailman/listinfo/python-list

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-05 Thread Steven D'Aprano
On Sat, 05 Apr 2014 00:02:58 -0500, Mark H Harris wrote: > Having said that, I do believe that the migration to C python3 has > been too conservative. Why? Is it a race? Does Python 2.x turn into PHP at midnight? Some people think the move to Python 3 has been too radical and too fast for

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-05 Thread Terry Reedy
On 4/5/2014 6:19 AM, Steven D'Aprano wrote: Oh, I dare say that when the core developers finally announce Python 2.7 is end-of-lifed, probably in another five or so years, Bug fixing will end in May/June 2015 with 2.7.8, maybe 2.7.9. It will probably start tapering off before that on the basi

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-05 Thread Roy Smith
In article <533fd894$0$29993$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > Twisted has apparently said they cannot migrate to 3.x. They might, I > suppose, take up maintenance of Python 2.7. But I doubt it. I expect > that when push comes to shove in 4 or 5 years time, they'll

Re: Python streaming media server

2014-04-05 Thread Sturla Molden
Wesley wrote: > Anyone knows open source streaming media server written by Python? > > I am trying to setup a streaming media server in python, wanna find an > existing one and have a look. Not open source, but there is a famous closed-source one called YouTube. -- https://mail.python.org/m

Re: Two Questions about Python on Windows

2014-04-05 Thread Tim Roberts
maxerick...@gmail.com wrote: > >You can also edit the PATHEXT environment variable to include .py/.pyw, >making the python source files executable (as long as the types are >properly registered with Windows; if double clicking runs them they >should be properly registered). Let me clarify that ju

Re: Python streaming media server

2014-04-05 Thread Wesley
在 2014年4月6日星期日UTC+8上午1时38分57秒,Sturla Molden写道: > Wesley wrote: > > > > > Anyone knows open source streaming media server written by Python? > > > > > > I am trying to setup a streaming media server in python, wanna find an > > > existing one and have a look. > > > > Not open source, bu

Re: Python streaming media server

2014-04-05 Thread Steven D'Aprano
On Sat, 05 Apr 2014 18:51:58 -0700, Wesley wrote: > 在 2014年4月6日星期日UTC+8上午1时38分57秒,Sturla Molden写道: >> Wesley wrote: >> >> > Anyone knows open source streaming media server written by Python? >> > >> > I am trying to setup a streaming media server in python, wanna find >> > an existing one and

Re: Python streaming media server

2014-04-05 Thread Ben Finney
Steven D'Aprano writes: > Unfortunately, Google customizes the search results depending on who you > are and where you are, so you may not see what I see. Which is one of many reasons to prefer a search engine that doesn't put you in a search bubble like that. DuckDuckGo returns search results

How can I parse this correctly?

2014-04-05 Thread Anthony Papillion
Hello Everyone, I'm working with historical earthquake data and I have a tab delimited file. I'm using the csv module with the \t delimiter to denote it's tab separated and it's working fine. I've set things up loike this: import csv f = open('earthquakes.tsv') r = csv.DictReader(f, delimiter='\

Re: How can I parse this correctly?

2014-04-05 Thread Chris Angelico
On Sun, Apr 6, 2014 at 1:52 PM, Anthony Papillion wrote: > When I try to > cast them like this: > > print int(row['YEAR']) > > I am told by the interpreter: > > Traceback (most recent call last): > File "analyze.py", line 14, in > print int(row['MONTH']) > ValueError: invalid literal for in

Re: How can I parse this correctly?

2014-04-05 Thread Ben Finney
Anthony Papillion writes: > for row in r: > print row['YEAR'] > > This works fine. But, I am needing to do date addition/subtraction > using datetime and so I need these dates as integers. I assume you mean you will be creating ‘datetime.date’ objects. What will you set as the month and day?

Re: Python streaming media server

2014-04-05 Thread Wesley
在 2014年4月5日星期六UTC+8下午6时11分02秒,Wesley写道: > Hi, > > Anyone knows open source streaming media server written by Python? > > > > I am trying to setup a streaming media server in python, wanna find an > existing one and have a look. > > > > Thanks. > > Wesley After a lot google work, I am lo

If statement issue driving me nuts

2014-04-05 Thread Anthony Smith
Hi I have a small project and I have been unable to get the following statement to work. Any help would great. User inputs can either self_sale_head which is a $ value,if a $ value is not add a self.estimated_weight_hd is used to get the total weight, the code below should return a estimated_we

Re:If statement issue driving me nuts

2014-04-05 Thread Dave Angel
Anthony Smith Wrote in message: > Hi > > I have a small project and I have been unable to get the following statement > to work. Any help would great. > User inputs can either self_sale_head which is a $ value,if a $ value is not > add a self.estimated_weight_hd is used to get the total weight,

Re: How can I parse this correctly?

2014-04-05 Thread Anthony Papillion
On Apr 5, 2014, at 23:03, Chris Angelico wrote: On Sun, Apr 6, 2014 at 1:52 PM, Anthony Papillion wrote: When I try to cast them like this: print int(row['YEAR']) I am told by the interpreter: Traceback (most recent call last): File "analyze.py", line 14, in print int(row['MONTH']) V

Re: If statement issue driving me nuts

2014-04-05 Thread Gary Herron
On 04/05/2014 09:58 PM, Anthony Smith wrote: Hi I have a small project and I have been unable to get the following statement to work. Any help would great. User inputs can either self_sale_head which is a $ value,if a $ value is not add a self.estimated_weight_hd is used to get the total weigh

Re: How can I parse this correctly?

2014-04-05 Thread Anthony Papillion
On Apr 5, 2014, at 23:21, Ben Finney wrote: Anthony Papillion writes: for row in r: print row['YEAR'] This works fine. But, I am needing to do date addition/subtraction using datetime and so I need these dates as integers. I assume you mean you will be creating ‘datetime.date’ objects.

Mutable objects inside tuples - good or bad?

2014-04-05 Thread John Ladasky
I find this programming pattern to be useful... but can it cause problems? Python 3.3.2+ (default, Feb 28 2014, 00:52:16) [GCC 4.8.1] on linux Type "help", "copyright", "credits" or "license" for more information. >>> a = [1,2,3] >>> b = [4,5,6] >>> c = (a,b) >>> c ([1, 2, 3], [4, 5, 6]) >>> c[0]