Re: Python IDE/text-editor

2011-04-17 Thread egbert
nobody mention Geany ? e -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 -- http://mail.python.org/mailman/listinfo/python-list

Hello gnome-terminal

2005-09-30 Thread egbert
er in a panel, a new gnome-terminal window is opened for output only, and PYTHONPATH is an unknown entity. How can I open a terminal over whose environment and configuration I have more control ? -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Ams

PyGTK color blackout

2005-10-23 Thread egbert
Without success I try to understand the color mechanism in PyGTK. It's about the classes Color an Colormap, and their methods and related functions and other paraphernalia. If anyone knows about a tutorial-like systematic description, I will be very grateful. -- Egbert Bouwman - Keizersg

Opaque documentation

2005-10-28 Thread egbert
the screen that the window is displayed on. The screen on the second line, before the period, is in italics, if that helps. I like these texts. Prose should not disclose its secrets at once. If you have other examples, please let us know. -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Ams

Re: PyFLTK - an underrated gem for GUI projects

2005-11-07 Thread egbert
PyFLTK is not a debian package - yet. Is nobody interested, or is there a more specific reason ? -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 -- http://mail.python.org/mailman/listinfo/python

Re: which feature of python do you like most?

2005-11-09 Thread egbert
python is almost pseudocode, so much so that you don't need pseudocode anymore. -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 -- http://mail.python.org/mailman/listinfo/python-list

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-03 Thread egbert
entioned yet as a candidate for limbo, but the same question goes for: zip(sequence1,sequence2) -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 -- http://mail.python.org/mailman/listinfo/python-list

Re: python certification

2005-07-20 Thread egbert
d check if we were talking about the same language. However I must apologize. It didn't cover Pyhton. This is an improved version: pc=re.compile(r'\bph?(ph)*[iye]+h?(th?)+o?n+e?\b',re.I) As you see it covers pitn, and also spellings like pythonne, to accomodate the francophones. -- Egbe

DRY and class variables

2011-09-08 Thread egbert
e subclass namespace. Any ideas ? e -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 -- http://mail.python.org/mailman/listinfo/python-list

Re: DRY and class variables

2011-09-08 Thread egbert
) > return cls > > @with_metadata > class TableOne: ># foo >pass Overnight I have become a decorator fan. I can postpone the study of metaclasses. Thanks. e -- Egbert Bouwman - Keizersgracht 197 I

Re: checking if a string contains a number

2005-12-20 Thread egbert
On Tue, Dec 20, 2005 at 07:16:46PM +0530, Suresh Jeevanandam wrote: > s1 = '12e3' > s2 = 'junk' > Is there any other function which would return True for s1 and False > for s2. > isinstance(12e3, (int, float)) -- Egbert Bouwman - Keizer

set_focus_chain in pygtk and wxPython

2006-08-13 Thread egbert
In pygtk is available: set_focus_chain Does wxPython have something similar ? -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 -- http://mail.python.org/mailman/listinfo/python-list

Re: invert or reverse a string... warning this is a rant

2006-10-20 Thread egbert
String reversal comes in handy when you do palindromes. -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 -- http://mail.python.org/mailman/listinfo/python-list

Dispatcher experiment

2006-11-08 Thread egbert
improvements on my design. In a python shell you may test it with: import dip zoo = dip.Zoo() zoo.animals["fish"].send_food_wish() egbert #!/usr/bin/env python # dip.py := experiment with Patrick O'Brien's dispatcher import wx.py.dispatcher as disp class Ani

Python as default Lexer in SciTE

2006-11-12 Thread egbert
Is it possible to set Python as the default language in SciTE? Not all my python scripts have the .py extension, only the to_be_imported ones. And I use SciTE only for Python. e. -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991

SPE refuses.

2006-11-29 Thread egbert
According to apt-show-versions I have installed: python-wxgtk2.6 2.6.3.2.1.5 spe 0.8.2a+repack-1 However when I start SPE I get the message You need to install at least wxPython v2.5.4.1 to run SPE How do I tell SPE that I have the right wxPython ? e. -- Egbert Bouwman

Re: SPE refuses.

2006-11-29 Thread egbert
.py --debug' produces the same error: You need to install at least wxPython v2.5.4.1 to run SPE. Get it from http://www.python.org Well, I got it from the debian repositories. e. -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 ==

Re: SPE refuses.

2006-11-30 Thread egbert
ll explore spe. Thanks. e. -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 -- http://mail.python.org/mailman/listinfo/python-list

Pythonpath and gnome panel

2006-02-20 Thread egbert
My pygtk gui can not be started from a gnome panel, because, apparently, the panel doesn't know about my modified PYTHONPATH. So how can I instruct the panel ? -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 62

An isalpha() that accepts underscores as well

2006-02-26 Thread egbert
s is about ten times slower than isalpha() sec. Any suggestions ? Thanks. -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 -- http://mail.python.org/mailman/listinfo/python-list

Re: An isalpha() that accepts underscores as well

2006-03-01 Thread egbert
nt t.timeit() # 1.36 t = Timer("pat.search(token)", "from __main__ import token, pat") print t.timeit() # 1.18 t = Timer("token.isalpha()", "from __main__ import token") print t.timeit() # 0.28 #egbert -- Egbert Bouwman - Keizersgracht 197 II - 1016 D

[OT] SQL-records and OOP

2005-05-30 Thread egbert
gle has lots to offer, but I must be looking in the wrong direction. egbert -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 -- http://mail.python.org/mailman/listinfo/python-list

Re: Controlling assignation

2005-06-13 Thread egbert
elf): self.var=0 def __call__(self,val=None): self.var=val a = A() a(5) print a.var # gives 5 egbert -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 -- http://mail.python.org/mailman/listi

Re: is it possible to give an instance a value?

2007-03-07 Thread egbert
s: %s" % type(a()) print "Now earning" , a(1234) + 500 print "Type of a() is: %s" % type(a()) print "string ? %s" % ["No","Yes"][isinstance(a(), basestring)] The output is: Living in Sidney Living in Canberra N

Re: is it possible to give an instance a value?

2007-03-08 Thread egbert
On Thu, Mar 08, 2007 at 01:22:25PM +1100, Steven D'Aprano wrote: > On Wed, 07 Mar 2007 16:02:05 +0100, egbert wrote: > > My impression is that you can do everything you want to > > by making your instance callable, and not using a but a(). > You can't do this: &g

Re: Python 3.0 migration plans?

2007-09-28 Thread egbert
On Thu, Sep 27, 2007 at 09:17:30PM -0400, Steve Holden wrote: > So what we need is a poll on what the questions should be. I *love* c.l.py. I will switch as soon as Debian has all the tools for an easy conversion available, and Python 3000 has reached the default release status. e -- Egb

Re: Python does not play well with others

2007-01-24 Thread egbert
- the portable assembler. Solid, trusted, tunable ... > C++ - objects tacked onto C; but that didn't work so invent ... > Python - it just works. Same scripts run on every platform ... What about C# ? e -- Egbert Bouwman - Keizersgracht 197 II - 1016 D

Re: can anyone advise me

2006-04-27 Thread egbert
0 1 2 3 4 5 > 0 1 2 3 4 5 6 > 0 1 2 3 4 5 6 7 > 0 1 2 3 4 5 6 7 8 > 0 1 2 3 4 5 6 7 8 9 > In your nested loop you are printing an x followed by zero or more z's, but only after each x, including the first one, you switch to a new line. So the last digit on each line is an x, exc

Questions about the event loop

2006-05-16 Thread egbert
): callback_helper() ... klas = Klas() func() gtk.main() egbert -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 -- http://mail.python.org/mailman/listinfo

Re: for-else

2008-03-08 Thread egbert
break) . exhausted - the loop ran to completion. The last two as suggested by Laurence Tratt in his Convergence. e -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 -- http://mail.python.org/mailman/listinfo/p

Re: for-else

2008-03-09 Thread egbert
the else refers to an iterator_is_exhausted condition, whatever logical explanation you may offer. . for each_item in item_list: .do_something() . else: .do_else() My temporary solution will be to accompany this else with an appropriate comment: # exhausted e -- Egbert Bouwman - Keizersgracht 197 II - 10

Re: formatting list -> comma separated (slightly different)

2008-07-09 Thread egbert
nd Chris row = ["Anne","Bob","Chris"] txt = ", ".join(row) pos = txt.rfind(", ") new = "%s and %s" % (txt[0:pos], txt[pos+2:]) egbert -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 ===

Re: current week / weeks in year - best practice

2008-08-03 Thread egbert
On Sat, Aug 02, 2008 at 07:46:49PM -0700, Dennis Lee Bieber wrote: > > What is the meaning of ? e. -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 -- http://mail.python.org/m

Re: Java or C++?

2008-04-15 Thread egbert
What is the role or position of C# in this context ? If I remember well, some people have said that C# is an improved C++ or Java. e -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 -- http

SQLite's default ON CONFLICT algorithm

2008-08-18 Thread egbert
at I should not use the ROLLBACK conflict algorithm in my sql. Instead I have to catch the IntegrityError and call the rollback method. Does that mean that I have to wrap all multi-command transactions in a try-except if I don't like the default ABORT choice ? e -- Egbert Bouwman - Keizersgra

from import and __init__.py

2010-03-25 Thread egbert
When I do 'from some_package import some_module' the __init__.py of some_package will be run. However, there will not be anything like a package-module, and the effects of __init__.py seem all to be lost. Is that true ? Or can I still do something useful with __init__.py ? e -- Egbe

Re: from import and __init__.py

2010-03-25 Thread egbert
On Thu, Mar 25, 2010 at 12:43:13PM -0400, Terry Reedy wrote: > On 3/25/2010 6:16 AM, egbert wrote: > >When I do 'from some_package import some_module' > >the __init__.py of some_package will be run. > >However, there will not be anything like a package-module, &g

Re: Is there a standard name for this tree structure?

2010-04-06 Thread egbert
On Sun, Apr 04, 2010 at 12:10:02PM +, Steven D'Aprano wrote: > I can implement this tree using a flat dict: > > root = object() > data = {root: ['Mammal', 'Reptile'], What is the advantage, or thougth behind, using an instance of object as the root o

List-type attributes and name strings

2010-07-01 Thread egbert
estring].append(value) and for a dictionary: >>> self.__dict__[namestring][keystring]=value But I have the impression that I am cheating, because users should not operate on __dict__ directly. Is that true ? And are there better solutions ? egbert -- Egbert Bouwman - Keizersgracht 197 II

Re: List-type attributes and name strings

2010-07-01 Thread egbert
On Thu, Jul 01, 2010 at 04:02:49AM -0700, Chris Rebert wrote: > switch to getattr() as demonstrated above. > Thanks for opening my eyes, Chris. egbert -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6

Re: List-type attributes and name strings

2010-07-01 Thread egbert
d not use the hard coding of attr1 and attr2 like you did. And because of a blind spot for getattr() I modified __dict__. Thanks to you, Chris and Lie it will not happen again, I promise. egbert -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 02

Re: When the first line of a file tells something about the other lines

2010-08-16 Thread egbert
lines: > # ... Beautiful. And a nice suggestion to read the itertools docs. egbert -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 -- http://mail.python.org/mailman/listinfo/python-list

When the first line of a file tells something about the other lines

2010-08-16 Thread Egbert Bouwman
ne = file_line.strip() # now do something with stripped_line f.close() egbert -- Egbert Bouwman Keizersgracht 197-II 1016 DS Amsterdam Tel 0(031)20 6257991 -- http://mail.python.org/mailman/listinfo/python-list