dasacc22, 08.05.2010 19:19:
This is a simple question. I'm looking for the fastest way to
calculate the leading whitespace (as a string, ie '').
Here is an (untested) Cython 0.13 solution:
from cpython.unicode cimport Py_UNICODE_ISSPACE
def leading_whitespace(unicode ustring):
On May 9, 10:08 am, Paul Boddie wrote:
> On 9 Mai, 09:05, Carl Banks wrote:
> > Bottom line is, GPL hurts everyone: the companies and open source
> > community. Unless you're one of a handful of projects with sufficient
> > leverage, or are indeed a petty jealous person fighting a holy war,
> >
Steven D'Aprano writes:
> It's certainly true
> that an MIT licence will allow you to maximise the number of people who
> will use your software, but maximising the number of users is not the
> only motive for writing software.
I'd say proprietary licenses where you spend billions on marketing
On May 9, 5:05 pm, Paul Boddie wrote:
> On 9 Mai, 21:55, Patrick Maupin wrote:
>
> > On May 9, 12:08 pm, Paul Boddie wrote:
>
> > > Oh sure: the GPL hurts everyone, like all the companies who have made
> > > quite a lot of money out of effectively making Linux the new
> > > enterprise successor
On May 9, 6:39 pm, Paul Boddie wrote:
> On 10 Mai, 00:02, Patrick Maupin wrote:
> If this is code that you would consider using in an existing project,
Well, in a few cases I'm talking about, I wouldn't consider using the
code -- I just stumbled across it when researching some terms, and
discou
On Sun, May 9, 2010 at 2:22 AM, Martin P. Hellwig <
martin.hell...@dcuktec.org> wrote:
> Microsoft has indeed lost control of it in the same way, it is just because
> we here in the 'western' world spend huge amount of money on prosecuting and
> bringing to 'justice' does who, whether for commerci
Stepping back from the political/philosophical/religious arguments, I'd like to
give some adjectival advice based on my own perspective.
How you license your software should be based on how you want it to be used.
If you are releasing an end user application I do not care how you license it.
If
Hi there,
Using Python 3.1.2 I am having a problem sending binary attachment files
(jpeg, pdf, etc.) - MIMEText attachments work fine. The code in question
is as follows...
for file in self.attachments:
part = MIMEBase('application', "octet-stream")
part.set_payload(open(file,"rb").read()
On 10 Mai, 00:02, Patrick Maupin wrote:
>
> You just answered your own question. It's pathetic to try to change
> people's behavior by offering them something worthless if they change
> their license to match yours. (I'm not at all saying that all GPL
> code is worthless, but I have seen things
On 05/09/10 21:06, Stephen Hansen wrote:
On Sun, May 9, 2010 at 12:33 PM, Martin P. Hellwig
mailto:martin.hell...@dcuktec.org>> wrote:
On 05/09/10 18:24, Stephen Hansen wrote:
Wait, what? Why shouldn't I profit repeatedly from the "same
work already done"? *I* cre
On 9 Mai, 21:55, Patrick Maupin wrote:
> On May 9, 12:08 pm, Paul Boddie wrote:
>
> > Oh sure: the GPL hurts everyone, like all the companies who have made
> > quite a lot of money out of effectively making Linux the new
> > enterprise successor to Unix, plus all the companies and individuals
> >
On May 9, 4:21 pm, Paul Boddie wrote:
(Lots of good and balanced commentary snipped...)
> I didn't say that you personally argued that way, but people do argue
> that way. In fact, it's understandable that this is how some people
> attempt to understand the GPL - the software maintains a particu
On 9 May 2010 20:36, Godson Gera wrote:
>
>
> On Sun, May 9, 2010 at 6:24 PM, Fuzzyman wrote:
>
>> On Mar 23, 10:04 pm, geremy condra wrote:
>> > On Tue, Mar 23, 2010 at 1:07 PM, Tim Golden
>> wrote:
>> > > On 23/03/2010 16:55, Jose Manuel wrote:
>> >
>>
>> The closest is Skulpt which is very
On 9 Mai, 21:07, Patrick Maupin wrote:
> On May 9, 1:02 pm, Paul Boddie wrote:
> >
> > People often argue
> > that the GPL only cares about the software's freedom, not the
> > recipient's freedom, which I find to be a laughable claim because if
> > one wanted to point at something the GPL places
Hi,
> > Do you mean, that you would then expect the decompressobj method to
> > fail as well?
>
> Yes.
>
> > But, no, d.flush() returns the empty string after decompressing
> > ``data``.
>
> Hmm, then it's a bug. Can you report it tohttp://bugs.python.org?
I will - thanks for your advice,
Matthe
2010/5/9 Robin :
> Does anyone know of a way I can make a python script into an exe that
> runs on windows7, I don't care if it is a python to c++ or python to c
> translator or anything like it. The version of python I am using is
> python 3.1. Thanks,
> -Robin
> --
> http://mail.python.org/mailma
Am 07.05.2010 04:48, schrieb TomF:
On 2010-05-06 18:20:02 -0700, Trent Nelson said:
I'm interested in improving my python design by studying a large,
well-designed codebase.
I'll tell you one of the best ways to improve your Python code: attend
one of Raymond Hettinger's Code Clinic workshops
On Sun, May 9, 2010 at 1:28 PM, Robin wrote:
> Does anyone know of a way I can make a python script into an exe that
> runs on windows7, I don't care if it is a python to c++ or python to c
> translator or anything like it. The version of python I am using is
> python 3.1. Thanks,
The standard to
Does anyone know of a way I can make a python script into an exe that
runs on windows7, I don't care if it is a python to c++ or python to c
translator or anything like it. The version of python I am using is
python 3.1. Thanks,
-Robin
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, May 9, 2010 at 12:33 PM, Martin P. Hellwig <
martin.hell...@dcuktec.org> wrote:
> On 05/09/10 18:24, Stephen Hansen wrote:
>
>>
>>
>> Wait, what? Why shouldn't I profit repeatedly from the "same work already
>> done"? *I* created, its *mine*. I put blood, sweat and tears into it and
>> pe
On May 9, 12:08 pm, Paul Boddie wrote:
> On 9 Mai, 09:05, Carl Banks wrote:
>
>
>
> > Bottom line is, GPL hurts everyone: the companies and open source
> > community. Unless you're one of a handful of projects with sufficient
> > leverage, or are indeed a petty jealous person fighting a holy war
On May 9, 8:58 am, Ed Keith wrote:
> Stepping back from the political/philosophical/religious arguments, I'd like
> to give some real advice based on my own perspective.
>
> How you license your software should be based on how you want it to be used.
>
> If you are releasing an end user applicati
On 05/09/10 18:24, Stephen Hansen wrote:
Wait, what? Why shouldn't I profit repeatedly from the "same work
already done"? *I* created, its *mine*. I put blood, sweat and tears
into it and perhaps huge amounts of resources, risking financial
security and sanity, and you're arguing I shouldn't
On May 9, 1:42 am, Paul Rubin wrote:
> Patrick Maupin writes:
> > I certainly agree that RMS's language is couched in religious rhetoric.
>
> I would say political movement rhetoric. He's not religious. He uses
> the word "spiritual" sometimes but has made it clear he doesn't mean
> that in a r
On May 9, 1:02 pm, Paul Boddie wrote:
> On 8 Mai, 22:05, Patrick Maupin wrote:
>
> > On May 8, 2:38 pm, Steven D'Aprano
> > > No, you don't *owe* them anything, but this brings us back to Ben's
> > > original post. If you care about the freedoms of Cisco's customers as
> > > much as you care abo
On May 9, 8:28 am, John Machin wrote:
> dasacc22 gmail.com> writes:
>
>
>
> > U presume entirely to much. I have a preprocessor that normalizes
> > documents while performing other more complex operations. Theres
> > nothing buggy about what im doing
>
> Are you sure?
>
> Your "solution" calcula
I have some generic somas that I'd like to part with. I'm charging
only $1.00 per pill plus S&H. Please let me know if you are
interested. shatteredsold...@hushmail.com
--
http://mail.python.org/mailman/listinfo/python-list
On May 9, 1:03 pm, Steven D'Aprano wrote:
> On Sat, 08 May 2010 13:05:21 -0700, Patrick Maupin wrote:
>
> [...]
>
> > certainly the
> > risk of discovery if you just use a small portion of GPL code and don't
> > distribute your source must be very small. There are certainly fewer
> > companies get
On Sun, May 9, 2010 at 6:24 PM, Fuzzyman wrote:
> On Mar 23, 10:04 pm, geremy condra wrote:
> > On Tue, Mar 23, 2010 at 1:07 PM, Tim Golden
> wrote:
> > > On 23/03/2010 16:55, Jose Manuel wrote:
> >
>
> The closest is Skulpt which is very much an incomplete implementation
> of Python that runs
On 9 Mai, 19:55, Steven D'Aprano wrote:
>
> Patrick said that Apple is NOT a "do no evil" company.
Yes, apologies to Patrick for reading something other than what he
wrote. I suppose I've been reading too many Apple apologist
commentaries of late and probably started to skim the text after I hit
On Sat, 08 May 2010 13:05:21 -0700, Patrick Maupin wrote:
[...]
> certainly the
> risk of discovery if you just use a small portion of GPL code and don't
> distribute your source must be very small. There are certainly fewer
> companies getting away with MIT license violations, simply because the
On 8 Mai, 22:05, Patrick Maupin wrote:
> On May 8, 2:38 pm, Steven D'Aprano >
> > No, you don't *owe* them anything, but this brings us back to Ben's
> > original post. If you care about the freedoms of Cisco's customers as
> > much as you care about the freedoms of Cisco, then that's a good reas
On Sun, 09 May 2010 22:52:55 +1000, Lie Ryan wrote:
>>> IMHO that's more complex due to the nested loop,
>>
>> What's so complex about a nested loop?
>
> one more nested tab. That extra whitespaces is quite irritating.
Then say you don't like it, don't try to make a subjective dislike seem
obj
On Sun, 09 May 2010 10:23:29 -0700, Paul Boddie wrote:
> On 9 Mai, 07:09, Patrick Maupin wrote:
>>
>> See, for example, Apple's
>> support of BSD, Webkit, and LLVM. Apple is not a "do no evil"
>> corporation, and their contributions back to these pack
On Sun, 9 May 2010 09:25:16 -0700 (PDT)
Matthew Brett wrote:
> > How about:
> >
> > d = zlib.decompressobj()
> > out = d.decompress(data) + d.flush()
>
> Do you mean, that you would then expect the decompressobj method to
> fail as well?
Yes.
> But, no, d.flush() returns the empty string after
On Sun, May 9, 2010 at 10:23 AM, Paul Boddie wrote:
> On 9 Mai, 07:09, Patrick Maupin wrote:
> > Apple is ***not a "do no evil" corporation
>
> This being the same Apple that is actively pursuing software patent
> litigation against other organisations; a company which accuses other
> compa
On 9 Mai, 07:09, Patrick Maupin wrote:
>
> See, for example, Apple's
> support of BSD, Webkit, and LLVM. Apple is not a "do no evil"
> corporation, and their contributions back to these packages are driven
> far more by hard-nosed business decisions th
On 9 Mai, 09:05, Carl Banks wrote:
>
> Bottom line is, GPL hurts everyone: the companies and open source
> community. Unless you're one of a handful of projects with sufficient
> leverage, or are indeed a petty jealous person fighting a holy war,
> the GPL is a bad idea and everyone benefits from
Am 09.05.2010 11:59, schrieb Lawrence D'Oliveiro:
In message,
exar...@twistedmatrix.com wrote:
On 07:48 am, l...@geek-central.gen.new_zealand wrote:
In message,
exar...@twistedmatrix.com wrote:
This is a good example of why it's a bad idea to use select on
Windows.
Instead, use WaitForMulti
Hi,
Thanks for the reply.
> > If instead I do this:
>
> > out = zlib.decompressobj().decompress(data)
>
> How about:
>
> d = zlib.decompressobj()
> out = d.decompress(data) + d.flush()
Do you mean, that you would then expect the decompressobj method to
fail as well?
But, no, d.flush() returns t
On Mar 23, 1:55 pm, Jose Manuel wrote:
> I have been learning Python, and it is amazing I am using the
> tutorial that comes with the official distribution.
>
> At the end my goal is to develop applied mathematic in engineering
> applications to be published on the Web, specially on app. orie
On Apr 1, 4:22 am, timo verbeek wrote:
> On Apr 1, 12:48 am, Abethebabe wrote:
>
> > I wanted to know if there was a way I could get a Python program to
> > run off of my flash drive as soon as the computer (Windows) detected
> > the device?
>
> > For example I could have a a simple program that
On 05/09/10 10:05, Chris Rebert wrote:
> Additionally, it makes no sense to call an *instance* method such as
> f1() in a class context. Or in Java-speak: you can't call a non-static
> method in a static context.
Actually, in python it does make sense, with a caveat that you have
to provide the in
Stepping back from the political/philosophical/religious arguments, I'd like to
give some real advice based on my own perspective.
How you license your software should be based on how you want it to be used.
If you are releasing an end user application I do not care how you license it.
If it is
On May 9, 6:13 am, Steven D'Aprano wrote:
> On Sat, 08 May 2010 13:46:59 -0700, Mark Dickinson wrote:
> >> However, s[:-len(t)] should be both faster and correct.
>
> > Unless len(t) == 0, surely?
>
> Doh! The hazards of insufficient testing. Thanks for catching that.
I have a love-hate relations
dasacc22 gmail.com> writes:
>
> U presume entirely to much. I have a preprocessor that normalizes
> documents while performing other more complex operations. Theres
> nothing buggy about what im doing
Are you sure?
Your "solution" calculates (the number of leading whitespace characters) + (th
Hi,
If you've ever missed it on Windows and you can use Powershell, you
might want to take a look at this port of virtualenvwrapper:
http://bitbucket.org/guillermooo/virtualenvwrapper/wiki/Home
It's a work in progress, but is should be fairly functional already.
It requires Powershell v2.
Rega
On 8 Mai, 21:46, Steven D'Aprano wrote:
> On Sat, 08 May 2010 12:15:22 -0700, Wolfram Hinderer wrote:
> > Returning s[:-1 - len(t)] is faster.
>
> I'm sure it is. Unfortunately, it's also incorrect.
> However, s[:-len(t)] should be both faster and correct.
Ouch. Thanks for correcting me.
No, I'
On 05/09/10 19:18, Steven D'Aprano wrote:
> On Sun, 09 May 2010 15:17:38 +1000, Lie Ryan wrote:
>
>> On 05/09/10 07:09, Günther Dietrich wrote:
>>>
>>> Why not this way?
>>>
>> a = [[1,2,3,4], [5,6,7,8]]
>> for i in a:
>>> for j in i:
>>> print(j)
>>>
>>> 1
>>> 2
On Sun, 9 May 2010 01:28:14 -0700 (PDT)
Matthew Brett wrote:
>
> If instead I do this:
>
> out = zlib.decompressobj().decompress(data)
How about:
d = zlib.decompressobj()
out = d.decompress(data) + d.flush()
?
Notice the documentation for decompressobj.decompress (emphasis mine):
“Decompres
On Mar 23, 10:04 pm, geremy condra wrote:
> On Tue, Mar 23, 2010 at 1:07 PM, Tim Golden wrote:
> > On 23/03/2010 16:55, Jose Manuel wrote:
>
> >> I have been learning Python, and it is amazing I am using the
> >> tutorial that comes with the official distribution.
>
> >> At the end my goal i
Thanks David, that is a 'tonne' of information. I am going to have a play
with it, probably looking at masking out the contents of the label and
finding the label border within the scanned document is the place to start.
Looks like there is going to be a learning curve here.
Thanks again for yo
To see the picture
http://wooogooo.pixa.us/images/18838653/1
http://wooogooo.pixa.us/images/18838652/2
Welcome to discus . lol
--
http://mail.python.org/mailman/listinfo/python-list
On 05/08/2010 10:33 PM, 3Jane wrote:
You could interpret [[1,2,3,4],[5,6,7,8]] as a tree and
your task as traversal of its leaves. All solutions before
would not work with trees with bigger height.
Here is how to traverse such trees recursively:
def eventualPrint(x):
for v in x:
i
On Sat, 08 May 2010 16:50:11 -0700, ben wrote:
> Why doesn't this work:
>
> class C1:
> def f1(self):
> print("f1")
>
> class C2(C1):
> f1()
>
>
> It throws this error:
>
> Traceback (most recent call last):
> File "./c1.py", line 7, in
> class C2(C1):
> File "./c1.py
hey,
I wich to have an example please
need help
2010/5/9 Chris Rebert
> On Sun, May 9, 2010 at 1:15 AM, mohamed issolah
> wrote:
> > hey,
> >
> > there is an alternative of win32com in linux?
> >
> > what i want to say : can communicate with application (ex: evolution or
> > another) through
superpollo writes:
> "if a b c are digits, solve ab:c=a*c+b"
>
> solved in one minute with no thought:
Obviously.
> for a in range(10):
> for b in range(10):
> for c in range(10):
> try:
> if (10.*a+b)/c==a*c+b:
> print "%i%i:%i=%i*%i+
On 9 May 2010, at 16:29, Xavier Ho wrote:
On Sun, May 9, 2010 at 6:20 PM, gopi krishna
mailto:dasarathulag...@gmail.com>> wrote:
Why list comprehension faster than for loop?
Because Python optimises for certain special cases, when the number of
iterations is predicable in a list comprehension.
In message ,
exar...@twistedmatrix.com wrote:
> On 07:48 am, l...@geek-central.gen.new_zealand wrote:
>
>>In message ,
>>exar...@twistedmatrix.com wrote:
>>
>>>This is a good example of why it's a bad idea to use select on
>>>Windows.
>>>Instead, use WaitForMultipleObjects.
>>
>>How are you suppo
On Sun, May 9, 2010 at 11:31 AM, Xavier Ho wrote:
> On Sun, May 9, 2010 at 7:20 PM, superpollo wrote:
>>
>> "if a b c are digits, solve ab:c=a*c+b"
>
> Sorry, what does the notation ab:c mean?
The number ab divided by c.
--
André Engels, andreeng...@gmail.com
--
http://mail.python.org/mailma
On Sun, May 9, 2010 at 7:20 PM, superpollo wrote:
> "if a b c are digits, solve ab:c=a*c+b"
>
Sorry, what does the notation ab:c mean?
Cheers,
Xav
--
http://mail.python.org/mailman/listinfo/python-list
On 05/09/10 04:49, Paul Rubin wrote:
As I read it, he is saying that when someone releases free software,
they have "for all intends and purposes lost control over its use", so
they "should have made peace with the fact" and surrender gracefully.
I'm asking why he doesn't think Microsoft has los
"if a b c are digits, solve ab:c=a*c+b"
solved in one minute with no thought:
for a in range(10):
for b in range(10):
for c in range(10):
try:
if (10.*a+b)/c==a*c+b:
print "%i%i:%i=%i*%i+%i" % (a,b,c,a,c,b)
except:
On Sun, 09 May 2010 15:17:38 +1000, Lie Ryan wrote:
> On 05/09/10 07:09, Günther Dietrich wrote:
>>
>> Why not this way?
>>
> a = [[1,2,3,4], [5,6,7,8]]
> for i in a:
>> for j in i:
>> print(j)
>>
>> 1
>> 2
>> 3
>> 4
>> 5
>> 6
>> 7
>> 8
>>
>> Too simple?
>
>
On Sun, May 9, 2010 at 1:33 AM, gopi krishna wrote:
> My Question is
> can we access the variables defined in a function ?
class A:
> def b(self):
> x=40
> z=40
>
>
q=A()
q.z
> 40
q.z=60
q.z
> 60
> We can access the variables defined in a class as shown abo
On Sun, May 9, 2010 at 1:15 AM, mohamed issolah wrote:
> hey,
>
> there is an alternative of win32com in linux?
>
> what i want to say : can communicate with application (ex: evolution or
> another) throught python like in windows with win32com
The closest equivalent would probably be python-dbus
Could you also demonstrate with an example as to what kind of effect you're
expecting from whatever you've been desiring to do?
On Sun, May 9, 2010 at 1:49 PM, gopi krishna wrote:
> Hi
>can I change the variable in a function using the function
> suppose
> >>>def a():
> x=20
> can we change t
thanks for the excercise just figured out this -
#!/usr/bin/env python
import sys
sys.setrecursionlimit(2000)
def flatten(l):
flattened = []
for i in l:
if type(i) == type([]):
flattened += flatten(i)
else:
flattened.append(i)
return flattened
if __name__=='__main__'
On Sun, May 9, 2010 at 6:19 PM, gopi krishna wrote:
> Hi
>can I change the variable in a function using the function
> suppose
> >>>def a():
> x=20
> can we change the variable using the function
>
Can you give us an example of how you'd like to "change the variable", in
code, and show us wha
Hi,
I sorry if this is a bad place to ask, but I wanted to find out if the
behavior I'm seeing is a bug.
I maintain scipy's matlab file readers, and I came across a zlib
compressed string that causes a zlib error on decompression, but only
with zlib.decompress, not zlib.decompressobj.
I saved th
On Sun, May 9, 2010 at 6:20 PM, gopi krishna wrote:
> Why list comprehension faster than for loop?
>
> Because Python optimises for certain special cases, when the number of
iterations is predicable in a list comprehension.
Cheers,
Xav
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, May 9, 2010 at 1:19 AM, gopi krishna wrote:
> Hi
> can I change the variable in a function using the function
> suppose
def a():
> x=20
> can we change the variable using the function
Your question is incomprehensible. Please rephrase it more clearly and
provide more details.
Rega
hey,
there is an alternative of win32com in linux?
what i want to say : can communicate with application (ex: evolution or
another) throught python like in windows with win32com
thanks, sorry for my english
need help
--
issolah mohamed
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, May 9, 2010 at 1:16 AM, gopi krishna wrote:
> Hi ,
> Anyone can pls help me in flattening the list.
> if p is the my list which is defined below
> p=[1,[2,3,4],[5,6,],9,[[11,12]]]
> from the above how to get a list
> as [1,2,3,4,5,6,9,11,12]
http://www.lmgtfy.com/?q=python+flatten+lis
Why list comprehension faster than for loop?
--
http://mail.python.org/mailman/listinfo/python-list
Hi
can I change the variable in a function using the function
suppose
>>>def a():
x=20
can we change the variable using the function
--
http://mail.python.org/mailman/listinfo/python-list
Hi ,
Anyone can pls help me in flattening the list.
if p is the my list which is defined below
p=[1,[2,3,4],[5,6,],9,[[11,12]]]
from the above how to get a list
as [1,2,3,4,5,6,9,11,12]
--
http://mail.python.org/mailman/listinfo/python-list
On May 8, 9:29 pm, Paul Rubin wrote:
> Carl Banks writes:
> > If a commercial developer has a EULA that prevents users from
> > combining their tools with tools from (say) their competitors,
>
> Do you mean something like a EULA that stops you from buying a copy of
> Oracle and combining it with
On May 8, 10:19 pm, Steven D'Aprano wrote:
> On Sat, 08 May 2010 16:39:33 -0700, Carl Banks wrote:
> > GPL is about fighting a holy war against commercial software.
>
> Much GPL software *is* commercial software. Given that you're so badly
> misinformed about the GPL that you think it can't be com
79 matches
Mail list logo