Re: problem with classes

2005-08-26 Thread bruno modulix
s of Stuff), not an instance attribute. To define instance attribute, the syntax is: class Stuff(object): def __init__(self): self.z = [0, 0] -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding bound methods dynamically... CORRECTED

2005-08-31 Thread bruno modulix
oms/patterns in dynamic languages that seems somewhat alien at first, then become an obvious solution. When I discovered first-class functions and anonymous functions with Python some years ago, I wondered what could be the use of such things. Now I couldn't live without... -- bruno desthuillie

Re: Bicycle Repair Man usability

2005-08-31 Thread bruno modulix
ionnalities ratio can be very different. So what would be a medium-size project in Java usually become a small-size project in Python. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]&#

Re: HTML tags optimization [better learn CSS]

2005-08-31 Thread Bruno Desthuilliers
DENG a écrit : > hi all, > > i use SGMLParser to process HTML files, in order to do some > optimizations, > > something like this: > > TEXT1TEXT2 > > optimise to > > TEXT1TEXT2 Doesn't Tidy do this already ? > > at the very beginning, i was thinking of analysing each text-block, to > know t

Re: Well, Reading is hard to learn...

2005-09-01 Thread bruno modulix
something like PyMOL would be *much more* difficult to understand if it was implemented in C++. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list

Re: HTML tags optimization [better learn CSS]

2005-09-01 Thread bruno modulix
peut etre we can talk about it in ecole > polytechnique? Peut-être pas, je ne mets jamais les pieds chez les polytechniciens. > i'll be there waiting for you I'm afraid you'll learn a long time. Regards, -- bruno desthuilliers python -c "print '@'.join

Re: Adding bound methods dynamically... CORRECTED

2005-09-01 Thread bruno modulix
Mike Meyer wrote: > bruno modulix <[EMAIL PROTECTED]> writes: > >>Devan L wrote: >> >>>Kevin Little wrote: >>> >>> >>>>I want to dynamically add or replace bound methods in a class. >> >>(snip) >> >> &

Re: Adding bound methods dynamically... CORRECTED

2005-09-01 Thread Bruno Desthuilliers
Kevin Little a écrit : Oops, sorry, forgot to answer > ''' > I want to dynamically add or replace bound methods in a class. (snip) > Is there a more pythonic way that's as straight forward? What's wrong with: class Foo: pass def method(self): print "%s" % self f = Foo() Foo.method = me

Re: Add lists to class?

2005-09-01 Thread Bruno Desthuilliers
BBands a écrit : (snip) > class master: > def __init__(self, list): Don't use 'list' as an identifier, it will shadow the builtin list type. -- http://mail.python.org/mailman/listinfo/python-list

Re: descriptors for container items

2005-09-02 Thread bruno modulix
igher level view of your data, descriptors may be a good choice. I used them that way for a higher-level ldap API, where the class representing the LDAP object mainly stores the raw result (as returned by python-ldap) of the ldap query and uses descriptors to provide controlled (an simpler) access

Re: [OT] HTML tags optimization

2005-09-02 Thread bruno modulix
mine), the obvious, CS101 answer is to first build an AST of your document, then transform this AST - collapsing nodes when possible etc -, then write it back as (if possible valid) html. -- bruno desthuilliers ruby -e "print '[EMAIL PROTECTED]'.split('@').collect{|p|

Re: Django Vs Rails

2005-09-06 Thread bruno modulix
D H wrote: (snip) > Go with Rails. Django is only like a month old. Please take time to read the project's page. Django has in fact three years of existence and is already used on production websites, so it's far from pre-alpha/planning stage. -- bruno desthuilliers pyt

Re: Generators and Decorators doing my head in ..

2005-09-06 Thread bruno modulix
Paul McGuire wrote: (snip) > (This is a quick-and-dirty example, but it works. A proper iterator s/iterator/decorator/ (snip) -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED

Re: Django Vs Rails

2005-09-06 Thread bruno modulix
D H wrote: > bruno modulix wrote: > >> D H wrote: >> >> (snip) >> >>> Go with Rails. Django is only like a month old. >> >> >> Please take time to read the project's page. Django has in fact three >> years of existence and i

Re: Django and SQLObject. Why not working together?

2005-09-08 Thread Bruno Desthuilliers
Ksenia Marasanova a écrit : > 2005/9/8, Sokolov Yura <[EMAIL PROTECTED]>: > >>Django Model is wonderfull. But SQLObject more flexible (and powerfull, >>as i think, and has already more db interfaces). >>But Django Model is tied with Django, and using Django with another OO >>mapping is not comfort

Re: How to dynamicly define function and call the function?

2005-09-09 Thread bruno modulix
lass), and any object having a __call__() method is callable: class Greeter(object): def __init__(self, name, greeting="hello %(who)s, my name is %(name)s"): """ greeting is supposed to be a format string with %(name)s and %

Re: Why do Pythoneers reinvent the wheel?

2005-09-11 Thread Bruno Desthuilliers
Stefano Masini a écrit : (snip) > If such a "quick and dirty" section existed, I think it would also > become a natural randevouz point for innovators. s/randevouz/rendez-vous/ !-) pardon-my-french-ly y'rs -- http://mail.python.org/mailman/listinfo/python-list

Re: Redundant code in multiple methods

2005-09-12 Thread bruno modulix
wargs): def wrapped(fargs): do_something_before_funcall(wargs, fargs) res = fun(fargs) do_something_after_funcall(wargs, fargs) return res return wrapped class Machin(object): def to_be_wrapped(self, args): # code here... # Zope 2.x uses Python 2.3.x, so no @decorator

Re: ZPT and "incompatible version None" error :(

2005-09-12 Thread bruno modulix
ry posting on a Zope/Plone related mailing-list. This is a Zope Page Template specific problem, and you'll get better answers if you ask in the right place. Also, googling for ZPT + macro + "incompatible version" may be helpful too. -- bruno desthuilliers python -c "print '

Re: How to protect Python source from modification

2005-09-12 Thread bruno modulix
in Python, with source available, this would > be quite easy. Then there's probably something wrong with the way you manage security. NB: splitting business logic from the GUI is still a good idea anyway. -- bruno desthuilliers - unpythonic sig: python -c "print '@'.joi

Re: How to protect Python source from modification

2005-09-12 Thread bruno modulix
e > their own program to make a connection to the database, and execute any > SQL command they want. That's why RDBMS have an authentication and security system. This doesn't means your program doesn't have or cannot add it's own security management, but it should be based on th

Re: How to protect Python source from modification

2005-09-12 Thread Bruno Desthuilliers
Frank Millman a écrit : > bruno modulix wrote: > >>Frank Millman wrote: >> >>>Hi all >>> >>>I am writing a multi-user accounting/business system. Data is stored in >>>a database (PostgreSQL on Linux, SQL Server on Windows). I have writte

Re: Inconsistent reaction to extend

2005-09-12 Thread Bruno Desthuilliers
Jerzy Karczmarczuk a écrit : > Gurus, No guru answered, so you'll have to bear with me... > before I am tempted to signal this as a bug, perhaps > you might convince me that it should be so. If I type > > l=range(4) > l.extend([1,2]) > > l gives [0,1,2,3,1,2], what else... > > On the other h

Re: Simplifying imports?

2005-09-13 Thread bruno modulix
[EMAIL PROTECTED] wrote: > I like to keep my classes each in a separate file with the same name of > the class. Let me guess: you have a C++ or Java background ?-) -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.&#x

Re: ZPT and "incompatible version None" error :(

2005-09-13 Thread bruno modulix
y idea? > > > Solution was trivial > > Duh ! I should have spotted this one :( -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Zope, ZPT and slots

2005-09-13 Thread bruno modulix
Jaroslaw Zabiello wrote: > I would like to lauch macro from another zpt file. (snip - tech answer in private) Please stop posting Zope and ZPT related questions here. There are mailing-lists dedicated to Zope. That's where you'll get the good answers. -- bruno desthuilliers r

Re: Redundant code in multiple methods

2005-09-13 Thread bruno modulix
Rob Conner wrote: > Genius! Nope. Just common Python idioms... > Thanks guys that was exactly the help I was looking for. I'll be > implementing this later today. I don't forsee any problems, so if I > don't post anything else, thank you so much for the help.

Re: An interesting python problem

2005-09-14 Thread bruno modulix
t;>>m.arr.append("haha") >>>>print m.arr, n.arr > > ['haha'] [] > Here you define a class X with an *instance* variable arr, and two instances m and n of X, then append to m.arr, which of course has no impact on n. I dont see anything interesting nor prob

Re: Unexpected Behavior Iterating over a Mutating Object

2005-09-14 Thread bruno modulix
; does this fall under what C programmers would call 'undefined > behavior.' Not being a Language Lawyer(tm), I can't tell for sure, but I'd think it's the expected behavior. Anyway it's not a behavior I'd relie upon, since it would be too much of a dirty

Re: An interesting python problem

2005-09-14 Thread bruno modulix
Johnny Lee wrote: > bruno modulix wrote: > >>I dont see anything interesting nor problematic here. If you understand >>the difference between class attributes and instance attributes, the >>difference between mutating an object and rebinding a name, and the >>at

Re: An interesting python problem

2005-09-14 Thread bruno modulix
e thing A.i points to > >## A.i -> (int 0 object) >## a.i -> (int 0 object) >## b.i -> (int 0 object) idem >>>>a.i = 1 ## point a.i to a new (int object) > > ## A.i -> (int 0 object) >## b.i -&

Re: ddd or eclipse with mod_python

2005-09-15 Thread bruno modulix
Sakcee wrote: > Hi > > I am using mod_python for web development, I am in need of some ide , > can i use ddd or eclipse with pydev with mod_python. Don't know, but you may want to check Eric3, a full blown Python IDE with support for mod_python debugging. -- bruno desthu

Re: change an element of a list

2005-09-15 Thread bruno modulix
ples and for each tuple 'replace' target with 'replacement """ for i, t in enumerate(alist): l = list(t) while target in l: l[l.index(target)] = replacement alist[i] = tuple(l) my_replace(lists, 'None', 'NULL') HTH -- bruno d

Re: change an element of a list

2005-09-15 Thread bruno modulix
or 'None'. May be too > easy... Nope, why ? If you need to turn this list into a string anyway, doing a replace on the string is of course the simplest and most obvious solution. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for

Re: Lines of Strings

2005-09-16 Thread bruno modulix
er line come after a short one. That's fine. Now try and do it, and ask for help when you're in trouble. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't IDLE editor windows have horizontal scrollbars?

2005-09-16 Thread bruno modulix
contributing to it !-) More seriously, I dont think IDLE is intended to be a real professional IDE - anyway, I would not use it as such. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]&

Re: Python Doc Problem Example: os.path.split

2005-09-18 Thread Bruno Desthuilliers
Laszlo Zsolt Nagy a écrit : > >> is the doc writer, trying to write the doc with some austereness, but >> is confused about the behavior of split, or confused about expressing >> it? Did his pretension fucked him up? >> >> > Dear Xah Lee, > > The Python community is very sorry because we have a

Re: functional or object-oriented?

2005-09-19 Thread Bruno Desthuilliers
beza1e1 a écrit : > I see myself shifting more and more over to the functional kind of > coding. Could be related to the Haskell, we had to learn in CS. Now i > was wondering, how other people use Python? > > With functional i mean my files mostly consist of functions which is not enough to make

Re: Removing Warning Messages .............

2005-09-19 Thread Bruno Desthuilliers
chand a écrit : > Hi., > > In my api.py file 'g_opt_list' is defined globally > g_opt_list =[[],[],[],[],[],[],[]] > > when I run the py file, I am getting the Following Error > > SyntaxWarning: name 'g_opt_list' is used prior to global declaration > SyntaxWarning: name 'layers' is used prior to

Re: very high-level IO functions?

2005-09-19 Thread Bruno Desthuilliers
York a écrit : (snip) > I love python. However, as a biologist, I like some high-levels > functions in R. I don't want to spend my time on parse a data file. http://www.python.org/doc/current/lib/module-csv.html > Then > in my python script, I call R to read data file and write them into an >

Re: functional or object-oriented?

2005-09-20 Thread bruno modulix
defining functions as instances of class function. So even the most FP Python programs are still OO, at least under the hood !-) My 2 cents -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list

Re: Organising a python project

2005-09-20 Thread bruno modulix
modules, eventually organized in packages, and a 'main' script that's the entry point for the program [1]. Most Python projects being OSS, you can examine existing projects. [1] Note that this not Python specific. You'll find the same overall organisation in C, C++, Java,

Re: using variable-value

2005-09-21 Thread bruno modulix
ribute 'method' "... Try this for method in dir(self.canvas): print method print help(getattr(self.canvas, "method")) HTH -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list

Re: Help w/ easy python problem

2005-09-22 Thread bruno modulix
e trick is I have to do this using > only 7-8 lines of code. Any ideas? > Yes : do your homework yourself. When you'll run into trouble with *your* code, then post here for help. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p

Re: overwriting method in baseclass

2005-02-07 Thread bruno modulix
changed library. But someday, it happened before, there will be an update by the publisher to that library and I have to do all again. So, what is the most elegant solution to administer these changes? Use a version control system (svn is quite fine...). -- bruno desthuilliers ruby -e "

Re: Loop in list.

2005-02-08 Thread Bruno Desthuilliers
is syntax comes from Haskell. HTH !-) Bruno -- http://mail.python.org/mailman/listinfo/python-list

Re: Lambda

2005-02-09 Thread bruno modulix
e wrote: here's what is probably an unusual question: A very open one at least !-) -- bruno desthuilliers ruby -e "print '[EMAIL PROTECTED]'.split('@').collect{|p| p.split('.').collect{|w| w.reverse}.join('.')}.join('@')" -- -- http://mail.python.org/mailman/listinfo/python-list

Re: Lambda

2005-02-09 Thread bruno modulix
know what the heck it is/does/fixes/whatever! lambda is a keyword that is used to create anonymous functions. This is pretty handy for simple callbacks. -- bruno desthuilliers ruby -e "print '[EMAIL PROTECTED]'.split('@').collect{|p| p.split('.').collect{|w

Re: Some questions...

2005-02-10 Thread bruno modulix
program like Crystal Reports?? ReportLab is probably the place to go http://www.reportlab.org/ - Database access: Firebird , I dont found correct information about this tools and his conection/working with Python. http://kinterbasdb.sourceforge.net/ Thanks!!! HTH -- bruno desthuilliers ruby -e "

Re: [N00B] What's %?

2005-02-10 Thread Bruno Desthuilliers
the integer division, ie 5 % 2 = 1) One of the most commun use is to test wether a number is odd or even: any_even_number % 2 == 0 any_odd_number % 2 == 1 Note that the % operator is also used for string formating, ie: "%d modulo %d = %d" % (5, 2, 1) => "5 modulo 2 = 1" Ple

Re: goto, cls, wait commands

2005-02-10 Thread Bruno Desthuilliers
D] modulix $ cls -bash: cls: command not found Bad luck ! didn't work !-) Bruno -- http://mail.python.org/mailman/listinfo/python-list

Re: goto, cls, wait commands

2005-02-10 Thread Bruno Desthuilliers
Grant Edwards a écrit : On 2005-02-10, BOOGIEMAN <[EMAIL PROTECTED]> wrote: First of all, what's Python command equivalent to QBasic's "goto" ? There isn't one. One defines functions and calls them. One uses for and while loops. One uses list comprehensions. One uses if/elif/else. and even s

Re: [perl-python] combinatorics fun

2005-02-11 Thread bruno modulix
ht be able to teach other people what you obviously know nothing about, teaching people from a language that you know nothing about. *PLEASE STOP POSTING*!! *NOBODY WANTS YOU TO POST*!! The guy is an obvious, well-known and self-proclaimed troll. Dont feed the troll. -- bruno desthuillie

Re: Python v.s. c++

2005-02-11 Thread bruno modulix
xiaobin yang wrote: Hi, if i am already skillful with c++. Is it useful to learn python? thanks! Q : If I'm already skillfull with driving a big truck, is it useful to learn driving a motorcycle? (tip : Have you ever tried driving a big truck in a big city at rush hour?-) --

Re: [NooB] Using Escape Sesquences with Strings...

2005-02-11 Thread bruno modulix
ock 2/ adding the tabs before printing: rock = """ Igneous Sedimentary Metamorphic Lava Grains Marble Ramdom crystals LayerBands Granite Salt Schist IntrusiveWeathering Heat + Pr

Re: Newbie help

2005-02-14 Thread bruno modulix
; number 3/ guess == number Here the 2/ and /3 are handled by the same branch... guess = int(raw_input("Take Another guess: ")) tries += 1 print "You guessed it! The number was", number print "And it only took you", tries, "tries!\n" This will be ex

Re: saving a text file

2005-02-14 Thread bruno modulix
#x27;myfile.txt', 'w') f.write(my_data) f.close() You'll of course need to add some code to handle IOErrors... (snip) HTH -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list

Re: nested lists as arrays

2005-02-14 Thread bruno modulix
[0, 0, 0], [0, 0, 0]] >>> l[0][0], l[0][1] = l[0][1], l[0][0] >>> l [[0, 1, 0], [0, 0, 0], [0, 0, 0]] >>> So I guess that your problem has nothing to do with nested lists. (Also note BTW that, thanks to the magic of multiple assignement, you don't need the dummy stuff.

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-14 Thread bruno modulix
about essential needs and requirements. I couldn't agree more. You need to find a community that *does* care about essential needs. Might I recommend Perl or Ruby? Why do you hate Perl and Ruby community that much ? -- bruno desthuilliers python -c "print '@'.join(['.&

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-14 Thread bruno modulix
Ilias Lazaridis wrote: I'm a newcomer to python: [EVALUATION] - E01: The Java Failure - May Python Helps? http://groups-beta.google.com/group/comp.lang.python/msg/75f0c5c35374f553 My trollometer's beeping... -- bruno desthuilliers python -c "print '@'.join(['.&#

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-14 Thread Bruno Desthuilliers
jfj a écrit : bruno modulix wrote: Ilias Lazaridis wrote: I'm a newcomer to python: [EVALUATION] - E01: The Java Failure - May Python Helps? http://groups-beta.google.com/group/comp.lang.python/msg/75f0c5c35374f553 My trollometer's beeping... When person 'A' calls person &#

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-14 Thread Bruno Desthuilliers
Stephen Kellett a écrit : In message <[EMAIL PROTECTED]>, Simon Brunning <[EMAIL PROTECTED]> writes On Mon, 14 Feb 2005 14:12:57 +0100, bruno modulix <[EMAIL PROTECTED]> wrote: Why do you hate Perl and Ruby community that much ? Oh, I don't. But fair's fair - we'v

Re: [long] nested lists as arrays

2005-02-14 Thread bruno modulix
rformMove(), call the performMove() on each clone and store the clone. (BTW, the name of the method may be somewhat misleading, and I'm not sure this method really belongs to the Puzzle class. ) and finally (pun intend !-) : try: self.children.append(newchild)

Re: DHTML control from Python?

2005-02-14 Thread Bruno Desthuilliers
Kenneth McDonald a écrit : In article <[EMAIL PROTECTED]>, aurora <[EMAIL PROTECTED]> wrote: What are the win 32 modules? Searching "OS X win 32" on Google gave me a bit too much... I guess Aurora did not took time to read your whole post. Win32 modules are for Windows, of course... -- http://mail

Re: regular expression question

2005-02-14 Thread Bruno Desthuilliers
snacktime a écrit : The primary question is how do I perform a match when the regular expression contains string variables? For example, in the following code I want to match a line that starts with STX, then has any number of characters, then ends with STX. Example 2 I'm pretty sure works as I ex

Re: Variables.

2005-02-15 Thread bruno modulix
gh to read your mind !-) (and please : avoid SCREAMING and l33t speak too...) -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-15 Thread bruno modulix
when done they'll retire the current implementation and lock everyone to a proprietary platform. I know it's hard to believe, but there are clues... -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p

Re: os.walk() usage

2005-02-15 Thread bruno modulix
st(path ? What's your problem *exactly* ?-) BTW, you may want to have a look at the path module : http://www.jorendorff.com/articles/python/path/ -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAI

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-15 Thread bruno modulix
Ilias Lazaridis wrote: bruno modulix wrote: Ilias Lazaridis wrote: there are other reasons behind the decision to not support the MinGW open-source-complier directly out of the main source-code base. Yes, of course. The reason is they are lying about their commitment to open source. They are

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-15 Thread Bruno Desthuilliers
Ilias Lazaridis a écrit : bruno modulix wrote: Ilias Lazaridis wrote: (snip) impressive. but things are much simpler. Could you be more prolific ? Please explain the word "prolific". Say more -- http://mail.python.org/mailman/listinfo/python-list

Re: Variables.

2005-02-15 Thread Bruno Desthuilliers
Jeff Shannon a écrit : bruno modulix wrote: administrata wrote: I wrote this, It's a bit lame though (snip code - see other answers in this thread) raw_input("\n\\t\t\t- The End -") Why on earth are you using raw_input() here ? This is a fairly common idiom, on Windows at least.

Re: Moving to Python from PHP - 3 questions

2005-02-21 Thread bruno modulix
p://www.python.org/topics/web/ HTH -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-21 Thread bruno modulix
Ilias Lazaridis wrote: Bruno Desthuilliers wrote: [...] closing thread http://groups-beta.google.com/group/comp.lang.python/msg/f2ae9cdbe16676d1 Nope. You are not entitled to close thread. This is irrelevant. -- bruno desthuilliers python -c "print '@'.join(['.'.join(

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-21 Thread bruno modulix
Ilias Lazaridis wrote: Should a professional developer take python serious? A *professionnal developper*, yes. But this is irrelevant to you. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '

Re: NOOB coding help....

2005-02-22 Thread bruno modulix
not defined See above. I cannot understand how I can define yes so that when they type yes the data is printed out. Yes = 'yes' ?-) Also if they type no how do I make the program do nothing. Or is that just infered. May I suggest that you : - subscribe to the 'tutor' mailing-

Re: Ruby on Rails or Perl's Maypole..is there a Python equivalent

2005-03-03 Thread Bruno Desthuilliers
Gary Nutbeam a écrit : I've noticed that the Perl camp has a very nice web/database environment called Maypole. Ruby has the Rails environment which on the surface seems similar to Maypole. I can't find anything in Python that ties a database to a web interface anywhere near as well as Ruby on Rail

Re: Ruby on Rails or Perl's Maypole..is there a Python equivalent

2005-03-04 Thread bruno modulix
ding to learn Ruby. A nice language, but yes, there can be practical reasons to stick with Python. (snip) -- bruno desthuilliers ruby -e "print '[EMAIL PROTECTED]'.split('@').collect{|p| p.split('.').collect{|w| w.reverse}.join('.')}.join('@')" -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie: dictionary - howto get key value

2005-03-10 Thread bruno modulix
x27;]} rev_phone[3] --> ['john', 'jack'] But now you've got another problem : you need to update the reversed index each time you modify the dictionary... Which would lead to writing a class extending dict, maintaining a reversed index, and exposing extra methods to handle this. But there may be a better way (someone else ?) -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie: dictionary - howto get key value

2005-03-10 Thread bruno modulix
know what else needs to be done in Gerhard's process. Hope I haven't been to harsh !-) Of course, we could put this loop in a call and return the name yeps. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list

Re: (Newbie) Restricting inherited methods to operate on element from same subclass

2005-03-11 Thread Bruno Desthuilliers
andy2o a écrit : Hi all, Sorry if the post's title is confusing... I'll explain: I have a class, called A say, and N>1 subclasses of A, called A1, A2, A3, ..., AN say. Instances of each subclass can sensibly be joined together with other instances of the *same subclass*. The syntax of the join me

Re: storing large amounts of data in a list/dictionary

2005-03-11 Thread Bruno Desthuilliers
large dataset, you may want to have a look at btrees (one possible implementation here : http://zopewiki.org/BTree). Now since it's XML related, this may also (or not) be useful: http://effbot.org/zone/celementtree.htm http://effbot.org/zone/element-index.htm HTH Bruno -- http://mail.python.org/mailman/listinfo/python-list

Re: Python becoming less Lisp-like

2005-03-14 Thread Bruno Desthuilliers
st sign of 'special chars' syntax. I don't like Perl, I still prefer to use Python (over Ruby) for a number of good and less good reasons, but I somewhat share Fernando's (and some other's people here) concerns about the future of MyFavoriteLanguage. Bruno -- http://mail.python.org/mailman/listinfo/python-list

readonly class attribute ?

2005-03-15 Thread bruno modulix
7;s dict ? (most client code - apart from subclass definitions - shouldn't even bother about the existence of this attribute, it's there for the library internal usage) NB : in the real code I'm also messing with the AbstractBaseClass's meta_class for other stuff (so it's not a

Re: Python becoming less Lisp-like

2005-03-15 Thread Bruno Desthuilliers
Valentino Volonghi aka Dialtone a écrit : Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: It is actually. Ruby's syntax is mostly consistent and coherent, and there is much less special cases than in Python. I'd be glad to know which special cases are you referring to. A f

Re: Python becoming less Lisp-like

2005-03-15 Thread Bruno Desthuilliers
Martin Franklin a écrit : Tim Daneliuk wrote: In-Reply-To: <[EMAIL PROTECTED]> (snip) Of course we users will complain about removals, but we'll knuckle down and take our medicine eventually ;-) Except that in this case, removal will also complicate code in some cases. Consider this fragment of Tk

Re: readonly class attribute ?

2005-03-15 Thread Bruno Desthuilliers
ve the cleanest syntax for the subclass declaration. In fact, in most cases, the client code should not have much more to do than defining a handfull of class attributes to end up with a taylor-made fully functional subclass. Bruno -- http://mail.python.org/mailman/listinfo/python-list

Re: readonly class attribute ?

2005-03-15 Thread Bruno Desthuilliers
Bengt Richter a écrit : On Tue, 15 Mar 2005 20:21:19 +0100, bruno modulix <[EMAIL PROTECTED]> wrote: Hi How can I make a *class* attribute read-only ? (snip) Does this help, or did I misunderstand? >>> class Base(object): ... class __metaclass__(type): ... def __seta

Re: Variable Variable

2005-03-19 Thread Bruno Desthuilliers
Tanteauguri a écrit : Hi List, is there in python a variable variable like in PHP ($$var)? Hopefully, no. See other answers in that thread for pythonic idioms. -- http://mail.python.org/mailman/listinfo/python-list

Re: Obfuscated Python: fun with shadowing builtins

2005-03-19 Thread Bruno Desthuilliers
fraca7 a écrit : Michael Hoffman wrote: Enjoy ;) That's not the exact word that first came to my mind :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Please help for Python programming

2005-03-21 Thread bruno modulix
all 30 gigabytes of third part libs | etc...] just to help you. Moreover, quite often, one finds the bug while reducing the problematic code to it's smallest possible. And one last: don't forget to put your bullet-proof jacket on before reading the answers !-) (well, c.l.py is prob

Re: Please help for Python programming

2005-03-22 Thread bruno modulix
ata1, data2 = line.strip().split(';') except ValueError: print >> sys.stderr, "wrong file format" f.close() sys.exit(1) try: users[user].append("%s : %s" % (data1, data2)) except KeyError: users[user] = ["%s : %s" % (data1, data

Re: Begniner Question

2005-03-22 Thread bruno modulix
ne. If you don't have the needed code yet, you need to put a 'pass' here : if some_condition: pass else: pass This will of course do nothing else than useless tests, but it will at least satisfy the language's rules. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list

Re: Anonymus functions revisited

2005-03-22 Thread bruno modulix
NameError problem with z to handle, No. AFAICT, the name error could be with x and/or y and/or z. so where is the gain of using lambda or the mapping? See upper... -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for

Re: Anonymus functions revisited

2005-03-22 Thread bruno modulix
guments (sorry for the pun !-) to gain my adhesion. (NB : I could use this syntax without problem, it's just that we already have a syntax for this). -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list

Re: Anonymus functions revisited

2005-03-22 Thread bruno modulix
bruno modulix wrote: Kay Schluehr wrote: Since George Sakkis proposed a new way of doing list comprehensions http://groups-beta.google.com/group/comp.lang.python/browse_frm/thread/ac5023ad18b2835f/d3ff1b81fa70c8a7#d3ff1b81fa70c8a7 letting tuples-like objects (x,y,z=0) acting as functions on

Re: Anonymus functions revisited

2005-03-22 Thread bruno modulix
where the lack of expressive power leads to overly complicated code to get simple things done. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list

Re: Anonymus functions revisited

2005-03-22 Thread bruno modulix
lasses, first class functions, builtin datatypes like lists and dicts, exceptions, dynamic typing, garbage collection, etc too. Hurray, let's all happily program in assembly !-) -- bruno desthuilliers ruby -e "print '[EMAIL PROTECTED]'.split('@').collect{|p

Re: Anonymus functions revisited

2005-03-22 Thread bruno modulix
lf AFAICT. I think it would be nice to have, but I can't imagine it to be really very helpful. I once had the same feeling about first class functions, higher-order functions, lambdas, list comprehension, __call__ special method, descriptors, metaclasses, and a whole lot of other constructs

Re: Anonymus functions revisited

2005-03-22 Thread Bruno Desthuilliers
Ron a écrit : (snip) def dfv( arg = value): return arg > >>> def dfv( arg = value): ... return arg ... Traceback (most recent call last): File "", line 1, in ? NameError: name 'value' is not defined And sorry, but -1 for using exec here. -- http://mail.python.org/mailman/listinfo

Re: Anonymus functions revisited

2005-03-22 Thread Bruno Desthuilliers
Ron a écrit : On 21 Mar 2005 22:37:42 -0800, "Kay Schluehr" <[EMAIL PROTECTED]> wrote: Mappings like that: ((x,y),z) -> x+y-z ((x,y=0),z) -> None should be valid actions too. What is the audience thinking about that? I think that there's too much implied, and that in the long run it, if we k

<    1   2   3   4   5   6   7   8   9   10   >