Philippe C. Martin wrote:
> Any clue would be quite welcome.
I didn't recognize the pattern in the code you posted, but sometimes the
order of imports matters:
$ find .
.
./package
./package/beta.py
./package/alpha.py
./package/__init__.py
$ python
Python 2.3.3 (#1, Feb 5 2005, 16:22:10)
[GCC 3
To recognize variables that you have assigned, just look for
assignment. If your code is readible, and you know it well, you
shouldn't need the $ sign in front of everything.
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
> On Sat, 25 Jun 2005 21:30:26 +0200, Peter Otten wrote:
>
>> Mandus wrote:
>>
>>> By using the builtin reduce, I
>>> move the for-loop into the c-code which performs better.
>>
>> No. There is no hope of ever writing fast code when you do not actually
>> measure its perf
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sat, 25 Jun 2005 19:31:20 -0600, John Roth wrote:
>
>>
>> "Dave Benjamin" <[EMAIL PROTECTED]> wrote in message
>> news:[EMAIL PROTECTED]
>>> Guido gave a good, long interview, available at IT Conversations, as was
>
On the accessor function topic. Here is a good description of why you
don't need accessors in python (among other things) written by the
main PEAK(http://peak.telecommunity.com/) developer (Phillip J. Eby):
http://dirtsimple.org/2004/12/python-is-not-java.html
Some other useful articles in a simi
On Sat, 25 Jun 2005 19:31:20 -0600, John Roth wrote:
>
> "Dave Benjamin" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Guido gave a good, long interview, available at IT Conversations, as was
>> recently announced by Dr. Dobb's Python-URL! The audio clips are available
>
> [s
Matt Hollingsworth <[EMAIL PROTECTED]> writes:
> What are some good options that people commonly use so that they can
> easily and quickly identify variable with just a glance?
Use an editor that has a Python syntax highlighting mode, for example
Emacs with python-mode, Vim, or the IDLE IDE that
Hello,
Very new to python, so a noob question. When I've written stuff in
JavaScript or MEL in the past, I've always adopted the variable naming
convention of using a $ as the first character (no, I don't use perl,
never have). Not possible in python. What are some good options that
people
Dave Benjamin wrote:
> One thing Guido mentions in his comparison of ABC (Python's
predecessor) and
> Python is how ABC was inextricably tied to its environment (a la
Smalltalk),
What surprised me was that this was the only thing he really mentioned.
He didn't mention anything about the the
On Sat, 18 Jun 2005 03:52:28 -0400, Brian van den Broek <[EMAIL PROTECTED]>
wrote:
[...]
>
>Now, the same sort of behaviour where the "if type" testing has been
>replaced with code more in keeping with the OOP approach:
>
> >>> class C(object):
>...def report(self):
>...print "Fou
On Sat, 25 Jun 2005 23:08:10 +, Bengt Richter wrote:
>>Using := and = for assignment and equality is precisely as stupid as using
>>= and == for assignment and equality. Perhaps less stupid: why do we use
>>== for equals, but not ++ for plus and -- for minus?
>>
> I agree, but I think := would
On Sat, 25 Jun 2005 23:08:10 +, Bengt Richter wrote:
> On Sun, 26 Jun 2005 04:08:31 +1000, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
>
>>On Fri, 24 Jun 2005 15:47:45 -0700, James Stroud wrote:
>>
>>> On Friday 24 June 2005 05:58 am, Steven D'Aprano wrote:
with colour do begin
red :
On Sat, 25 Jun 2005 18:44:12 -0700, James Stroud wrote:
> On Saturday 25 June 2005 11:08 am, Steven D'Aprano wrote:
>> The problem is, you have made colour (returning to English spelling
>> instead of foreign) into a class. If you need two colour variables, you
>> have to duplicate the code for th
On Saturday 25 June 2005 06:44 pm, James Stroud wrote:
> I thought they were
> pointless 18 years ago when I learned pascal in highschool and after 20
> years, I still think they are still pointless.
I think that fails "==".
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 9515
On Sat, 25 Jun 2005 23:19:48 +0200, Peter Otten wrote:
> Python is more about readability than raw speed, and I prefer a for-loop
> over reduce() in that respect, too.
Fascinating. I prefer reduce for readability. "Reduce this list to one
value, using this known behaviour" seems to work for me b
On Sat, 25 Jun 2005 13:31:19 -0700, Robert Kern wrote:
> Of course, in a Python 3000 world, nothing stops anyone from using their
> own extension module implementing map, filter, and reduce if they really
> want to. TSBOOOWTDI in the language/stdlib, but it shouldn't stop anyone
> from using ot
On Sat, 25 Jun 2005 21:30:26 +0200, Peter Otten wrote:
> Mandus wrote:
>
>> By using the builtin reduce, I
>> move the for-loop into the c-code which performs better.
>
> No. There is no hope of ever writing fast code when you do not actually
> measure its performance.
Good grief! You've been
On Saturday 25 June 2005 11:08 am, Steven D'Aprano wrote:
> The problem is, you have made colour (returning to English spelling
> instead of foreign) into a class. If you need two colour variables, you
> have to duplicate the code for the class (perhaps only changing the
> numeric constants. You
"Terry Reedy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> "Elmo Mäntynen" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> n=(100,) tuple(*n)
>
> As posted, this gives a syntax error. What is missing?
Actually, I should have said 'as received'.
--
htt
On Sat, 25 Jun 2005 15:44:14 -0400, Nicolas Fleury wrote:
> Steven D'Aprano wrote:
>> One of the things I liked in Pascal was the "with" keyword. You could
>> write something like this:
>>
>> with colour do begin
>> red := 0; blue := 255; green := 0;
>> end;
>>
>> instead of:
>>
>> colour.red :
"Dave Benjamin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Guido gave a good, long interview, available at IT Conversations, as was
> recently announced by Dr. Dobb's Python-URL! The audio clips are available
[snip]
> - Java: the usual static vs. dynamic, static analysis vs.
"Mandus" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Fri, 24 Jun 2005 16:31:08 +0100 skrev Tom Anderson:
>> On Fri, 24 Jun 2005, Joseph Garvin wrote:
>> Higher-order functions like map, filter and reduce. As of Python 3000,
>> they're non-python tricks. Sigh - i guess it's time
On Sat, 25 Jun 2005 19:23:18 +, Mandus wrote:
> Sat, 25 Jun 2005 16:06:57 GMT skrev Lee Harr:
Higher-order functions like map, filter and reduce. As of Python 3000,
they're non-python tricks. Sigh - i guess it's time for me to get to know
list comprehensions a bit better.
"Elmo Mäntynen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
n=(100,) tuple(*n)
As posted, this gives a syntax error. What is missing?
tjr
--
http://mail.python.org/mailman/listinfo/python-list
On 23 Jun 2005 21:27:20 -0700, "Paul McGuire" <[EMAIL PROTECTED]> wrote:
>Dang, that class should be:
>
>class PaddedStr(str):
>def __new__(cls,s,l,padc=' '):
>if l > len(s):
>s2 = "%s%s" % (s,padc*(l-len(s)))
>return str.__new__(cls,s2)
>else:
>
Guido gave a good, long interview, available at IT Conversations, as was
recently announced by Dr. Dobb's Python-URL! The audio clips are available
here:
http://www.itconversations.com/shows/detail545.html
http://www.itconversations.com/shows/detail559.html
I'd like to comment on a few parts of
On Sun, 26 Jun 2005 04:08:31 +1000, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
>On Fri, 24 Jun 2005 15:47:45 -0700, James Stroud wrote:
>
>> On Friday 24 June 2005 05:58 am, Steven D'Aprano wrote:
>>> with colour do begin
>>> red := 0; blue := 255; green := 0;
>>> end;
>>>
>>> instead of:
>>>
>>>
[The HTML version of this Summary is available at
http://www.python.org/dev/summary/2005-06-01_2005-06-15.html]
=
Summary Announcements
=
-
Bug Day: Saturday, June 25th 2005
-
AMK organized an
[The HTML version of this Summary is available at
http://www.python.org/dev/summary/2005-05-16_2005-05-31.html]
=
Summary Announcements
=
QOTF
We have our first ever Quote of the Fortnight (QOTF), thanks to
the wave of discussion over `PEP 343`_
[The HTML version of this Summary is available at
http://www.python.org/dev/summary/2005-05-01_2005-05-15.html]
=
Summary Announcements
=
--
PEP 340 Episode 2: Revenge of the With (Block)
-
Elmo Mäntynen wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> This is the case:
>
>
n=(100,) tuple(*n)
>
>
> Traceback (most recent call last):
> File "", line 1, in -toplevel-
> tuple(*n)
> TypeError: iteration over non-sequence
The star (*n) means you are essentially
Elmo Mäntynen wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> This is the case:
>
>
n=(100,) tuple(*n)
>
>
> Traceback (most recent call last):
> File "", line 1, in -toplevel-
> tuple(*n)
> TypeError: iteration over non-sequence
n is a sequence. *n correctly expands. T
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
This is the case:
>>> n=(100,) tuple(*n)
Traceback (most recent call last):
File "", line 1, in -toplevel-
tuple(*n)
TypeError: iteration over non-sequence
To be sure I searched for ways to check if something is a sequence:
>>> n.__iter__().n
Hi.
> > If you are new to Python and want to use it with COM, definitely get
> > yourself a copy of _Python Programming on Win32_ by Mark Hammond and
> > Andy Robinson.
>
> ...or at least read the chapter available online:
> http://www.oreilly.com/catalog/pythonwin32/chapter/ch12.html
Also, check
Mandus wrote:
> 25 Jun 2005 13:15:16 -0700 skrev Devan L:
>> But by using the builtin reduce, you need to specify a function, which
>> probably slows it down more than any speed-up from the loop in C.
>
> Sounds reasonable, but not always the case, especially when dealing with
> numpy arrays. At
Philippe C. Martin wrote:
> OK Peter, first of all thanks.
>
> You seem to be German and although I leave in the states, I'm French and
> your english is clearly far more advanced than mine: I have yet to
> understand a few of your comments ;-)
My French is mostly read-only, so let me rephrase:
On Sat, 25 Jun 2005 15:36:06 -0400, Philippe C. Martin wrote
(in article <[EMAIL PROTECTED]>):
> Hi,
>
> Not being from anglo-saxon heritage, I keep wondering why spammers always
> (or very often) get called 'trolls' ?
>
> I mean fantasy fiction has brought us many hugly beasts (goblin, warlock,
Devan L wrote:
> But by using the builtin reduce, you need to specify a function, which
> probably slows it down more than any speed-up from the loop in C.
Not if the function is from an extension module. For some applications,
this can be quite common.
Of course, in a Python 3000 world, nothing
I meant live, not leave ! (this is getting pretty bad)
Philippe C. Martin wrote:
> OK Peter, first of all thanks.
>
> You seem to be German and although I leave in the states, I'm French and
> your english is clearly far more advanced than mine: I have yet to
> understand a few of your comments
25 Jun 2005 13:15:16 -0700 skrev Devan L:
> But by using the builtin reduce, you need to specify a function, which
> probably slows it down more than any speed-up from the loop in C.
Sounds reasonable, but not always the case, especially when dealing with
numpy arrays. At least that what some of m
But by using the builtin reduce, you need to specify a function, which
probably slows it down more than any speed-up from the loop in C.
--
http://mail.python.org/mailman/listinfo/python-list
Woof!
And I thought my english was improving !
I'm laughing very hard right now, thanks !
Philippe
Skip Montanaro wrote:
>
> Philippe> Not being from anglo-saxon heritage, I keep wondering why
> Philippe> spammers always (or very often) get called 'trolls' ?
>
> Fishing from a boa
Sat, 25 Jun 2005 21:30:26 +0200 skrev Peter Otten:
> Mandus wrote:
>
>> By using the builtin reduce, I
>> move the for-loop into the c-code which performs better.
>
> No. There is no hope of ever writing fast code when you do not actually
> measure its performance.
I do.
--
Mandus - the only man
OK Peter, first of all thanks.
You seem to be German and although I leave in the states, I'm French and
your english is clearly far more advanced than mine: I have yet to
understand a few of your comments ;-)
> Care to provide the traceback?
Traceback (most recent call last):
File "SC_Shell.py
Philippe> Not being from anglo-saxon heritage, I keep wondering why
Philippe> spammers always (or very often) get called 'trolls' ?
Fishing from a boat that is moving slowly is called "trolling". You're
slowly dragging bait or a lure through the water to entice a fish to bite
your hook.
Steven D'Aprano wrote:
> One of the things I liked in Pascal was the "with" keyword. You could
> write something like this:
>
> with colour do begin
> red := 0; blue := 255; green := 0;
> end;
>
> instead of:
>
> colour.red := 0; colour.blue := 255; colour.green := 0;
>
> Okay, so maybe it is m
Sorry, limbs (plus I check in a dictionnary first!)
Philippe C. Martin wrote:
> limns
--
http://mail.python.org/mailman/listinfo/python-list
Philippe C. Martin wrote:
> l = inspect.getmembers(eval('BC')) #THIS CRASHES - the class exists
Care to provide the traceback?
> In [23]:from SC.CARDS.BC import *
>
> In [24]:l = inspect.getmembers(eval('BC'))
What happened in lines 1 through 22? My guess would be
In [13]:from SC.CARDS import
Hi,
Not being from anglo-saxon heritage, I keep wondering why spammers always
(or very often) get called 'trolls' ?
I mean fantasy fiction has brought us many hugly beasts (goblin, warlock,
orc, dark elf )
The trolls, as I recall, grow back their limns once those have been cut by
the nice fo
I am placing radiobuttons in a 4 X 4 matrix (using loops) and keep
references to them in a 2 dimensional list ( rBtns[r][c] ). It works
fine, and I can even make it so only one button per column can be
selected, by assigning each column to an intVar. In many languages a
radiobutton has a prop
Mandus wrote:
> By using the builtin reduce, I
> move the for-loop into the c-code which performs better.
No. There is no hope of ever writing fast code when you do not actually
measure its performance.
Peter
--
http://mail.python.org/mailman/listinfo/python-list
Sun, 26 Jun 2005 04:14:19 +1000 skrev Steven D'Aprano:
> On Fri, 24 Jun 2005 21:53:03 -0700, [EMAIL PROTECTED] wrote:
>
>> Apologies if this question seems stupid: How does one write a
>> function that increments a value in Python? When I tried, the variable
>> never changed.
>> The session went
Why overload when you can use class methods?
--
http://mail.python.org/mailman/listinfo/python-list
Sat, 25 Jun 2005 16:06:57 GMT skrev Lee Harr:
>>> Higher-order functions like map, filter and reduce. As of Python 3000,
>>> they're non-python tricks. Sigh - i guess it's time for me to get to know
>>> list comprehensions a bit better.
>>>
>
>
> Couldnt there just be a "functional" module ?...
>
Brian said unto the world upon 25/06/2005 10:50:
> Do Re Mi chel La Si Do wrote:
>
>>rather... super troll
>
>
> 100% Agreed.
>
> Can anyone say, "This looks like spam... Feels like spam... and is about
> as useful here in the Python forums as spam -- therfore my conclusion is
> that his
Sun, 26 Jun 2005 04:36:51 +1000 skrev Steven D'Aprano:
> On Sat, 25 Jun 2005 17:41:58 +0200, Konstantin Veretennicov wrote:
>
>> On 6/25/05, Mandus <[EMAIL PROTECTED]> wrote:
>>> It is really a consensus on this; that
>>> removing map, filter, reduce is a good thing? It will render a whole lot
>>>
Hi,
I found the solution to my problem:
Besides the fact I still have no clue as to how the Python name spacing
works, the code I though did stuff (the __EXEC_LIST loop) did not do as I
expected as I had already imported all of the modules in an explicit
manner.
So now I can rephrase my problem:
"Konstantin Veretennicov" <[EMAIL PROTECTED]> wrote:
> On 6/25/05, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> > On Sat, 25 Jun 2005 17:41:58 +0200, Konstantin Veretennicov wrote:
> >
> > > On 6/25/05, Mandus <[EMAIL PROTECTED]> wrote:
> > >> It is really a consensus on this; that
> > >> removing
On Sat, 25 Jun 2005, Konstantin Veretennicov wrote:
> On 6/25/05, Mandus <[EMAIL PROTECTED]> wrote:
>
>> It is really a consensus on this; that removing map, filter, reduce is
>> a good thing? It will render a whole lot of my software unusable :(
>
> I think you'll be able to use "from __past__ i
On Fri, 24 Jun 2005, Roy Smith wrote:
> Tom Anderson <[EMAIL PROTECTED]> wrote:
>
>> The one thing i really do miss is method overloading by parameter type.
>> I used this all the time in java
>
> You do things like that in type-bondage languages
I love that expression. I think it started out a
On 6/25/05, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> On Sat, 25 Jun 2005 17:41:58 +0200, Konstantin Veretennicov wrote:
>
> > On 6/25/05, Mandus <[EMAIL PROTECTED]> wrote:
> >> It is really a consensus on this; that
> >> removing map, filter, reduce is a good thing? It will render a whole lot
"Steven D'Aprano" wrote:
> On Sat, 25 Jun 2005 06:44:22 -0700, George Sakkis wrote:
>
> > "Roy Smith" <[EMAIL PROTECTED]> wrote:
> >
> >> I just re-read the documentation on the dict() constructor. Why does it
> >> support keyword arguments?
> >>
> >>dict(foo="bar", baz="blah") ==> {"foo":"ba
On Sat, 25 Jun 2005 17:41:58 +0200, Konstantin Veretennicov wrote:
> On 6/25/05, Mandus <[EMAIL PROTECTED]> wrote:
>> It is really a consensus on this; that
>> removing map, filter, reduce is a good thing? It will render a whole lot
>> of my software unusable :(
>
> I think you'll be able to use
Here's a pyparsing version of this, that may be easier to maintain long
term (although if you have your heart set on learning regexp's, they
will certainly do the job). Note that in pyparsing, you don't have to
spell out where the whitespace goes - pyparsing's default logic assumes
that whitespace
"Felix Schwarz" <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm experiencing problems with a regular expression and I can't figure
> out which words I use when googling. I read the python documentation for
> the re module multiple times now but still no idea what I'm doing wrong.
>
> What I want to d
On Sat, 25 Jun 2005 06:44:22 -0700, George Sakkis wrote:
> "Roy Smith" <[EMAIL PROTECTED]> wrote:
>
>> I just re-read the documentation on the dict() constructor. Why does it
>> support keyword arguments?
>>
>>dict(foo="bar", baz="blah") ==> {"foo":"bar", "baz"="blah"}
>>
>> This smacks of c
On 6/25/05, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> On Fri, 24 Jun 2005 14:29:37 -0700, James wrote:
> > 2.) Contracts
>
> Explain please.
James probably meant Eiffel's Design by Contract. My favourite Python
implementation is Terence Way's http://www.wayforward.net/pycontract/
;-)
- kv
--
Hi,
Hopefully to make things clearer: this works from a shell:
In [23]:from SC.CARDS.BC import *
In [24]:l = inspect.getmembers(eval('BC'))
#l will get all members from class 'BC' whereas the code referenced below
gets an exception saying 'BC' is not defined.
Thanks,
Philippe
Philippe C.
Hallöchen!
Ingrid Bronger <[EMAIL PROTECTED]> writes:
> [...]
>
> Then I call "python setup.py bdist_dumb" on ym Linux box. The
> resulting tar ball contains every file twice, e.g.
>
> ./usr/lib/python2.3/site-packages/my_package/my_module.py
> ./usr/lib/python2.3/site-packages/my_module.py
>
>
On Fri, 24 Jun 2005 21:53:03 -0700, [EMAIL PROTECTED] wrote:
> Apologies if this question seems stupid: How does one write a
> function that increments a value in Python? When I tried, the variable
> never changed.
> The session went like this:
def incr(counter):
> counter = int(count
Hi,
I'm getting pretty desperate here:
The code below crashes on the last line (but works from a shell).
The class 'BC' exists and the loop on self.__BC_EXEC_LIST passes fine.
It's got to be something really stupid but I've been looking at it too long
I guess.
Any clue would be quite welcome.
On Fri, 24 Jun 2005 15:47:45 -0700, James Stroud wrote:
> On Friday 24 June 2005 05:58 am, Steven D'Aprano wrote:
>> with colour do begin
>> red := 0; blue := 255; green := 0;
>> end;
>>
>> instead of:
>>
>> colour.red := 0; colour.blue := 255; colour.green := 0;
>>
>> Okay, so maybe it is more of
On Fri, 24 Jun 2005 14:29:37 -0700, James wrote:
> Interesting thread ...
>
> 1.) Language support for ranges as in Ada/Pascal/Ruby
> 1..10 rather than range(1, 10)
What advantages do Pascal-like for loops give over Python for loops?
The only two I can think of are trivial:
(1) the Pascal-like
On Sat, 25 Jun 2005 14:50:48 GMT, Brian <[EMAIL PROTECTED]> wrote:
> Do Re Mi chel La Si Do wrote:
>> rather... super troll
>
> 100% Agreed.
>
> Can anyone say, "This looks like spam... Feels like spam... and is about
> as useful here in the Python forums as spam -- therfore my conclusion is
On Fri, 24 Jun 2005 21:04:15 +0200, Christophe Delord wrote:
> Hello,
>
> On 24 Jun 2005 11:45:14 -0700, [EMAIL PROTECTED] wrote:
>
>> Hello,
>>
>> Can we impose if then else into list comprehension ?
>> Like we do in lambda-map form:
>>
>> This code change None into 0
>> L = [None, 12]
>> R =
Hallöchen!
I have a very simple package structure with one directory denoting a
package (with __init__.py file of course). In my setup.py I write
...
packages=['my_package']
...
Then I call "python setup.py bdist_dumb" on ym Linux box. The
resulting tar ball contains every file twi
Roy Smith wrote:
> Terry Hancock <[EMAIL PROTECTED]> wrote:
> ...
> I just re-read the documentation on the dict() constructor. Why does it
> support keyword arguments?
>
>dict(foo="bar", baz="blah") ==> {"foo":"bar", "baz"="blah"}
>
> This smacks of creeping featurism. Is this actually us
>> Higher-order functions like map, filter and reduce. As of Python 3000,
>> they're non-python tricks. Sigh - i guess it's time for me to get to know
>> list comprehensions a bit better.
>>
Couldnt there just be a "functional" module ?...
from functional import map, filter, reduce
--
http://
> to use a port below 1000 on a Unix system one needs root priviledges.
> But it's dangerous to execute all of a script under those priviledges.
> Therefore I'd like to drop the root priviledges as soon as possible.
> (How) is this possible?
>
Are you sure you don't just want to use twisted?
http
On 6/25/05, Mandus <[EMAIL PROTECTED]> wrote:
> It is really a consensus on this; that
> removing map, filter, reduce is a good thing? It will render a whole lot
> of my software unusable :(
I think you'll be able to use "from __past__ import map, filter,
reduce" or something like that :) They don
Hi,
to use a port below 1000 on a Unix system one needs root priviledges.
But it's dangerous to execute all of a script under those priviledges.
Therefore I'd like to drop the root priviledges as soon as possible.
(How) is this possible?
Many thanks for a hint,
Helmut Jarausch
Lehrstuhl fuer Nu
Felix Schwarz wrote:
> Hi all,
>
> I'm experiencing problems with a regular expression and I can't figure
> out which words I use when googling. I read the python documentation for
> the re module multiple times now but still no idea what I'm doing wrong.
>
> What I want to do:
> - Extract all
On 6/25/05, Uwe Mayer <[EMAIL PROTECTED]> wrote:
> AFAIK super only works with new-style classes, so I checked:
>
> >>> from qtcanvas import *
> >>> isinstance(QCanvasItem, object)
> True
AFAIK, this is not the right way to check for new-styledness:
>>> class X: "i'm an old-styler"
>>> isinstanc
Hi all,
I'm experiencing problems with a regular expression and I can't figure
out which words I use when googling. I read the python documentation for
the re module multiple times now but still no idea what I'm doing wrong.
What I want to do:
- Extract all digits (\d) in a string.
- Digits are
Do Re Mi chel La Si Do wrote:
> rather... super troll
100% Agreed.
Can anyone say, "This looks like spam... Feels like spam... and is about
as useful here in the Python forums as spam -- therfore my conclusion is
that his VB message probably IS SPAM." :-D
Brian
---
--
http://mail.python.
rather... super troll
--
http://mail.python.org/mailman/listinfo/python-list
Roy Smith wrote:
> I just re-read the documentation on the dict() constructor. Why does it
> support keyword arguments?
>
>dict(foo="bar", baz="blah") ==> {"foo":"bar", "baz"="blah"}
>
> This smacks of creeping featurism. Is this actually useful in real code?
Personally, I use it all t
Uwe Mayer wrote:
> I have a diamond-shaped multiple inheritanc chain with new style classes,
> but super() does not call the parent class correctly:
>
> -- snip --
> from qtcanvas import *
I don't have qtcanvas installed, and I couldn't reproduce the
undesirable behavior using a dummy class. If
On Sat, 25 Jun 2005 09:10:33 -0400, Roy Smith <[EMAIL PROTECTED]> wrote:
>Terry Hancock <[EMAIL PROTECTED]> wrote:
>> Before the dict constructor, you needed to do this:
>>
>> d={}
>> for key in alist:
>> d[key]=None
>
>I just re-read the documentation on the dict() constructor. Why does it
>s
On 6/25/05, Josef Meile <[EMAIL PROTECTED]> wrote:
> You could try to do an addin/addon for Word, Excel, and Outlook. You
> don't need to code with VBA. Here you just need a language from where
> you can access the microsoft interop assemblies (ie: C++ or C#;
> IronPython maybe?)
Hmm... Why jump t
Steve <[EMAIL PROTECTED]> wrote:
> One thing that I miss every once in a while is "pre-processing".
There are so many things wrong with preprocessing, at least if you're
thinking of the way C/C++ implements it (cpp). Cpp a number of things.
1) It does file inclusion. Pythons "import" serves th
"Roy Smith" <[EMAIL PROTECTED]> wrote:
> I just re-read the documentation on the dict() constructor. Why does it
> support keyword arguments?
>
>dict(foo="bar", baz="blah") ==> {"foo":"bar", "baz"="blah"}
>
> This smacks of creeping featurism. Is this actually useful in real code?
> It took
jwaixs wrote:
> I've a question. Can I execute a part of a python code and put it's
> output in a string?
>>> import sys
>>> from cStringIO import StringIO
>>>
>>> def exec_and_get_output(code):
... old_stdout = sys.stdout
... sys.stdout = StringIO()
... try:
... exec c
Terry Hancock <[EMAIL PROTECTED]> wrote:
> Before the dict constructor, you needed to do this:
>
> d={}
> for key in alist:
> d[key]=None
I just re-read the documentation on the dict() constructor. Why does it
support keyword arguments?
dict(foo="bar", baz="blah") ==> {"foo":"bar", "baz
Uwe Mayer wrote:
> con: If you are planning larger applications (for a reasonable value of
> "large") you have to discipline yourself to write well structured code.
This is definitely true, no matter the language you use.
> Then you will want to specify interfaces,
If you're really interested i
> The article implied that the automated system would allow for
> /shorter paths/ (the shortest path is the great circle, so this
> statement indicates that trans-oceanic flights are not using great
> circle/GPS routing). Most likely, the flights are using 50 minute "plumb
> lines", with a he
Hello,
I've a question. Can I execute a part of a python code and put it's
output in a string? Something like this:
s = ""
s = exec """print "Hello World" """
print s
Greetz,
Noud
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I have a diamond-shaped multiple inheritanc chain with new style classes,
but super() does not call the parent class correctly:
-- snip --
from qtcanvas import *
class B2(QCanvasItem):
def move(self, x,y):
super(B2, self).move(0,0)
print "B2"
class C2(QCanvasItem):
d
On Sat, 25 Jun 2005 11:36:57 +0100, Jorge Louis De Castro <[EMAIL PROTECTED]>
wrote:
>Hi,
>
>I'm new to python and I'm having trouble figuring out a way to have a thread
>running on the background that over rules the raw_input function. The example
>I'm working on is something like having a thre
Hi,
I have come across the following statement a number of times:
http://mail.python.org/pipermail/python-list/2003-July/171805.html
[... how to enforce pure abstract class ...]
> Python, in general, doesn't try to stop the programmer doing things, the
> way many other languages do. This is know
1 - 100 of 114 matches
Mail list logo