On 22 November 2010 21:43, Martin Lundberg wrote:
> Hi,
>
> I want to be able to let the user enter paths like this:
>
> apps/name/**/*.js
>
> and then find all the matching files in apps/name and all its
> subdirectories. However I found out that Python's glob function
> doesn't support the recur
On 23 November 2010 09:26, Martin Lundberg wrote:
> It does not seem to support the ** wildcard? It will recursively seek
> for files matching a pattern like *.js but it won't support
> /var/name/**/*.js as root, will it?
I did say roughly. ;-) You'd need to do:
for filename in locate("*.js", "/
Nobody wrote:
> On Mon, 22 Nov 2010 11:37:22 +0100, Peter Otten wrote:
>
>>> is there a convenient way to read bz2 files into a numpy array?
>>
>> Try
>
>> f = bz2.BZ2File(filename)
>> data = numpy.fromstring(f.read(), numpy.float32)
>
> That's going to hurt if the file is large.
Yes, but mem
On 22 nov, 21:44, Roman Dolgiy wrote:
>> http://stackoverflow.com/questions/4247036/python-recursively-getattr...
>
> I need to support a lot of legacy code, with THC4k's approach I'll
> have to modify project's existing code to use obj.attr1.val instead of
> obj.attr1 but this is not suitable.
Y
Hi!
Note up front: I'm using Python2.6 still, I guess with 2.7 test discovery, I
could get better results easier, right?
Now, my problem is I have a directory containing test scripts which I all
want to run. I used to run them individually and manually, but want to
avoid this overhead in the futu
Hi,
On Tue, 23 Nov 2010 11:36:05 +0100
Ulrich Eckhardt wrote:
> Now, my problem is I have a directory containing test scripts which I
> all want to run. I used to run them individually and manually, but
> want to avoid this overhead in the future.
>
> tests/
>foo.py # defines TestFoo1 and
On Tue, 23 Nov 2010 11:36:05 +0100, Ulrich Eckhardt wrote:
> tests/
>foo.py # defines TestFoo1 and TestFoo2
>bar.py # defines TestBar1 and TestBar2
>
> What I would like to do now is this:
>
> from tests import *
> unittest.main()
>
> In other words, import all test files and run t
On Nov 22, 11:38 am, Ulrich Eckhardt
wrote:
> Hi!
>
> I'm writing tests and I'm wondering how to achieve a few things most
> elegantly with Python's unittest module.
>
> Let's say I have two flags invert X and invert Y. Now, for testing these, I
> would write one test for each combination. What I
Thanks for the reply. Subject closed.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks to Andreas Waldenburger, THC4k (http://stackoverflow.com/
questions/4247036/python-recursively-getattribute) and others for
their tips. I was able to find solution:
class Null(object):
def __repr__(self):
return ""
def __str__(self):
return ''
def __nonzero__(s
On Nov 22, 5:12 pm, Raffael Cavallaro
wrote:
> On 2010-11-22 11:25:34 -0500, scattered said:
>
> > And you don't think that [JH] could write a book about Haskell
> > if he honestly came to think that it were a superior all-aroung
> > language?
>
> Until he actually does, he has a financial interes
On 2010-11-23 10:08:12 -0500, Keith H Duggar said:
There is a well-known name for such illogical reasoning: ad hominem.
You don't understand ad hominem:
"The ad hominem is a classic logical fallacy,[2] but it is not always
fallacious. For in some instances, questions of personal conduct,
ch
Steven D'Aprano wrote:
> On Tue, 23 Nov 2010 11:36:05 +0100, Ulrich Eckhardt wrote:
>> PS: I've been trying a few things here, and stumbled across another
>> thing that could provide a solution. I can "from tests import *", but
>> then all these modules will pollute my namespace. I can "import test
On Nov 23, 10:34 am, Raffael Cavallaro
wrote:
> On 2010-11-23 10:08:12 -0500, Keith H Duggar said:
> > On Nov 22, 5:12 pm, Raffael Cavallaro
> > wrote:
> > > On 2010-11-22 11:25:34 -0500, scattered said:
> > >
> > > > And you don't think that [JH] could write a book about Haskell
> > > > if he h
On Tue, 23 Nov 2010 10:34:22 -0500
Raffael Cavallaro
wrote:
> On 2010-11-23 10:08:12 -0500, Keith H Duggar said:
> > There is a well-known name for such illogical reasoning: ad hominem.
> You don't understand ad hominem:
Perhaps you don't understand it.
> "The ad hominem is a classic logical fal
Hi everyone,
Could you anybody shed lights to me? Say I have two dics.
>>> cstart
defaultdict(, {15424: ['Dec', '6', '18:57:40'], 552:
['Dec', '7', '09:31:00'], 15500: ['Dec', '6', '20:17:02'], 18863:
['Dec', '7', '13:14:47'], 18291: ['Dec', '6', '21:01:17'], 18969:
['Dec', '7', '14:28:42'], 18937
On Tue, Nov 23, 2010 at 9:47 AM, huisky wrote:
> Hi everyone,
>
> Could you anybody shed lights to me? Say I have two dics.
cstart
> defaultdict(, {15424: ['Dec', '6', '18:57:40'], 552:
> ['Dec', '7', '09:31:00'], 15500: ['Dec', '6', '20:17:02'], 18863:
> ['Dec', '7', '13:14:47'], 18291: ['De
> -Original Message-
> From: c...@rebertia.com [mailto: c...@rebertia.com]
> Sent: 2010年11月23日 19:12
> To: huisky
> Cc: python-list@python.org
> Subject: Re: Time and date operation
>
> On Tue, Nov 23, 2010 at 9:47 AM, huisky wrote:
>> Hi everyone,
>>
>> Could you anybody shed lights to me
I ran into an interesting problem trying to spawn a subprocess, so I thought
I'd ask if the experts could explain it to me. I'm spawning a subprocess to
run "pdf2txt.py", which is a tool that is distributed with PDFminer to do
moderately advanced text-dumps of PDFs. Yet when I run the same code o
On Tue, Nov 23, 2010 at 11:28 AM, Brett Bowman wrote:
> I ran into an interesting problem trying to spawn a subprocess, so I thought
> I'd ask if the experts could explain it to me. I'm spawning a subprocess to
> run "pdf2txt.py", which is a tool that is distributed with PDFminer to do
> moderate
Hello,
I was wondering if there is any way in python to 'collect output to
string' as in some lisps/schemes. Output being, printed output to the
console using print.
Thanks.
--
Burton Samograd
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Nov 23, 2010 at 11:53 AM, Burton Samograd wrote:
> Hello,
>
> I was wondering if there is any way in python to 'collect output to
> string' as in some lisps/schemes. Output being, printed output to the
> console using print.
Rebind sys.stdout to a StringIO object.
http://docs.python.org/
Ah, that fixed it. Thank you.
On Tue, Nov 23, 2010 at 11:37 AM, Chris Rebert wrote:
> On Tue, Nov 23, 2010 at 11:28 AM, Brett Bowman wrote:
> > I ran into an interesting problem trying to spawn a subprocess, so I
> thought
> > I'd ask if the experts could explain it to me. I'm spawning a subp
Chris Rebert writes:
> On Tue, Nov 23, 2010 at 11:53 AM, Burton Samograd wrote:
>> Hello,
>>
>> I was wondering if there is any way in python to 'collect output to
>> string' as in some lisps/schemes. Output being, printed output to the
>> console using print.
>
> Rebind sys.stdout to a StringI
On 23/11/2010 20:59, Burton Samograd wrote:
Chris Rebert writes:
On Tue, Nov 23, 2010 at 11:53 AM, Burton Samograd wrote:
Hello,
I was wondering if there is any way in python to 'collect output to
string' as in some lisps/schemes. Output being, printed output to the
console using print.
So I have not done much with child processes before.
I have an input of programs to be updated, a child process that does
the
compiles and links (with a log output to an individual file), and a
process wait
at the end. Except the child process can hang (at the moment, the
problem that might show
On Nov 23, 1:59 pm, Burton Samograd wrote:
> Thanks for the tip. Here's my function:
>
> def with_output_to_string(f, args):
> oldstdout = sys.stdout
> buffer = StringIO.StringIO()
> sys.stdout = buffer
> apply(f, args)
> sys.stdout = oldstdout
> return buffer.getval
On Tue, Nov 23, 2010 at 1:15 PM, Ian wrote:
> On Nov 23, 1:59 pm, Burton Samograd wrote:
>> Thanks for the tip. Here's my function:
>>
>> def with_output_to_string(f, args):
>> oldstdout = sys.stdout
>> buffer = StringIO.StringIO()
>> sys.stdout = buffer
>> apply(f, args)
>>
On 11/23/2010 3:02 PM, Chris Rebert wrote:
On Tue, Nov 23, 2010 at 11:53 AM, Burton Samograd wrote:
Hello,
I was wondering if there is any way in python to 'collect output to
string' as in some lisps/schemes. Output being, printed output to the
console using print.
Rebind sys.stdout to a St
Keith H Duggar wrote:
> It is a common refuge of those who cannot support their position with
> fact and logic. On more than one occasion Jon Harrop has all but
> crushed Ertugrul in this very forum with /source code/; that is as
> objective as it gets.
Since Jon has financial reasons to invest
On Nov 22, 11:32 pm, Dennis Lee Bieber wrote:
> Or upgrade to some modernistic framework wherein the application is
> a monolithic program and the "name/" portion maps to methods/functions
> within the application...
Yes, that describes what I am looking for! Is there such a modernistic
f
On 11/23/2010 7:01 PM, Gnarlodious wrote:
On Nov 22, 11:32 pm, Dennis Lee Bieber wrote:
Or upgrade to some modernistic framework wherein the application is
a monolithic program and the "name/" portion maps to methods/functions
within the application...
Yes, that describes what I am l
Is there a way I can define an Array of and unknown size so I can add and
remove to or from it?
Are arrays immutable?
--
http://mail.python.org/mailman/listinfo/python-list
On 11/23/2010 10:55 PM, Garland Fulton wrote:
Is there a way I can define an Array of and unknown size so I can add
and remove to or from it?
Do you mean the arrays of the array module, or NumPy arrays, or
something else entirely? In the first case, yes; arrays behave more or
less like lists
I'm generally pleased with difflib.SequenceMatcher: It's probably not
the best available string matcher out there, but it's in the standard
library and I've seen worse in the wild. One thing that kind of
bothers me is that it's sensitive to which argument you pick as "seq1"
and which you pick as
35 matches
Mail list logo