Re: "0 in [True,False]" returns True

2005-12-15 Thread Antoon Pardon
Op 2005-12-14, Grant Edwards schreef <[EMAIL PROTECTED]>: > On 2005-12-14, Antoon Pardon <[EMAIL PROTECTED]> wrote: > > Well, as you might argue, I'm not tryng to effect a change in > your behaviour, I'm simply trying to point out how it could be > made more rational. > [...] Or re

Re: "0 in [True,False]" returns True

2005-12-15 Thread bonono
Antoon Pardon wrote: > Op 2005-12-14, Grant Edwards schreef <[EMAIL PROTECTED]>: > > On 2005-12-14, Antoon Pardon <[EMAIL PROTECTED]> wrote: > > > > Well, as you might argue, I'm not tryng to effect a change in > > your behaviour, I'm simply trying to point out how it could be > > made

Re: "0 in [True,False]" returns True

2005-12-15 Thread Antoon Pardon
Op 2005-12-14, Mike Meyer schreef <[EMAIL PROTECTED]>: > [EMAIL PROTECTED] writes: >> Steve Holden wrote: >>> >>It would be somewhat more self-documenting, but why not just use one >>> >>name to indicate the state and another, only meaningful in certain >>> >>states, to indicate the callback? >>> >

Re: Questions about working with character encodings

2005-12-15 Thread garabik-news-2005-05
Kenneth McDonald <[EMAIL PROTECTED]> wrote: > I am going to demonstrate my complete lack of understanding as to > going back and forth between > character encodings, so I hope someone out there can shed some light > on this. I have always > depended on the kindness of strangers... :-) > > I'm

Re: How to get the local mac address?

2005-12-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Frank Millman wrote: > >>[EMAIL PROTECTED] wrote: >> >>>Sorry that I can't help you in any way but have a question myself. Is >>>there an OS independent way to get this thing(regardless of how to >>>format it) in Python ? I know this may not matter if all you want is >>

Re: How to get the local mac address?

2005-12-15 Thread Frank Millman
[EMAIL PROTECTED] wrote: > Frank Millman wrote: > > [EMAIL PROTECTED] wrote: > > > Sorry that I can't help you in any way but have a question myself. Is > > > there an OS independent way to get this thing(regardless of how to > > > format it) in Python ? I know this may not matter if all you want

Re: IsString

2005-12-15 Thread Steve Holden
Donn Cave wrote: > Quoth Mike Meyer <[EMAIL PROTECTED]>: > | Donn Cave <[EMAIL PROTECTED]> writes: > ... > > The question is whether basically everyone needs to get there, or we > can expect the masses to use the language _without understanding it_ > in this sense, without understanding the langua

Re: OO in Python? ^^

2005-12-15 Thread Antoon Pardon
Op 2005-12-14, Christopher Subich schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Suppose we would add type declarations in python. >> So we could do things like >> >> int: a >> object: b >> >> Some people seem to think that this would introduce static >> typing, but the only effect th

Re: OO in Python? ^^

2005-12-15 Thread Antoon Pardon
Op 2005-12-14, Magnus Lycka schreef <[EMAIL PROTECTED]>: > Christopher Subich wrote: >> Doesn't work; duck typing is emphatically not subclass-typing. For this >> system to still work and be as general as Python is now (without having >> to make all variables 'object's), we'd need true interface

Re: How to get the local mac address?

2005-12-15 Thread bonono
Steve Holden wrote: > Why should you want to associate a MAC address with a socket? Each > interface has an IP address, and it's that you should be using. Say for example I want to find out the MAC if a particular interface in python. > It may well be possible to write Python code that will run o

Re: How to get the local mac address?

2005-12-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Steve Holden wrote: > >>Why should you want to associate a MAC address with a socket? Each >>interface has an IP address, and it's that you should be using. > > Say for example I want to find out the MAC if a particular interface in > python. > When you are asked "why

Re: Self-awareness of imported modules? Do they know where they live?

2005-12-15 Thread Dody Suria Wijaya
import os print os.__file__ -- dsw -- http://mail.python.org/mailman/listinfo/python-list

Re: Self-awareness of imported modules? Do they know where they live?

2005-12-15 Thread Martin M.
Hi Heiko, Thanks so much for your help! I just tested it and it works like a charm! Test File 1 -- main.py #!/usr/bin python from lib import being being.location() Test File 2 -- being.py #!/usr/bin/python import os def location(): print os.path.abspath(__file__) res

Re: PHP = Perl Improved

2005-12-15 Thread Måns Rullgård
Martin Christensen <[EMAIL PROTECTED]> writes: >> "Tin" == Tin Gherdanarra <[EMAIL PROTECTED]> writes: > > Tin> Xah Lee wrote: >>> recently i got a project that involves the use of php. In 2 days, i >>> read almost the entirety of the php doc. Finding it a breeze >>> because it is roughly base

Re: How to get the local mac address?

2005-12-15 Thread bonono
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > > Steve Holden wrote: > > > >>Why should you want to associate a MAC address with a socket? Each > >>interface has an IP address, and it's that you should be using. > > > > Say for example I want to find out the MAC if a particular interface in > >

Re: How to get the local mac address?

2005-12-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Steve Holden wrote: > >>[EMAIL PROTECTED] wrote: >> >>>Steve Holden wrote: >>> >>> Why should you want to associate a MAC address with a socket? Each interface has an IP address, and it's that you should be using. >>> >>>Say for example I want to find out the MAC

Re: How to get the local mac address?

2005-12-15 Thread bonono
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > > Steve Holden wrote: > > > >>[EMAIL PROTECTED] wrote: > >> > >>>Steve Holden wrote: > >>> > >>> > Why should you want to associate a MAC address with a socket? Each > interface has an IP address, and it's that you should be using. > >>> > >

Re: Developing a network protocol with Python

2005-12-15 Thread Laszlo Zsolt Nagy
Paul Rubin wrote: >Laszlo Zsolt Nagy <[EMAIL PROTECTED]> writes: > > >>But how can I transfer pure python objects otherwise? Pyro also uses >>Pickle and it also transfers bytecode. >> >> >Pyro in the past used pickle in an insecure way. I'd heard it had >been fixed and I didn't realize it s

Re: Get rid of recursive call __getattr__

2005-12-15 Thread bruno at modulix
Steve Holden wrote: > Peter Otten wrote: > >> Pelmen wrote: >> >> >> class Test: >>> >>> >>> def __getattr__(self, attr): >>>print attr >>> >>> def foo(x): >>>print x >>> >>> >> t = Test() >> print t >>> >>> >>> __str__ >>> >>> Traceback (most

Re: efficient 'tail' implementation

2005-12-15 Thread Marius Gedminas
Magnus Lycka wrote: > To read the last x bytes of a file, you could do: > > >>> import os > >>> x = 2000 # or whatever... > >>> f=open('my_big_file') > >>> l=os.fstat(f.fileno()).st_size > >>> f.seek(l-x) > >>> f.read() You don't need fstat/st_size, you can ask seek to move to an offset rela

Re: Python packages on OS X vs Windows

2005-12-15 Thread Roel Schroeven
BartlebyScrivener wrote: > I'm curious about this part of the post. Any fluent Pythoners actually > happy using Windows XP and, if so, do they use ipython as a kind of > bash shell substitute? Other alternatives to compensate for the widely > derided command line in windows? I often use cygwin's b

Re: threading IOError

2005-12-15 Thread Gabriel Genellina
Andrew MacIntyre ha escrito: > Gabriel Genellina wrote: > > File "C:\Apps\Python\Lib\threading.py", line 218, in wait > > remaining = endtime - _time() > > IOError: [Errno 2] No such file or directory > > > > The error appears to be inside the time module, and I can't explain the > > IOError

Python on GP2X (Linux Based Handheld Console)

2005-12-15 Thread Michael Sparks
Hi, I hadn't seen any announcements regarding this, but there's a little device recently released called a GP2X which is a small dual CPU (2x200Mhz) device which runs Linux. Anyway, I thought there might be someone in here interested to hear that python AND pygame have both been ported to it alr

Re: Windows Services

2005-12-15 Thread Mondal
Hi, Thanks to Peter, now I know how to control an *existing* Windows service and how to run a *python script* as a Windows service. Although these were really useful, my point was different. I have developed a script that monitors a specified folder for changes in the files or folders within it.

Re: How to get the local mac address?

2005-12-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Steve Holden wrote: > >>[EMAIL PROTECTED] wrote: >> >>>Steve Holden wrote: >>> >>> [EMAIL PROTECTED] wrote: >Steve Holden wrote: > > > >>Why should you want to associate a MAC address with a socket? Each >>interface has an IP address

Re: How to get the local mac address?

2005-12-15 Thread bonono
Steve Holden wrote: > Nope, but I can make inferences, whose correctness you can choose to lie > or tell the truth about. I was merely trying to make the point that your > response failed to further anybody's understanding of anything. I'm not > really bothered *why* you do what you do. That is ni

Re: Windows Services

2005-12-15 Thread Frank Millman
Mondal wrote: > Hi, > > Thanks to Peter, now I know how to control an *existing* Windows > service and how to run a *python script* as a Windows service. Although > these were really useful, my point was different. > > I have developed a script that monitors a specified folder for changes > in the

Re: How to get the local mac address?

2005-12-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Steve Holden wrote: > >>Nope, but I can make inferences, whose correctness you can choose to lie >>or tell the truth about. I was merely trying to make the point that your >>response failed to further anybody's understanding of anything. I'm not >>really bothered *why* y

Re: OO in Python? ^^

2005-12-15 Thread Ben Sizer
Antoon Pardon wrote: > Op 2005-12-14, Christopher Subich schreef > > Doesn't work; duck typing is emphatically not subclass-typing. > > I don't see how that is relevant. > > > For this > > system to still work and be as general as Python is now (without having > > to make all variables 'object's),

Re: Windows Services

2005-12-15 Thread Steve Holden
Mondal wrote: > Hi, > > Thanks to Peter, now I know how to control an *existing* Windows > service and how to run a *python script* as a Windows service. Although > these were really useful, my point was different. > > I have developed a script that monitors a specified folder for changes > in th

Re: How to get the local mac address?

2005-12-15 Thread bonono
Steve Holden wrote: > I'm probably just not reading your responses carefully enough. That is fine, misunderstanding happens all the time. And why I am curious that there is no such thing in Python, it is because of this : http://search.cpan.org/~lds/IO-Interface-0.98/Interface.pm I am learning p

PyOpengl text rendering with autocad font

2005-12-15 Thread Marco
I must use text in Opengl, Python This text is for architecture design then I need to use AutoCad fonts (extension .shx). I have two troubles: I don't find a guide, a good program, something for use any kind of fonts in PyOpengl. The nehe tutorial has some bugs in translation to Python. I need to

Re: Which Python web framework is most like Ruby on Rails?

2005-12-15 Thread Ben Sizer
Mike Meyer wrote: > [Not sure if this attribution is correct.] > > Alex Martelli wrote: > > Because of course if other languages have 1 or two frameworks, python > > needs a dozen. > > People keep talking about Python's wealth of web frameworks as if it > were a bad thing. I just don't see it. Just

Re: Windows Services

2005-12-15 Thread bonono
Steve Holden wrote: > Mondal wrote: > > Hi, > > > > Thanks to Peter, now I know how to control an *existing* Windows > > service and how to run a *python script* as a Windows service. Although > > these were really useful, my point was different. > > > > I have developed a script that monitors a s

Re: Recommend an E-book Meeting the Following Criteria (Newbie, Long)

2005-12-15 Thread andypurshottam
I reccomend David Mertz's text: http://gnosis.cx/TPiP/ Despite name its more that just text processing, he uses "modern" (ie, 20 - 30 years old) style of programming in examples, often using library packages, especially parsing tools. Online version is free, but you can pay him buy buying the p-bo

Re: How to get the local mac address?

2005-12-15 Thread Jorge Godoy
Steve Holden <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: > > Steve Holden wrote: > > > >>Why should you want to associate a MAC address with a socket? Each > >>interface has an IP address, and it's that you should be using. > > Say for example I want to find out the MAC if a particular

Why and how "there is only one way to do something"?

2005-12-15 Thread Tolga
As far as I know, Perl is known as "there are many ways to do something" and Python is known as "there is only one way". Could you please explain this? How is this possible and is it *really* a good concept? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python on GP2X (Linux Based Handheld Console)

2005-12-15 Thread Peter Hansen
Michael Sparks wrote: > I hadn't seen any announcements regarding this, but there's a little > device recently released called a GP2X which is a small dual CPU > (2x200Mhz) device which runs Linux. > > Anyway, I thought there might be someone in here interested to hear > that python AND pygame hav

Re: OO in Python? ^^

2005-12-15 Thread Antoon Pardon
Op 2005-12-15, Ben Sizer schreef <[EMAIL PROTECTED]>: > > Antoon Pardon wrote: >> Op 2005-12-14, Christopher Subich schreef >> > Doesn't work; duck typing is emphatically not subclass-typing. >> >> I don't see how that is relevant. >> >> > For this >> > system to still work and be as general as Pyt

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread jmdeschamps
Tolga wrote: > As far as I know, Perl is known as "there are many ways to do > something" and Python is known as "there is only one way". Could you > please explain this? How is this possible and is it *really* a good > concept? if you 'import this', you get a bit of Python Zen... from which I ha

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread bonono
[EMAIL PROTECTED] wrote: > Tolga wrote: > > As far as I know, Perl is known as "there are many ways to do > > something" and Python is known as "there is only one way". Could you > > please explain this? How is this possible and is it *really* a good > > concept? > > if you 'import this', you get

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Steve Holden
Tolga wrote: > As far as I know, Perl is known as "there are many ways to do > something" and Python is known as "there is only one way". Could you > please explain this? How is this possible and is it *really* a good > concept? > Perl's credo is actually "There's more than one way to do it", ofte

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Chris Mellon
On 15 Dec 2005 04:32:39 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > > Tolga wrote: > > > As far as I know, Perl is known as "there are many ways to do > > > something" and Python is known as "there is only one way". Could you > > > please explain this? How is

Re: iniciante

2005-12-15 Thread Alvaro Figueiredo
At Thursday 15 December 2005 00:33, tetri wrote: > alguém recomenda algum material disponível na internet para iniciar > os estudos em python? > outra coisa, peço que brasileiros (ou ao menos aqueles que me > entendem) se identifiquem, assim podemos começar discussões em > português mesmo, o que ac

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread bonono
Chris Mellon wrote: > On 15 Dec 2005 04:32:39 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > [EMAIL PROTECTED] wrote: > > > Tolga wrote: > > > > As far as I know, Perl is known as "there are many ways to do > > > > something" and Python is known as "there is only one way". Could you >

Re: Self-awareness of imported modules? Do they know where they live?

2005-12-15 Thread Simon Brunning
The only self aware Python scripts that I'm aware are the timbot and the effbot. Their sources are available from the PSU website at -- http://mail.python.org/mailman/listinfo/python-list

Re: OO in Python? ^^

2005-12-15 Thread Ben Sizer
Antoon Pardon wrote: > Op 2005-12-15, Ben Sizer schreef <[EMAIL PROTECTED]>: > So? I answered a question. That my answer is not usefull for > a specific purpose is very well prosible but is AFAIC irrelevant. The point being made was that your declarations such as these: int: a object: b wo

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Chris Mellon
On 15 Dec 2005 05:08:02 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Chris Mellon wrote: > > On 15 Dec 2005 04:32:39 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > [EMAIL PROTECTED] wrote: > > > > Tolga wrote: > > > > > As far as I know, Perl is known as "there are many

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: [...] > It is perfectly ok to define coding policy within an organisation, for > a project that have more than one developer and things like that. But > if the language allows more than one way to do it, people would try if > that is what they want and they can. > > I woul

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Terry Hancock
On 15 Dec 2005 05:08:02 -0800 [EMAIL PROTECTED] wrote: > I would say that if "only one way to do it" is the intend, > make it into the language and any other way is simply > error. Say if ternary operator is not the "preferred way", > don't have it in the language. If someone find a way to > work a

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread bonono
Chris Mellon wrote: >You seem very, very interested in portraying anyone who > wants to encourage good style and readability as a language Nazi. I > don't appreciate that. You'll notice that I haven't taken the easy way > out and told you to go away and play with Perl, right? Noop. My stand is tha

Dr. Dobb's Python-URL! - weekly Python news and links (Dec 14)

2005-12-15 Thread Cameron Laird
QOTW: "If I feel the need for languages that enforce my design decisions, I know where to find them." - Mike Meyer "There's ... unavoidable complexity involved in managing a software distribution composed of third party software packages. At the very least, you've got the original sources and t

Re: Newbie question - deleting records from anydbm database

2005-12-15 Thread Dan M
>> Now how can I go about deleting that record when it's too old? >> > (untested) > > try > > del db[ipAddress] Yep, that did it. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Overlapping Regular Expression Matches With findall()

2005-12-15 Thread Mystilleef
Hello, Is there a simple flag to set to allow overlapping matches for the findall() regular expression method? In other words, if a string contains five occurrences of the string pattern "cat", calling findall on the string returns a list containing five "cat" strings. Is it possible for findall()

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread bonono
Steve Holden wrote: > This would have the unfortunate side effect of only allowing changes to > Python that allowed users to do things which are currently impossible. > > Since Python is Turing-complete, this would effectively inhibit all > further changes to the language. I don't quote understand

Re: SVG rendering with Python

2005-12-15 Thread Andreas Lobinger
Aloha, richard wrote: > Dennis Benzinger wrote: >>Does anybody know of a SVG rendering library for Python? > Google "python svg" ... to find what? Whishing a happy day LOBI -- http://mail.python.org/mailman/listinfo/python-list

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread bonono
Terry Hancock wrote: > But that is precisely what it does mean -- Python's language > design tries to be "reasonably minimal": there's usually one > fairly easy way to do a task. Unintentionally, there may > well be a half-dozen really hard ways to do it. The point of > telling this to the potenti

Re: How to get the local mac address?

2005-12-15 Thread Grant Edwards
On 2005-12-15, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Why should you want to associate a MAC address with a socket? Each interface has an IP address, and it's that you should be using. >>> >>> Say for example I want to find out the MAC if a particular >>> interface in python. >> >> W

Re: How to get the local mac address?

2005-12-15 Thread Grant Edwards
On 2005-12-15, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >>Why should you want to associate a MAC address with a socket? Each >>interface has an IP address, and it's that you should be using. > >Say for example I want to find out the MAC if a particular interface in >python.

Re: Which Python web framework is most like Ruby on Rails?

2005-12-15 Thread gene tani
Ben Sizer wrote: > Mike Meyer wrote: > > [Not sure if this attribution is correct.] > > > Alex Martelli wrote: > > > Because of course if other languages have 1 or two frameworks, python > > > needs a dozen. > > woops, that attribution is absolutely *wrong*, DH said that, sorry Alex -- http://m

Re: How to get the local mac address?

2005-12-15 Thread bonono
Grant Edwards wrote: > On 2005-12-15, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Why should you want to associate a MAC address with a socket? Each > interface has an IP address, and it's that you should be using. > >>> > >>> Say for example I want to find out the MAC if a particular

Re: How to get the local mac address?

2005-12-15 Thread bonono
Grant Edwards wrote: > > you can read my temper from what I write ? > > If not, then you should be more careful what you write. > such as ? -- http://mail.python.org/mailman/listinfo/python-list

Re: "0 in [True,False]" returns True

2005-12-15 Thread Grant Edwards
On 2005-12-15, Antoon Pardon <[EMAIL PROTECTED]> wrote: > Or return NaN instead of raising exception for numeric > functions ? Because usually (in my applications anyway) NaN is a perfectly valid value and not an "exception" case that needs to be handled. >>> >>> I don'

Re: Which Python web framework is most like Ruby on Rails?

2005-12-15 Thread gene tani
Ben Sizer wrote: > Mike Meyer wrote: > > [Not sure if this attribution is correct.] > > > Alex Martelli wrote: > > > Because of course if other languages have 1 or two frameworks, python > > > needs a dozen. > > > > People keep talking about Python's wealth of web frameworks as if it > > were a ba

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Ben Sizer
Steve Holden wrote: > Would you, say, remove "for" loops because they could be written as > "while" loops. Don't forget the word "obvious" that appears in that > catchphrase ... Interestingly - and somewhat related to this - the other day I was looking for a do..while or do..until loop in the Pyt

Re: OO in Python? ^^

2005-12-15 Thread Antoon Pardon
Op 2005-12-15, Ben Sizer schreef <[EMAIL PROTECTED]>: > > Antoon Pardon wrote: >> Op 2005-12-15, Ben Sizer schreef <[EMAIL PROTECTED]>: > >> So? I answered a question. That my answer is not usefull for >> a specific purpose is very well prosible but is AFAIC irrelevant. > > The point being made was

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Steve Holden
Chris Mellon wrote: [...] > (Am I dating myself? ...) > Do we need to know about your love life here? Are you hermaphroditic? If not the relationship will never go anywhere. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Steve Holden wrote: > >>This would have the unfortunate side effect of only allowing changes to >>Python that allowed users to do things which are currently impossible. >> >>Since Python is Turing-complete, this would effectively inhibit all >>further changes to the lang

tkinter: drop-down widget

2005-12-15 Thread Alex Hunsley
Can anyone recommend some code for creating drop-down menus in tkinter? To be absolutely clear, here's an example of a drop-down: http://www.google.co.uk/preferences?hl=en (see the language selection widget) I've found the odd bit of code here and there, such as: http://infohost.nmt.edu/tcc/cgi/p

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread jmdeschamps
Yes, a shared preferred way. And the same is true of many... Think Haskell, OCaml, Lua, Ruby, Lisp, Smalltalk, Java, C... They all have qualities of some sort, that appeal to some of us. Not all the same, nor to all of us. It's really a question of perspective. In this Python community, one shared

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Gerard Flanagan
Tolga wrote: > As far as I know, Perl is known as "there are many ways to do > something" and Python is known as "there is only one way". Could you > please explain this? How is this possible and is it *really* a good > concept? Yes it is a good concept because you can concentrate on Strategy rat

Re: Python packages on OS X vs Windows

2005-12-15 Thread Kevin Walzer
Kenneth McDonald wrote: > At the moment I'm doing most of my stuff on a Mac, but I've been > considering also getting > a Windows laptop. One of the reasons is that I've found it very > difficult to get certain > Python related things running on the Mac; for example, if one wants to > use the most

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread bonono
Steve Holden wrote: > This would have the unfortunate side effect of only allowing changes to > Python that allowed users to do things which are currently impossible. > > Since Python is Turing-complete, this would effectively inhibit all > further changes to the language. I don't quote understand

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread bonono
Steve Holden wrote: > It says that Python is already adequately expressive to allow it to > solve all solvable problems: more briefly, "Python can already do > everything". Hence there is no need to change the language. > > Of course I use this as a /reductio ad absurdum/ to try to show you the >

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Steve Holden
Ben Sizer wrote: > Steve Holden wrote: > > >>Would you, say, remove "for" loops because they could be written as >>"while" loops. Don't forget the word "obvious" that appears in that >>catchphrase ... > > > Interestingly - and somewhat related to this - the other day I was > looking for a do..w

Haskell Typeclasses (was Re: OO in Python? ^^)

2005-12-15 Thread Aahz
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: > >Right, you can get good genericity with Haskell's typeclasses (I've >posted about that often in the past, and desperately and so far >unsuccessfully tried to convince Guido to use something close to >typeclasses rather than

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Carl J. Van Arsdall
[EMAIL PROTECTED] wrote: > Would you, say, remove "for" loops because they could be written as "while" loops. Don't forget the word "obvious" that appears in that catchphrase ... >>> If every "for" usage can be done with "while" and that "while" is the >>> prefe

Re: tkinter: drop-down widget

2005-12-15 Thread Alex Hunsley
Alex Hunsley wrote: > Can anyone recommend some code for creating drop-down menus in tkinter? > To be absolutely clear, here's an example of a drop-down: > > http://www.google.co.uk/preferences?hl=en > (see the language selection widget) > > I've found the odd bit of code here and there, such as:

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Aahz
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: > >(Part of) Python's credo (which you can read in context by typing > > import this > >at an interactive command prompt) is "There should be one (and >preferably only one) way to do it". Actually, I've gotten used to do

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Richie Hindle
[Steve] > Since Python is Turing-complete Is there some equivalent of Godwin's Law that we can invoke at this point? 8-) -- Richie Hindle [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Xavier Morel
Aahz wrote: > In article <[EMAIL PROTECTED]>, > Steve Holden <[EMAIL PROTECTED]> wrote: >> (Part of) Python's credo (which you can read in context by typing >> >> import this >> >> at an interactive command prompt) is "There should be one (and >> preferably only one) way to do it". > > Actua

Re: Python packages on OS X vs Windows

2005-12-15 Thread BartlebyScrivener
Mike, I nosed around after reading the posts herein. Have you heard of monad, the new Windows Command Shell in beta? http://www.microsoft.com/downloads/details.aspx?FamilyID=2ac59b30-5a44-4782-b0b7-79fe2efd1280&DisplayLang=en http://en.wikipedia.org/wiki/MSH_(shell) Or a better article: http:/

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread bonono
Carl J. Van Arsdall wrote: > Although, obvious to whom is a good question. If you don't know the > language very little will be obvious to you, however one who is familiar > with python (rtfm) would know which cases should obviously use "while" > and which cases should obviously use "for" > So fa

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Steve Holden
Aahz wrote: > In article <[EMAIL PROTECTED]>, > Steve Holden <[EMAIL PROTECTED]> wrote: > >>(Part of) Python's credo (which you can read in context by typing >> >>import this >> >>at an interactive command prompt) is "There should be one (and >>preferably only one) way to do it". > > > Act

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread bonono
Steve Holden wrote: > This would have the unfortunate side effect of only allowing changes to > Python that allowed users to do things which are currently impossible. > > Since Python is Turing-complete, this would effectively inhibit all > further changes to the language. I don't quite understand

Re: Python packages on OS X vs Windows

2005-12-15 Thread Kevin Walzer
Re: package installers: I misspoke. The address for them is http://pythonmac.org/packages/ -- Cheers, Kevin Walzer, PhD WordTech Software - "Tame the Terminal" http://www.wordtech-software.com sw at wordtech-software.com -- http://mail.python.org/mailman/listinfo/python-list

newbie to python

2005-12-15 Thread exter_c
Hello, How do I find out what modules have been included in my python install? I am having issues with crypt functions not working on ubuntu or redhat but they work on Slackware. Any assistance would be great. Regards, Johhny. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Simon Brunning
On 12/15/05, Steve Holden <[EMAIL PROTECTED]> wrote: > Aahz wrote: > > python -c 'import this' > > Faster: > >python -m this So, there's two ways to do it. ;-) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/pyth

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Rocco Moretti
[EMAIL PROTECTED] wrote: > Chris Mellon wrote: > >>Any time you want to write something in any way other than the obvious >>way, ask yourself why? Is it more obvious *to you*, which is a good >>reason as long as you're only writing code for yourself? Or is it just >>to be different, or because you

Re: Binary representation of floating point numbers

2005-12-15 Thread Torsten Bronger
Hallöchen! Sorry for the late response, but the subject didn't catch my attention ... Mike Meyer <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] writes: > >> In float mode, the instrument returns a sequence of bits that are >> exactly the ieee754 number in the case of floats, or just the >> flag

Re: Python packages on OS X vs Windows

2005-12-15 Thread gene tani
Kenneth McDonald wrote: > At the moment I'm doing most of my stuff on a Mac, but I've been > considering also getting > a Windows laptop. One of the reasons is that I've found it very > difficult to get certain > Python related things running on the Mac; for example, if one wants > to use the most

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Brian Cully
[EMAIL PROTECTED] wrote: > C-programmer learning python : > > Hi, where is condition ? true : false > > someone prefer the if/else statement type: > > Can't you see that the following is much more readable, stupid(well not > the exact word but tone in such a way like words of messy or elegant > et

Re: How to get the local mac address?

2005-12-15 Thread mwilliams
Well, that kinda depends on what you want the MAC Address of. Personally (on Unix systems) I simply read from a popen('ifconfig') and use a regular expression to parse out the mac address. Works perfectly. Just my 2¢, Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: ?: in Python

2005-12-15 Thread Dave Hansen
On Wed, 14 Dec 2005 21:16:23 +0100 in comp.lang.python, Lawrence Oluyede <[EMAIL PROTECTED]> wrote: >Il 2005-12-14, Andy Leszczynski <[EMAIL PROTECTED]> ha scritto: >> How can do elegantly in Python: >> >> if condition: >> a=1 >> else: >> a=2 >> >> like in C: >> >> a=condition?1:2 >> > >Th

Re: newbie to python

2005-12-15 Thread Lawrence Oluyede
Il 2005-12-15, [EMAIL PROTECTED] <[EMAIL PROTECTED]> ha scritto: > How do I find out what modules have been included in my python install? Look in site-packages directory > I am having issues with crypt functions not working on ubuntu or redhat > but they work on Slackware. Crypt functions? Are

Re: OO in Python? ^^

2005-12-15 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: ... > > [protocol adaptation]); it's the state of _templates_ in Haskell, > > specifically, which I was rather dubious about (it may be that I just > > haven't dug into them deep enough yet, but they do seem not a little > > "convoluted" to me, so far). > > > Yup, the

Re: Which Python web framework is most like Ruby on Rails?

2005-12-15 Thread Alex Martelli
gene tani <[EMAIL PROTECTED]> wrote: > Ben Sizer wrote: > > Mike Meyer wrote: > > > [Not sure if this attribution is correct.] > > > > Alex Martelli wrote: > > > > Because of course if other languages have 1 or two frameworks, python > > > > needs a dozen. > > woops, that attribution is absolutel

Re: Haskell Typeclasses

2005-12-15 Thread Alex Martelli
Aahz <[EMAIL PROTECTED]> wrote: ... > Hrm. I don't recall anything about typeclasses, so my suspicion is that > you were writing something lengthy and above my head. Can you write > something reasonably short about it? (I'm asking partly for your > benefit, because if it makes sense to me, th

Re: Optimize function similiar to dict.update() but adds common values

2005-12-15 Thread Christopher Subich
Peter Otten wrote: > > def add_freqs3(freq1, freq2): > total = dict(freq1) > for key, value in freq2.iteritems(): > try: > total[key] += value > except KeyError: > total[key] = value > return total > Untested, but replacing the try/except pair

Re: Optimize function similiar to dict.update() but adds common values

2005-12-15 Thread bonono
Christopher Subich wrote: > Peter Otten wrote: > > > > def add_freqs3(freq1, freq2): > > total = dict(freq1) > > for key, value in freq2.iteritems(): > > try: > > total[key] += value > > except KeyError: > > total[key] = value > > return total >

  1   2   3   >