Stefan Behnel, 10.05.2010 08:54:
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_w
On 9 Mag, 11:20, superpollo wrote:
> "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:
Hello
I am trying to find if there is a string OR list function that will
search a list of strings for all the strings that start with 'a' &
return a new list containing all the strings that started with 'a'.
I have had a search of Python site & I could not find what I am
looking for, does a func
Have I missed something, or wouldn't this work just as well:
>>> list_of_strings = ['2', 'awes', '3465sdg', 'dbsdf', 'asdgas']
>>> [word for word in list_of_strings if word[0] == 'a']
['awes', 'asdgas']
Cheers,
Xav
On Mon, May 10, 2010 at 6:40 PM, Jimbo wrote:
> Hello
>
> I am trying to find
Jimbo ha scritto:
Hello
I am trying to find if there is a string OR list function that will
search a list of strings for all the strings that start with 'a' &
return a new list containing all the strings that started with 'a'.
I have had a search of Python site & I could not find what I am
look
Stefan Behnel wrote:
j vickroy, 07.05.2010 20:44:
I apologize if this is not the appropriate forum for a question about
Hudson (http://hudson-ci.org/), but I did not know where else to ask and
my web searches have not been fruitful.
Certainly nice to read something about Hudson in this forum,
AAA quality clothes cheap wholesale . (http://
www.jordanonline06.com/)
NFL jersey wholesale (http://www.jordanonline06.com/)
NFL NBA MLB NHL soccer soccer jerseys (http://
www.jordanonline06.com/)
nike brand,MLB jerseys china supplier (http://
www.jordanonline06.com/)
MLB jerseys china wholesaler
On Mon, May 10, 2010 at 6:50 PM, Xavier Ho wrote:
> Have I missed something, or wouldn't this work just as well:
>
list_of_strings = ['2', 'awes', '3465sdg', 'dbsdf', 'asdgas']
[word for word in list_of_strings if word[0] == 'a']
> ['awes', 'asdgas']
I would do this for completeness (ju
superpollo ha scritto:
Jimbo ha scritto:
Hello
I am trying to find if there is a string OR list function that will
search a list of strings for all the strings that start with 'a' &
return a new list containing all the strings that started with 'a'.
I have had a search of Python site & I could
Ben Cohen wrote:
Apologies for the TABs -- I wrote that example for demonstration purposes in my
mail client -- I'll copy and paste from a real code editor in the future.
Ben
There's nothing to apologies for. Be wary of those trying to get you out
of the right path, they will lie to you st
On 10 Mai, 03:09, Patrick Maupin wrote:
> On May 9, 6:39 pm, Paul Boddie wrote:
> > but if they aren't pitching it directly at you, why would you believe
> > that they are trying to change your behaviour?
>
> Because I've seen people specifically state that their purpose in
> GPLing small librari
ben wrote:
Ok, thanks for the info.
What would be a better way to do this? What I'm trying to do is treat
things in a reasonable OOP manner (all fairly new to me, esp. in
Python). Here's a made-up example with a little more context. Let's
say you're making a drawing program that can draw vari
Oltmans wrote:
On May 9, 1:53 am, superpollo wrote:
add = lambda a,b: a+b
for i in reduce(add,a):
print i
This is very neat. Thank you. Sounds like magic to me. Can you please
explain how does that work? Many thanks again.
shorter <> nicer IMO.
Those alternatives are intere
On Mar 23, 4: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
Dear Friends,
Is Python a functional programming language?
Is this a paradigm that is well supported by both the language syntax and the
general programming APIs?
I heard that lambdas were limited to a single expression, and that other
functional features were slated for removal in Python 3...
hi,
can some one explain why the __first__ test is not being run?
#!/usr/bin/env python
import unittest # {{{
class T1TestCase(unittest.TestCase):
def setUp(self):
pass # can we use global variables here?
def tearDown(self):
pass # garbage collection
def test
On 10 Mai, 08:31, Carl Banks wrote:
> On May 9, 10:08 am, 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
> > who
Just upgraded on my Windows 7 machine my copy of 2.6.4 to 2.6.5.
However doing sys.version still shows 2.6.4 even so python.exe is dated
19. March 2010 with a size of 26.624 bytes.
Is this a known issue? Or did I do something wrong?
If I install to a new folder all is well, but I would have
On Mon, May 10, 2010 at 8:38 AM, John Maclean wrote:
> hi,
>
> can some one explain why the __first__ test is not being run?
It looks like you defined test_T1 inside of the tearDown method.
--
http://mail.python.org/mailman/listinfo/python-list
Samuel Williams, 10.05.2010 14:24:
Is Python a functional programming language?
No. Python is a multi-paradigm language. But it does have functions (and
methods) as first-class objects.
Is this a paradigm that is well supported by both the language syntax
and the general programming APIs?
Samuel Williams a écrit :
Dear Friends,
Is Python a functional programming language?
Depends on your definition of "functional programming language", but
well, not really. It's mostly an imperative, object-oriented (but not
pure-object) language. It has some restricted support for some
func
Stefan Behnel wrote:
j vickroy, 07.05.2010 20:44:
I apologize if this is not the appropriate forum for a question about
Hudson (http://hudson-ci.org/), but I did not know where else to ask and
my web searches have not been fruitful.
Certainly nice to read something about Hudson in this forum,
Jean-Michel Pichavant wrote:
Stefan Behnel wrote:
j vickroy, 07.05.2010 20:44:
I apologize if this is not the appropriate forum for a question about
Hudson (http://hudson-ci.org/), but I did not know where else to ask and
my web searches have not been fruitful.
Certainly nice to read somethin
My guess is you mixed tabs and spaces. One tab is always treated by the
python interpreter as being equal to eight spaces, which is two
indentation levels in your code.
Though if it were exactly as you show it, you'd be getting a syntax
error, because even there, it looks like the indentation of
Hi to all, i want to ask you a question, concerning the best way to do
the following as a POST request:
There is server-servlet that accepts xml commands
It had the following HTTP request headers:
Host: somehost.com
User-Agent: Jakarta Commons-HttpClient
Content
Hi,
just a small question. Is it possible to change the refcount of a
reference manually? For debugging / ...
Thanks!
moerchendiser2k3
--
http://mail.python.org/mailman/listinfo/python-list
moerchendiser2k3 wrote:
Hi,
just a small question. Is it possible to change the refcount of a
reference manually? For debugging / ...
Thanks!
moerchendiser2k3
Why don't you just create a global reference to the object ? Unless this
one is removed, the object will be kept in memory.
JM
--
On 10/05/2010 14:38, J. Cliff Dyer wrote:
My guess is you mixed tabs and spaces. One tab is always treated by the
python interpreter as being equal to eight spaces, which is two
indentation levels in your code.
Though if it were exactly as you show it, you'd be getting a syntax
error, because e
On Mon, May 10, 2010 at 7:30 PM, [email protected] wrote:
> Hi to all, i want to ask you a question, concerning the best way to do
> the following as a POST request:
> There is server-servlet that accepts xml commands
> It had the following HTTP request headers:
>
> Host: somehost.com
>
j vickroy wrote:
Stefan Behnel wrote:
j vickroy, 07.05.2010 20:44:
I apologize if this is not the appropriate forum for a question about
Hudson (http://hudson-ci.org/), but I did not know where else to ask
and
my web searches have not been fruitful.
Certainly nice to read something about Hu
Do to some debugging if a version contains a bug and needs to be fixed
there manually.
--
http://mail.python.org/mailman/listinfo/python-list
On May 10, 10:22 am, Kushal Kumaran
wrote:
> On Mon, May 10, 2010 at 7:30 PM, [email protected] wrote:
> > Hi to all, i want to ask you a question, concerning the best way to do
> > the following as a POST request:
> > There is server-servlet that accepts xml commands
> > It had the following HTTP
On May 10, 6:01 am, Paul Boddie wrote:
> On 10 Mai, 03:09, Patrick Maupin wrote:
>
> > On May 9, 6:39 pm, Paul Boddie wrote:
> > > but if they aren't pitching it directly at you, why would you believe
> > > that they are trying to change your behaviour?
>
> > Because I've seen people specificall
In article <074b412a-c2f4-4090-a52c-4d69edb29...@d39g2000yqa.googlegroups.com>,
Paul Boddie wrote:
>
>Actually, the copyleft licences don't "force" anyone to "give back
>changes": they oblige people to pass on changes.
IMO, that's a distinction without a difference, particularly if you
define "g
On Mon, 10 May 2010 07:26:42 -0700 (PDT)
moerchendiser2k3 wrote:
>
> Do to some debugging if a version contains a bug and needs to be fixed
> there manually.
This is certainly the wrong approach.
To know if your Python code is leaking references, use either
sys.getrefcount(), or (better) a weakr
supply sports shoes. The brand Sports shoes basketball shoes, Boot,
walling shoes, Athletic shoes, Jogging shoes, running shoes, leather
shoes, football, shoe sports shoe Footwear Sneaker, Shox Max Rift T-
shirts, womens t-shirts, Clothing womens clothing, wear hats Caps
Jersey jeans Sock Jacks,
[we have previously been using "MIT-style" and "BSD-style" licensing in
this thread for the most part -- given the poster who suggested that
Apache makes more sense these days, I'm switching to that terminology]
In article <[email protected]>,
Carl Ba
Jean-Michel Pichavant wrote:
j vickroy wrote:
Stefan Behnel wrote:
j vickroy, 07.05.2010 20:44:
I apologize if this is not the appropriate forum for a question about
Hudson (http://hudson-ci.org/), but I did not know where else to ask
and
my web searches have not been fruitful.
Certainly n
On May 5, 8:00 am, James Mills wrote:
> On Wed, May 5, 2010 at 3:35 PM, Michele Simionato
>
> wrote:
> > I am sure it has, but I was talking about just putting in the
> > repository an index.html file and have it published, the wayI hear it
> > works in BitBucket and GitHub.
>
> I'm pretty sure
In article ,
James Mills wrote:
>On Mon, May 10, 2010 at 6:50 PM, Xavier Ho wrote:
>> Have I missed something, or wouldn't this work just as well:
>>
> list_of_strings = ['2', 'awes', '3465sdg', 'dbsdf', 'asdgas']
> [word for word in list_of_strings if word[0] == 'a']
>> ['awes', 'asdgas
On 10 Mai, 17:06, [email protected] (Aahz) wrote:
> In article
> <074b412a-c2f4-4090-a52c-4d69edb29...@d39g2000yqa.googlegroups.com>,
> Paul Boddie wrote:
> >Actually, the copyleft licences don't "force" anyone to "give back
> >changes": they oblige people to pass on changes.
>
> IMO, that's
Samuel Williams writes:
> Is Python a functional programming language?
It supports some aspects of functional programming but I wouldn't go as
far as to call it an FPL.
> Is this a paradigm that is well supported by both the language syntax
> and the general programming APIs?
I'd say "somewha
In article <[email protected]>,
Paul Rubin wrote:
>
>If your goal is to engage in functional programming, you're better off
>using a language designed for that purpose. Python is a pragmatic
>language from an imperative tradition, that has some functional features
>tacked on.
Hi all,
Sorry for the short notice.
We (the Zope/Python Users Group of DC) are having a
TurboGears 2 training class this weekend in Washington, DC USA
taught by core developer Chris Perkins.
Please consider attending! And, I would appreciate you spreading the
word to anyone you think may be int
On May 10, 12:37 pm, Paul Boddie wrote:
> On 10 Mai, 17:06, [email protected] (Aahz) wrote:
>
> > In article
> > <074b412a-c2f4-4090-a52c-4d69edb29...@d39g2000yqa.googlegroups.com>,
> > Paul Boddie wrote:
> > >Actually, the copyleft licences don't "force" anyone to "give back
> > >changes":
On Tue, 11 May 2010 00:24:22 +1200, Samuel Williams wrote:
> Is Python a functional programming language?
Not in any meaningful sense of the term.
> Is this a paradigm that is well supported by both the language syntax and
> the general programming APIs?
No.
> I heard that lambdas were limited
How can I concatenate 2 hex strings (e.g. '\x16' and '\xb9') then convert
the answer to an integer?
When I try i always end up with the ASCII equivalent!
Thanks,
Anthony
--
http://mail.python.org/mailman/listinfo/python-list
I know how to use timeit and/or profile to measure the current run-time
cost of some code.
I want to record the time used by some original implementation, then
after I rewrite it, I want to find out if I made stuff faster or slower,
and by how much.
Other than me writing down numbers on a piece o
On Mon, May 10, 2010 at 12:55 PM, Anthony Cole wrote:
> How can I concatenate 2 hex strings (e.g. '\x16' and '\xb9') then convert
> the answer to an integer?
>
> When I try i always end up with the ASCII equivalent!
I think you want the `struct` module:
struct — Interpret strings as packed binary
Anthony Cole wrote:
How can I concatenate 2 hex strings (e.g. '\x16' and '\xb9') then convert
the answer to an integer?
When I try i always end up with the ASCII equivalent!
Those are just bytestrings (assuming you're using Python 2.x), ie
strings using 1 byte per character. You can convert a
Werner F. Bruhin wrote:
> Just upgraded on my Windows 7 machine my copy of 2.6.4 to 2.6.5.
>
> However doing sys.version still shows 2.6.4 even so python.exe is dated
> 19. March 2010 with a size of 26.624 bytes.
>
> Is this a known issue? Or did I do something wrong?
Look at the copy of python
Pythonistas:
I have a question to epydoc-devel, but it might be languishing:
http://sourceforge.net/mailarchive/forum.php?thread_name=l2n860c114f1005061707k1ccf68cdz277a3d875b99fe04%40mail.gmail.com&forum_name=epydoc-devel
How do you populate the index.html output with your (insanely clever)
con
On Mon, May 10, 2010 at 1:29 PM, Phlip wrote:
> Pythonistas:
> The question for the rest of Python-Land: Should I be using a better
> documentation extractor? (pydoc is too mundane so far.)
Sphinx is in vogue right now:
http://sphinx.pocoo.org/
It's used for the official docs and its results ar
On May 10, 1:39 pm, Chris Rebert wrote:
> Sphinx is in vogue right now:http://sphinx.pocoo.org/
>
> It's used for the official docs and its results are quite pretty.
The manager said to hold off on Sphinx until the next phase - then ran
off to get married or something.
But yet I persevere...
--
Hi everyone,
I'm new to Python and have been playing around with it using the
Enthought Python distribution for Mac OS X 10.6.3 (EPD academic
license, version 6.1 with python 2.6.4).
It's been great learning the basics, but I've started running into
problems when I'm trying to use the PIL li
On May 10, 1:51 pm, Phlip wrote:
> On May 10, 1:39 pm, Chris Rebert wrote:
>
> > Sphinx is in vogue right now:http://sphinx.pocoo.org/
Okay, we have ten thousand classes to document. How to add them all to
index.rst?
--
http://mail.python.org/mailman/listinfo/python-list
On 10-May-10 10:21 AM, John Maclean wrote:
On 10/05/2010 14:38, J. Cliff Dyer wrote:
My guess is you mixed tabs and spaces. One tab is always treated by the
python interpreter as being equal to eight spaces, which is two
indentation levels in your code.
Though if it were exactly as you show it,
As subject says, what is the differences of 'is not' and '!='. Confusing..
--
Passion is my style
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, May 10, 2010 at 4:25 PM, AON LAZIO wrote:
> As subject says, what is the differences of 'is not' and '!='. Confusing..
!= checks value inequality, `is not` checks object identity /
"pointer" inequality
Unless you're doing `foo is not None`, you almost always want !=.
By way of demonstrat
AON LAZIO wrote:
As subject says, what is the differences of 'is not' and '!='. Confusing..
"is not" checks if two objects are not identical. "!=" checks if two
objects are not equal.
Example:
Two apples may be equal in size, form and color but they can never be
identical because they are m
On Mon, May 10, 2010 at 5:17 PM, cjw wrote:
> PyScripter and PythonWin permit the user to choose the equivalence of tabs
> and spaces. I like two spaces = on tab, it's a matter of taste. I feel
> that eight spaces is too much.
While it is a matter of taste, PEP 8 recommends 4 spaces per indent
On 10 mayo, 09:24, Samuel Williams
wrote:
> Dear Friends,
>
> Is Python a functional programming language?
>
> Is this a paradigm that is well supported by both the language syntax and the
> general programming APIs?
>
> I heard that lambdas were limited to a single expression, and that other
>
[email protected] (Aahz) writes:
> Paul Boddie wrote:
> >Actually, the copyleft licences don't "force" anyone to "give back
> >changes": they oblige people to pass on changes.
>
> IMO, that's a distinction without a difference, particularly if you
> define "give back" as referring to the comm
On Mon, May 10, 2010 at 8:26 PM, [email protected] wrote:
> On May 10, 10:22 am, Kushal Kumaran
> wrote:
>> On Mon, May 10, 2010 at 7:30 PM, [email protected] wrote:
>> > Hi to all, i want to ask you a question, concerning the best way to do
>> > the following as a POST request:
>> > There is serv
On Mon, 10 May 2010 20:13:44 +, Matthew Wilson wrote:
> I know how to use timeit and/or profile to measure the current run-time
> cost of some code.
>
> I want to record the time used by some original implementation, then
> after I rewrite it, I want to find out if I made stuff faster or slow
Thanks to everyone for their great feedback, it is highly appreciated.
Kind regards,
Samuel
--
http://mail.python.org/mailman/listinfo/python-list
On 5/10/2010 5:35 AM, James Mills wrote:
On Mon, May 10, 2010 at 6:50 PM, Xavier Ho wrote:
Have I missed something, or wouldn't this work just as well:
list_of_strings = ['2', 'awes', '3465sdg', 'dbsdf', 'asdgas']
[word for word in list_of_strings if word[0] == 'a']
['awes', 'asdgas']
I wo
On Mon, May 10, 2010 at 10:23 PM, Terry Reedy wrote:
> On 5/10/2010 5:35 AM, James Mills wrote:
>>
>> On Mon, May 10, 2010 at 6:50 PM, Xavier Ho wrote:
>>>
>>> Have I missed something, or wouldn't this work just as well:
>>>
>> list_of_strings = ['2', 'awes', '3465sdg', 'dbsdf', 'asdgas']
>>>
In message
<22cf35af-44d1-43fe-8b90-07f2c6545...@i10g2000yqh.googlegroups.com>,
Guillermo wrote:
> If you've ever missed it on Windows and you can use Powershell ...
I thought the whole point of Windows was to get away from this command-line
stuff. Not such a good idea after all?
--
http://ma
In message , Alex Hall
wrote:
> ... I have about fifteen vars in a function which have to be
> global.
Why not make them class variables, e.g.
class my_namespace :
var1 = ...
var2 = ...
#end my_namespace
def my_function(...) :
... can directly read/assign my
In message
,
james_027 wrote:
> I was working with regex on a very large text, really large but I have
> time constrained.
“Fast regex” is a contradiction in terms. You use regexes when you want ease
of definition and application, not speed.
For speed, consider hand-coding your own state machi
j vickroy, 10.05.2010 17:39:
Unfortunately, when "Hudson Build now" is performed, the Hudson Console
output, for this job, is:
Started by user anonymous
Updating svn://vm-svn/GOES data processing/trunk/GOES/13,14,15/SXI/level-1
At revi
Matthew Wilson wrote:
> I know how to use timeit and/or profile to measure the current run-time
> cost of some code.
>
> I want to record the time used by some original implementation, then
> after I rewrite it, I want to find out if I made stuff faster or slower,
> and by how much.
>
> Other tha
hey,
I need help .
2010/5/9 mohamed issolah
> 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
74 matches
Mail list logo