On 30/08/2013 4:17 PM, fp2...@gmail.com wrote:
On Wednesday, August 28, 2013 8:50:53 PM UTC+2, Josh English wrote:
def compose(*funcs):
for func in funcs:
if not callable(func):
raise ValueError('Must pass callable functions')
Imho still, the ValueError you are rais
On 30/08/2013 4:14 PM, fp2...@gmail.com wrote:
For this purpose however, I suspect that a named function with a proper
docstring that can be imported and reused over and over again is probably more
appropriate than a lambda
Given that in Chris' example the lambda was returned from a factory,
On Wednesday, August 28, 2013 8:50:53 PM UTC+2, Josh English wrote:
> Reduce tricks are nice, but I prefer clarity sometimes:
>
>
>
> def double(x):
>
> return x*2
>
>
>
> def add3(x):
>
> return x+3
>
>
>
>
>
> def compose(*funcs):
>
> for func in funcs:
>
> if n
On Thursday, August 29, 2013 11:35:39 PM UTC+2, Chris Angelico wrote:
> On Fri, Aug 30, 2013 at 7:27 AM, wrote:
>
> > Chris, call me a snob, but I resent using lambdas (aren't they usually
> > considered odd/bad practice in python?)
>
>
>
> They're not bad practice; all they are is a functio
On Friday, August 30, 2013 4:09:45 AM UTC+2, Steven D'Aprano wrote:
> On Thu, 29 Aug 2013 13:50:39 -0700, fp2161 wrote:
>
>
>
> > My way is so obvious that it may not be that interesting...
>
> >
>
> > def func4(f1,f2,f3,f4):
>
> > def anon(x):
>
> > f1(f2(f3(f4(x
>
> >
Hello Group
I need to write a utility that will control wincap under Windows 7 using Pyhton
3.x So i can control which interface stop start capture and dump to file.
It will be most appreciated if someone could suggest me such library to use
Please advice
Thanks
--
http://mail.python.org/mailma
On Thursday, August 29, 2013 12:09:22 AM UTC+3, Joe Junior wrote:
> While designing a simple library, I found myself asking a
>
> philosophical question: to check or not to check the parameter's
>
> interface?
>
Design by contract discipline says: do not.
>
>
> I think that, considering it is
Ben Finney writes:
> Fábio Santos writes:
>
> > It is a shame that this is not possible in python. for..if exists in
> > comprehensions and not in regular loops but that would be nice
> > sometimes.
> for foo in (spam for spam in sequence if predicate(spam)): …
Better:
for foo in filte
On 8/29/2013 5:48 PM, fp2...@gmail.com wrote:
Here is the generalisable version:
def comp(*func):
def anon(x):
res=x
for f in func:
res=f(res)
return res
return anon
With a bit more work, one can set the __name__ and __qualname__ attributes.
On Fri, Aug 30, 2013 at 7:27 AM, wrote:
> Chris, call me a snob, but I resent using lambdas (aren't they usually
> considered odd/bad practice in python?)
They're not bad practice; all they are is a function without a name,
that's restricted to returning a single expression. So they're
perfectl
On Fri, 30 Aug 2013 01:57:45 +, Steven D'Aprano wrote:
> So while I don't doubt that it wouldn't be occasionally convenient to
> map None to '' rather than 'None', I think it would be surprising and,
> indeed, dangerous if it happened by default, since it would encourage
> people to build up S
On Thu, 29 Aug 2013 09:40:32 -0300, Joe Junior wrote:
> Well, the main reason for me asking this question here was because of
> the Java/C#/Whatever developer in me craving for an Interface for the
> container's items, and I noticed that I'm not alone in this. But I was
> actually expecting the "W
On Thu, 29 Aug 2013 14:27:23 -0700, fp2161 wrote:
> Chris, call me a snob, but I resent using lambdas (aren't they usually
> considered odd/bad practice in python?)
Only among people who dislike functional programming idioms. Like GvR.
It is true that lambda functions are slightly restricted com
On Thu, 29 Aug 2013 13:50:39 -0700, fp2161 wrote:
> My way is so obvious that it may not be that interesting...
>
> def func4(f1,f2,f3,f4):
> def anon(x):
> f1(f2(f3(f4(x
> return anon
I don't think "obvious" is quite the right description. Well, perhaps
"obviously wrong" :-
On Thu, 29 Aug 2013 04:43:16 -0600, Ian Kelly wrote:
> I've had many occasions where it would have been convenient for
> str(None) to return the empty string, e.g. when exporting tabular data
> that includes null values from a database to a spreadsheet. Generally
> it's safe to just call str() on
* Tim Johnson [130829 10:51]:
> using Python 2.7.1 on OS X 10.7.5
>
> I'm managing a process of drush using an instance of subprocess.Popen
<...>
## This appears to be what works.
def __exec(self,args) :
"""Run the process with arguments"""
p = subprocess.Popen(args,stderr=su
On 29/08/2013 10:40 PM, Joe Junior wrote:
Another reason for this question is that I read some people saying
they wouldn't use python for large projects, and they always point at
the lack of Interfaces as a concern. I actually disagree, but I can
see their point. What do you think?
Having worke
* MRAB [130829 11:04]:
> On 29/08/2013 19:34, Tim Johnson wrote:
> >could use some examples.
> >
> The subprocess will terminate when it has finished writing its output,
> but because you're not consuming any of the output (you're waiting for
> it to finish), the buffer fills up and blocks the sub
On Wednesday, August 28, 2013 3:10:49 PM UTC+2, Jussi Piitulainen wrote:
> AdamKal writes:
>
>
>
> > Hi,
>
> >
>
> > From time to time I have to apply a series of functions to a value
>
> > in such a way:
>
> >
>
> > func4(func3(func2(func1(myval
>
> >
>
> > I was wondering if the
On Fri, Aug 30, 2013 at 8:17 AM, Ben Finney wrote:
> Fábio Santos writes:
>
>> It is a shame that this is not possible in python. for..if exists in
>> comprehensions and not in regular loops but that would be nice
>> sometimes.
>
> So you use it in a generator expression, and iterate over the gen
Fábio Santos writes:
> It is a shame that this is not possible in python. for..if exists in
> comprehensions and not in regular loops but that would be nice
> sometimes.
So you use it in a generator expression, and iterate over the generator:
for foo in (spam for spam in sequence if predica
On Thursday, August 29, 2013 11:05:38 PM UTC+2, Chris Angelico wrote:
> On Fri, Aug 30, 2013 at 6:50 AM, wrote:
>
> > My way is so obvious that it may not be that interesting...
>
> >
>
> > def func4(f1,f2,f3,f4):
>
> > def anon(x):
>
> > f1(f2(f3(f4(x
>
> > return anon
On Thursday, August 29, 2013 11:05:38 PM UTC+2, Chris Angelico wrote:
> On Fri, Aug 30, 2013 at 6:50 AM, wrote:
>
> > My way is so obvious that it may not be that interesting...
>
> >
>
> > def func4(f1,f2,f3,f4):
>
> > def anon(x):
>
> > f1(f2(f3(f4(x
>
> > return anon
On Fri, Aug 30, 2013 at 6:50 AM, wrote:
> My way is so obvious that it may not be that interesting...
>
> def func4(f1,f2,f3,f4):
> def anon(x):
> f1(f2(f3(f4(x
> return anon
Or have it return the result of f1. And then, since it's an anonymous
function that simply returns an
On 29 August 2013 20:43, Ian Kelly wrote:
> On Wed, Aug 28, 2013 at 6:21 AM, Steven D'Aprano
> wrote:
> > On Wed, 28 Aug 2013 01:57:16 -0700, Piotr Dobrogost wrote:
> >
> >> Hi!
> >>
> >> Having repr(None) == 'None' is sure the right thing but why does
> >> str(None) == 'None'? Wouldn't it be mo
Hi,
this is a list with Python Skeleton Builder Tools :
http://wiki.python.org/moin/SkeletonBuilderTools
If some tools missing, you can complete the list.
Best regards,
Stéphane
--
Stéphane Klein
blog: http://stephane-klein.info
Twitter: http://twitter.com/klein_stephane
cv: http://cv.stephane
On Wednesday, August 28, 2013 2:52:46 PM UTC+2, AdamKal wrote:
> Hi,
>
>
>
> From time to time I have to apply a series of functions to a value in such a
> way:
>
>
>
> func4(func3(func2(func1(myval
>
>
>
> I was wondering if there is a function in standard library that would take a
On Thursday 2013 August 29 11:34, Tim Johnson wrote:
> using Python 2.7.1 on OS X 10.7.5
>
> I'm managing a process of drush using an instance of subprocess.Popen
>
> The process has a '--verbose' option. When that option is passed as
> part of the initializer `args' argument, the process will hang
On Thursday, August 29, 2013 12:55:36 PM UTC+2, Ian wrote:
> On Wed, Aug 28, 2013 at 5:42 AM, Fabrice POMBET wrote:
>
> >
>
> > On 8/28/2013 4:57 AM, Piotr Dobrogost wrote:
>
> >
>
> >> Having repr(None) == 'None' is sure the right thing but why does str(None)
> >> == 'None'? Wouldn't it be m
Tim Johnson
> using Python 2.7.1 on OS X 10.7.5
>
> I'm managing a process of drush using an instance of subprocess.Popen
>
> The process has a '--verbose' option. When that option is passed as
> part of the initializer `args' argument, the process will hang.
>
> It should be no surprise as drus
On 29/08/2013 19:34, Tim Johnson wrote:
using Python 2.7.1 on OS X 10.7.5
I'm managing a process of drush using an instance of subprocess.Popen
The process has a '--verbose' option. When that option is passed as
part of the initializer `args' argument, the process will hang.
It should be no su
using Python 2.7.1 on OS X 10.7.5
I'm managing a process of drush using an instance of subprocess.Popen
The process has a '--verbose' option. When that option is passed as
part of the initializer `args' argument, the process will hang.
It should be no surprise as drush output with the --verbose
Στις 29/8/2013 3:35 μμ, ο/η Ferrous Cranus έγραψε:
Στις 29/8/2013 2:54 μμ, ο/η Gregory Ewing έγραψε:
i.she...@gmail.com wrote:
I should write a python script(s) that listens to an existing XMLRPC
service on my company's dev server.
then i should parse that and return to the existing XML-RPC
On Thursday, August 29, 2013 3:10:03 PM UTC+2, Chris “Kwpolska” Warrick wrote:
> On Thu, Aug 29, 2013 at 2:45 PM, Andreas Ecaz wrote:
>
> > I've decided to go with Flask! It's now running on UWSGI with NGINX.
> > Hopefully I can get some stuff done :)
>
>
>
> How are you running uWSGI? On sa
On 29 August 2013 10:07, Chris Angelico wrote:
> Hmm. l don't know of any good articles off-hand. But what I'm talking
> about is simply developing the skill of reading exceptions, plus a few
> simple things like knowing where it's appropriate to catch-and-log;
> sometimes, what that means is actu
Kurt Mueller wrote:
> I have to say that I am a bit disapointed by the chardet library.
> The encoding for the single character 'ü'
> is detected as {'confidence': 0.99, 'encoding': 'EUC-JP'},
> whereas "file" says:
> $ echo "ü" | file -i -
> /dev/stdin: text/plain; charset=utf-8
> $
>
> "ü" is a
On Thu, Aug 29, 2013 at 2:45 PM, Andreas Ecaz wrote:
> I've decided to go with Flask! It's now running on UWSGI with NGINX.
> Hopefully I can get some stuff done :)
How are you running uWSGI? On sane (non-Windows) OSes, I recommend
using the uWSGI Emperor, which will protect you from your websi
On Thu, Aug 29, 2013 at 10:40 PM, Joe Junior wrote:
> @ChrisA
>>Do you believe that you can write code to catch every bug you might
>>make? If so, you are naive and probably haven't spent much time
>>programming yet :) And if not, then you must acknowledge that bugs
>>WILL happen; therefore you wi
I've decided to go with Flask! It's now running on UWSGI with NGINX. Hopefully
I can get some stuff done :)
@Chris “Kwpolska” Warrick
I just don't like the big frameworks, for me there is too much magic going on.
--
http://mail.python.org/mailman/listinfo/python-list
Well, the main reason for me asking this question here was because of
the Java/C#/Whatever developer in me craving for an Interface for the
container's items, and I noticed that I'm not alone in this. But I was
actually expecting the "We're all consenting adults, here", I guess I
just needed the co
Στις 29/8/2013 2:54 μμ, ο/η Gregory Ewing έγραψε:
i.she...@gmail.com wrote:
I should write a python script(s) that listens to an existing XMLRPC
service on my company's dev server.
then i should parse that and return to the existing XML-RPC,
> or write the parsed data to the Posgresql data
i.she...@gmail.com wrote:
I should write a python script(s) that listens to an existing XMLRPC
service on my company's dev server.
then i should parse that and return to the existing XML-RPC,
> or write the parsed data to the Posgresql database.
but i'm not permitted to edit the existing X
Am 29.08.2013 11:12, schrieb Peter Otten:
> kurt.alfred.muel...@gmail.com wrote:
>> On Wednesday, August 28, 2013 1:13:36 PM UTC+2, Dave Angel wrote:
>>> On 28/8/2013 04:32, Kurt Mueller wrote:
For some text manipulation tasks I need a template to split lines
from stdin into a list of str
On Wed, Aug 28, 2013 at 5:42 AM, Fabrice POMBET wrote:
>
> On 8/28/2013 4:57 AM, Piotr Dobrogost wrote:
>
>> Having repr(None) == 'None' is sure the right thing but why does str(None)
>> == 'None'? Wouldn't it be more correct if it was an empty string?
>
> the point of str(obj) is to return a str
On Wed, Aug 28, 2013 at 6:21 AM, Steven D'Aprano
wrote:
> On Wed, 28 Aug 2013 01:57:16 -0700, Piotr Dobrogost wrote:
>
>> Hi!
>>
>> Having repr(None) == 'None' is sure the right thing but why does
>> str(None) == 'None'? Wouldn't it be more correct if it was an empty
>> string?
>
>
> Why do you th
Op 29-08-13 09:50, Gary Herron schreef:
> On 08/28/2013 07:10 PM, Sam Fourman Jr. wrote:
>>
>> On Wed, Aug 28, 2013 at 8:18 PM, Mohsen Pahlevanzadeh
>> mailto:moh...@pahlevanzadeh.org>> wrote:
>>
>> Dear all,
>>
>> I'm C++ programmer and unfortunately put semicolon at end of my
>> state
On Thu, Aug 29, 2013 at 2:43 AM, Philip Inglesant wrote:
> Hi Martyn,
>
> Thanks for the good advice to download VS 2008 before M$ delete it from
> their download servers.
>
> Unfortunately they have already done this so many Python modules now can't
> be compiled correctly on Windows!
>
> Best r
On 29 Aug 2013 10:54, "Chris Angelico" wrote:
>
> foreach (some_array, mixed val) if (some_condition)
> {
> //do something with val
> }
>
I hope that you don't mind that I have started to use this in JavaScript
back at work. Its foreach loop requires you to do a filter all the time.
It is a
On Thu, Aug 29, 2013 at 7:39 PM, Alister wrote:
> Yet no doubt you voluntarily indent your c code to make it readable?
> it wont take long before you find you don't even think about indentation
> and actually like it
Most of the time, in any language, I will indeed have indentation
matching the s
Hi Martyn,
Thanks for the good advice to download VS 2008 before M$ delete it from
their download servers.
Unfortunately they have already done this so many Python modules now
can't be compiled correctly on Windows!
Best regards,
Philip
--
http://mail.python.org/mailman/listinfo/python-lis
On Wed, 28 Aug 2013 18:09:22 -0300, Joe Junior wrote:
> Of course I don't want to check isistance(), I like duck typing, but
> should I check if hasattr() and callable() before adding to the container?
That won't tell you if the object has a quack() method but with
incompatible semantics (e.g. wr
On Wed, 28 Aug 2013 22:10:16 -0400, Sam Fourman Jr. wrote:
> On Wed, Aug 28, 2013 at 8:18 PM, Mohsen Pahlevanzadeh <
> moh...@pahlevanzadeh.org> wrote:
>
>> Dear all,
>>
>> I'm C++ programmer and unfortunately put semicolon at end of my
>> statements in python.
>>
>> Quesion:
>> What's really def
kurt.alfred.muel...@gmail.com wrote:
> On Wednesday, August 28, 2013 1:13:36 PM UTC+2, Dave Angel wrote:
>> On 28/8/2013 04:32, Kurt Mueller wrote:
>> > For some text manipulation tasks I need a template to split lines
>> > from stdin into a list of strings the way shlex.split() does it.
>> > The
On Thu, Aug 29, 2013 at 4:18 AM, Sam Fourman Jr. wrote:
> there are MANY micro frameworks, I have been following these guys for a few
> years
> http://www.pocoo.org/
+1. The Pocoo team makes many awesome things.
> specifically jinja2 and flask looks to be the best choice out of all the
> option
Am looking for a TUI (textual user interface) mechanism to allow a Python
program to create and update a display in text mode. For example, if a
command prompt was sized 80x25 it would be made up of 80 x 25 = 2000
characters. The Python program would need to be able to write to any of
those 200
On 08/28/2013 07:10 PM, Sam Fourman Jr. wrote:
On Wed, Aug 28, 2013 at 8:18 PM, Mohsen Pahlevanzadeh
mailto:moh...@pahlevanzadeh.org>> wrote:
Dear all,
I'm C++ programmer and unfortunately put semicolon at end of my
statements in python.
Quesion:
What's really defference
On Thu, 29 Aug 2013 08:31:25 +0200, Fabrice POMBET wrote:
> I am no depository of the pythonic way to think(tm) but I would create
> flock and inherit Duck from flock, or possibly set Flock as a method of
> ducks.
Neither of those are good design.
Donald is an individual Duck, he is not a flock
Hello,
I should write a python script(s) that listens to an existing XMLRPC service on
my company's dev server.My utility should take some data from that XMLRPC, send
it to an online xml service provider(it's something about hotel accomodation,
where they have xml patterns for different request
Le mercredi 28 août 2013 18:44:53 UTC+2, John Levine a écrit :
> I have a crufty old DNS provisioning system that I'm rewriting and I
>
> hope improving in python. (It's based on tinydns if you know what
>
> that is.)
>
>
>
> The record formats are, in the worst case, like this:
>
>
>
> fo
On Thu, Aug 29, 2013 at 4:31 PM, Fabrice POMBET wrote:
> I am no depository of the pythonic way to think(tm) but I would create flock
> and inherit Duck from flock, or possibly set Flock as a method of ducks.
>
Why should a Duck _be_ a Flock? They are quite different. No, a flock
_has_ a duck (o
On Wed, Aug 28, 2013 at 4:14 PM, wrote:
> So, I have been working in PHP for several years but I want to learn
> something new. That something new is Python. But since I'm a web developer
> I want to build stuff for the web.
>
> I don't want to use Django because it's too bloated, it seem to do
>
On Wed, Aug 28, 2013 at 8:18 PM, Mohsen Pahlevanzadeh <
moh...@pahlevanzadeh.org> wrote:
> Dear all,
>
> I'm C++ programmer and unfortunately put semicolon at end of my
> statements in python.
>
> Quesion:
> What's really defferences between putting semicolon and don't put?
>
> Yours,
> Mohsen
I
Here, for example, take a look:
http://www.clips.ua.ac.be/pages/pattern
> So, I have been working in PHP for several years but I want to learn
> something new. That something new is Python. But since I'm a web developer
> I want to build stuff for the web.
>
> I don't want to use Django because it
Le 29 août 2013 à 00:56, python-list-requ...@python.org a écrit :
"""While designing a simple library, I found myself asking a
philosophical question: to check or not to check the parameter's
interface?
I think that, considering it is Python, the usual answer would be
"no", but here is the situa
64 matches
Mail list logo