Re: How to test if two strings point to the same file or directory?

2006-12-16 Thread Sandra-24
On Dec 16, 8:30 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sat, 16 Dec 2006 17:02:04 -0800, Sandra-24 wrote: > > Comparing file system paths as strings is very brittle.Why do you say that? > > Are you thinking of something like this? > > /home//user/somedirectory/../file > /home/user/file

Re: How to test if two strings point to the same file or directory?

2006-12-16 Thread John Machin
Tim Chase wrote: > >>> Comparing file system paths as strings is very brittle. Is there a > >>> better way to test if two paths point to the same file or directory > >>> (and that will work across platforms?) > >>os.path.samefile(filename1, filename2) > >>os.path.sameopenfile(fileobject1,

Re: Has comparison of instancemethods changed between python 2.5 and 2.4?

2006-12-16 Thread Carl Banks
Frank Niessink wrote: > Ziga Seilnacht: > > This method was changed in Python 2.5. Previously, two instancemethods > > compared equal if their im_self attributes were *identical* and their > > im_func attributes were equal. Now, they compare equal if their im_self > > attributes are *equal* and the

Re: merits of Lisp vs Python

2006-12-16 Thread John Thingstad
On Sun, 17 Dec 2006 00:19:40 +0100, > wrote: > > Incorrect, I believe. The above is like saying Lisp's lack of > optional manual storage allocation and machine pointers makes Lisp > less powerful. It's in fact the absence of those features that lets > garbage collection work reliably. Reliable

Re: wxPython help please

2006-12-16 Thread Sandra-24
On Dec 16, 8:43 pm, Jive Dadson <[EMAIL PROTECTED]> wrote: >I bought the ebook. Searching for "pixel", all I came up with was a > method called GetPixel in a "device context." I know there must be a > device context buried in there somewhere, so now I need to winkle it out. You are right that yo

Re: Is there a way to push data into Microsoft Oulook from Python ?

2006-12-16 Thread Gabriel Genellina
On 16 dic, 17:39, "The Night Blogger" <[EMAIL PROTECTED]> wrote: > Is there a way to pull & push data (Tasks, Notes, Calendar Items ...) into > Microsoft Oulook from Python ? You will need the pywin32 package. Then you get the Outlook Application object using: import win32com.client Outlook = w

Re: Good Looking UI for a stand alone application

2006-12-16 Thread Sandra-24
On 12/16/06, The Night Blogger <[EMAIL PROTECTED]> wrote: > Can someone recommend me a good API for writing a sexy looking (Rich UI like > WinForms) shrink wrap application > My requirement is that the application needs to look as good on Windows as > on the Apple Mac wxPython or something layere

Re: module wide metaclass for new style classes

2006-12-16 Thread Gabriel Genellina
On 16 dic, 14:44, "Daniel Nogradi" <[EMAIL PROTECTED]> wrote: > I used to have the following code to collect all (old style) class > names defined in the current module to a list called reg: > > def meta( reg ): > def _meta( name, bases, dictionary ): > reg.append( name ) > return

Smarter way to do this? Unicode + stdin, stdout

2006-12-16 Thread BenjaMinster
I want to read and write unicode on stdin and stdout. I can't seem to find any way to force sys.stdin.encoding and sys.stdout.encoding to be utf-8, so I've got the following workaround: import codecs, sys out = codecs.getwriter("utf-8")(sys.stdout) def tricky(): return sys.stdin.readline().decod

Re: How to test if two strings point to the same file or directory?

2006-12-16 Thread Leif K-Brooks
Tim Chase wrote: >>> Comparing file system paths as strings is very brittle. >> >> Why do you say that? Are you thinking of something like this? >> >> /home//user/somedirectory/../file >> /home/user/file > > Or even > > ~/file ~ is interpreted as "my home directory" by the shell, but when it

Re: How to test if two strings point to the same file or directory?

2006-12-16 Thread Erik Max Francis
Leif K-Brooks wrote: > ~ is interpreted as "my home directory" by the shell, but when it's used > in a path, it has no special meaning. open('~/foo.txt') tries to open a > file called foo.txt in a subdirectory of the current directory called '~'. That's what os.path.expanduser is for. -- Erik

Re: textwrap.dedent replaces tabs?

2006-12-16 Thread Tom Plunket
CakeProphet wrote: > Hmmm... a quick fix might be to temporarily replace all tab characters > with another, relatively unused control character. > > MyString = MyString.replace("\t", chr(1)) > MyString = textwrap.dedent(MyString) > MyString = MyString.replace(chr(1), "\t") > > Of course... this

OT : Bug/Issue tracking systems

2006-12-16 Thread moogyd
Hi, (Off-topic) I am looking to put an open-source bug/issue tracking system in place for our current project (eventually expanded for all projects), and would appreciate any experiences/comments/suggestions. Note the project is encompasses embedded hardware (ASIC plus firmware) plus application

Re: How to test if two strings point to the same file or directory?

2006-12-16 Thread John Nagle
Sandra-24 wrote: > Comparing file system paths as strings is very brittle. Is there a > better way to test if two paths point to the same file or directory > (and that will work across platforms?) No. There are ways to do it for many operating systems, but there is no system-independent

Re: tuple.index()

2006-12-16 Thread greg
Nick Maclaren wrote: > A collection is inhomogeneous if, for some attribute that is needed > for at least one action on at least one element of the collection, > the attribute is not shared by all elements of the collection. If you mean "attribute" in the Python sense, then this is wr

Re: merits of Lisp vs Python

2006-12-16 Thread Bill Atkins
greg <[EMAIL PROTECTED]> writes: > Ken Tilton wrote: > >> McCarthy: "Is code also data in Python?" >> Norvig: "No." > > I don't think that was the right answer. He should have > said "Yes", and then shown McCarthy eval() and exec. > > Code isn't quite as *convenient* to work with as data > in Pyth

Re: merits of Lisp vs Python

2006-12-16 Thread Bill Atkins
greg <[EMAIL PROTECTED]> writes: > André Thieme wrote: >> (aif (timeConsumingCalculation) >> (use it)) > > I think the answer is that you just wouldn't do > that in Python at all. Having magic variables > spring into existence in your local namespace > as a side effect of calling something i

<    1   2