Re: win32com

2010-05-10 Thread mohamed issolah
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

Re: How to measure speed improvements across revisions over time?

2010-05-10 Thread Martin v. Loewis
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

Re: unable to get Hudson to run unit tests

2010-05-10 Thread Stefan Behnel
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

Re: fast regex

2010-05-10 Thread Lawrence D'Oliveiro
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

Re: shortcut for large amount of global var declarations?

2010-05-10 Thread Lawrence D'Oliveiro
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

Re: virtualenvwrapper for Windows (Powershell)

2010-05-10 Thread Lawrence D'Oliveiro
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

Re: Extract all words that begin with x

2010-05-10 Thread Tycho Andersen
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'] >>>

Re: Extract all words that begin with x

2010-05-10 Thread Terry Reedy
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

Re: Is Python a functional programming language?

2010-05-10 Thread Samuel Williams
Thanks to everyone for their great feedback, it is highly appreciated. Kind regards, Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: How to measure speed improvements across revisions over time?

2010-05-10 Thread Steven D'Aprano
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

Re: HTTP Post Request

2010-05-10 Thread Kushal Kumaran
On Mon, May 10, 2010 at 8:26 PM, kak...@gmail.com wrote: > On May 10, 10:22 am, Kushal Kumaran > wrote: >> On Mon, May 10, 2010 at 7:30 PM, kak...@gmail.com 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

Re: Picking a license

2010-05-10 Thread Ben Finney
a...@pythoncraft.com (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

Re: Is Python a functional programming language?

2010-05-10 Thread Luis M . González
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 >

Re: unittest not being run

2010-05-10 Thread Joe Riopel
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

Re: Difference between 'is not' and '!=' ?

2010-05-10 Thread Christian Heimes
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

Re: Difference between 'is not' and '!=' ?

2010-05-10 Thread Chris Rebert
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

Difference between 'is not' and '!=' ?

2010-05-10 Thread AON LAZIO
As subject says, what is the differences of 'is not' and '!='. Confusing.. -- Passion is my style -- http://mail.python.org/mailman/listinfo/python-list

Re: unittest not being run

2010-05-10 Thread cjw
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,

lame sphinx questions [Was: lame epydoc questions]

2010-05-10 Thread Phlip
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

Problem displaying jpgs in Tkinter via PIL

2010-05-10 Thread Armin
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

Re: How to? epydoc --top=README

2010-05-10 Thread Phlip
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... --

Re: [Epydoc-devel] How to? epydoc --top=README

2010-05-10 Thread Chris Rebert
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

[Epydoc-devel] How to? epydoc --top=README

2010-05-10 Thread Phlip
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

Re: Upgrade Python 2.6.4 to 2.6.5

2010-05-10 Thread Martin v. Loewis
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

Re: Hex String

2010-05-10 Thread MRAB
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

Re: Hex String

2010-05-10 Thread Chris Rebert
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

How to measure speed improvements across revisions over time?

2010-05-10 Thread Matthew Wilson
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

Hex String

2010-05-10 Thread Anthony Cole
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

Re: Is Python a functional programming language?

2010-05-10 Thread Nobody
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

Re: Picking a license

2010-05-10 Thread Patrick Maupin
On May 10, 12:37 pm, Paul Boddie wrote: > On 10 Mai, 17:06, a...@pythoncraft.com (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":

Turbogears 2 training this weekend in Washington, DC USA

2010-05-10 Thread Alex Clark
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

Re: Is Python a functional programming language?

2010-05-10 Thread Aahz
In article <7xvdavd4bq@ruckus.brouhaha.com>, 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.

Re: Is Python a functional programming language?

2010-05-10 Thread Paul Rubin
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

Re: Picking a license

2010-05-10 Thread Paul Boddie
On 10 Mai, 17:06, a...@pythoncraft.com (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

Re: Extract all words that begin with x

2010-05-10 Thread Aahz
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

Re: Sphinx hosting

2010-05-10 Thread Michele Simionato
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

Re: unable to get Hudson to run unit tests

2010-05-10 Thread j vickroy
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

Re: Picking a license

2010-05-10 Thread Aahz
[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 <99386b28-1636-4f81-beec-3756970d3...@11g2000prv.googlegroups.com>, Carl Ba

Wholesale Sports Shoes Clear Air Force One AAA++quality(www.cnnshoe.com)

2010-05-10 Thread xiao wu
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,

Re: INCREF DECREF manually

2010-05-10 Thread Antoine Pitrou
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

Re: Picking a license

2010-05-10 Thread Aahz
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

Re: Picking a license

2010-05-10 Thread Patrick Maupin
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

Re: HTTP Post Request

2010-05-10 Thread kak...@gmail.com
On May 10, 10:22 am, Kushal Kumaran wrote: > On Mon, May 10, 2010 at 7:30 PM, kak...@gmail.com 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

Re: INCREF DECREF manually

2010-05-10 Thread moerchendiser2k3
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

Re: unable to get Hudson to run unit tests

2010-05-10 Thread Jean-Michel Pichavant
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

Re: HTTP Post Request

2010-05-10 Thread Kushal Kumaran
On Mon, May 10, 2010 at 7:30 PM, kak...@gmail.com 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 >

Re: unittest not being run

2010-05-10 Thread John Maclean
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

Re: INCREF DECREF manually

2010-05-10 Thread Jean-Michel Pichavant
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 --

INCREF DECREF manually

2010-05-10 Thread moerchendiser2k3
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

HTTP Post Request

2010-05-10 Thread kak...@gmail.com
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

Re: unittest not being run

2010-05-10 Thread J. Cliff Dyer
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

Re: unable to get Hudson to run unit tests

2010-05-10 Thread j vickroy
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

Re: unable to get Hudson to run unit tests

2010-05-10 Thread j vickroy
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,

Re: Is Python a functional programming language?

2010-05-10 Thread Bruno Desthuilliers
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

Re: Is Python a functional programming language?

2010-05-10 Thread Stefan Behnel
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?

Re: unittest not being run

2010-05-10 Thread Joe Riopel
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

Upgrade Python 2.6.4 to 2.6.5

2010-05-10 Thread Werner F. Bruhin
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

Re: Picking a license

2010-05-10 Thread Paul Boddie
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

unittest not being run

2010-05-10 Thread John Maclean
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

Is Python a functional programming language?

2010-05-10 Thread Samuel Williams
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...

Re: Python is cool!!

2010-05-10 Thread lkcl
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

Re: Kindly show me a better way to do it

2010-05-10 Thread Jean-Michel Pichavant
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

Re: accessing superclass methods from subclass

2010-05-10 Thread Jean-Michel Pichavant
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

Re: Picking a license

2010-05-10 Thread Paul Boddie
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

Re: idiomatic way to collect and report multiple exceptions?

2010-05-10 Thread Jean-Michel Pichavant
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

Re: Extract all words that begin with x

2010-05-10 Thread superpollo
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

Re: Extract all words that begin with x

2010-05-10 Thread James Mills
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

NFL NBA MLB NHL jersey

2010-05-10 Thread world-trade
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

Re: unable to get Hudson to run unit tests

2010-05-10 Thread Jean-Michel Pichavant
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,

Re: Extract all words that begin with x

2010-05-10 Thread superpollo
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

Re: Extract all words that begin with x

2010-05-10 Thread Xavier Ho
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

Extract all words that begin with x

2010-05-10 Thread Jimbo
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

Re: solve a newspaper quiz

2010-05-10 Thread Francesco Bochicchio
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:

Re: Fastest way to calculate leading whitespace

2010-05-10 Thread Stefan Behnel
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