Re: One class per file?

2008-10-04 Thread Tony Meyer
[HCB] The book "Code Complete" recommends that you put only one class in a source file, which seems a bit extreme for me. IMO this is a misunderstanding (by the author). In Python, a file is not equivalent to a class, it is equivalent to a module. A module might contain a single class or

Re: Regex doesn't support MULTILINE?

2007-07-21 Thread Tony Meyer
newline; without this flag, "." will match anything except a newline. """ If you do a lot of working with regular expressions, then I highly recommend Kodos (http://kodos.sourceforge.net) as a tool for interactively figuring out issues. Cheers, Tony Meyer -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.5.1 broken os.stat module

2007-05-31 Thread Tony Meyer
On Jun 1, 9:16 am, "Joe Salmeri" <[EMAIL PROTECTED]> wrote: > I just upgraded from Python 2.4.2 to Python 2.5.1 and have found some > unexpected behavior that appears to be a bug in the os.stat module. Have you read this thread? http://groups.google.com/group/comp.lang.python/browse_thread/thread

Re: Accessing iTunes with Python via the Windows SDK

2007-05-23 Thread Tony Meyer
On May 24, 4:23 pm, Denrael <[EMAIL PROTECTED]> wrote: > I've been playing with the iTunes sdk on windows, and have come across > a strange problem. With the following code: > > import win32com.client > iTunes = win32com.client.gencache.EnsureDispatch("iTunes.Application") > curr = iTunes.CurrentT

Re: getmtime differs between Py2.5 and Py2.4

2007-05-07 Thread Tony Meyer
On May 8, 10:15 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > that you are mistaken: There is NO difference between the outcome > of os.path.getmtime between Py2.5 and Py2.4. It always did return > UTC, and always will. In revision 42230, you checked in a change to posixmodule.c with the foll

Re: How to upgrade python from 2.4.3 to 2.4.4 ?

2006-10-22 Thread Tony Meyer
> At the moment SourceForge is only listing one (UK) mirror for > mingw, and > that seems to be down. I'm guessing something is broken, since I > know it > used to be much more widely available. Only one mirror (Kent) is available for any project. It's been like this for nearly a day now, a

Re: howto py2exe/py2app for self updating application

2006-04-22 Thread Tony Meyer
> I'm creating a GUI program > with wxPython which will be distributed for Mac and Windows. [...] > The program should be able to update itself [...] By default, py2exe puts all the .pyc files used in a zip file. The simplest way to do this it let py2exe do what it normally does. Code all o

Re: email package 4.0a2

2006-03-16 Thread Tony Meyer
[Barry Warsaw] >> I'm happy to announce the release of the email 4.0a2 standalone >> package. [Konrad Hinsen] > My interpretation of the above paragraph is that it will be > impossible to write Python code using the email module (and possibly > other evolving modules) that works with both Python 2

python-dev Summary for 2006-01-01 through 2006-01-15

2006-02-01 Thread Tony Meyer
itted a patch`_ that orders the output so that doctest output can be easily reliable. He pointed out that there is `another open patch`_ that allows the user to specify the order through an "ordered dictionary". Guido explained that he didn't feel that it mattered, as long as the

Re: beta.python.org content

2006-01-26 Thread Tony Meyer
> - The logo does indeed resemble a cross. How about rotating it at > 45 deg >to make it look like an x? Or give it a circular shape? Please note >that there are no religious motives in this remark :) -1. Then what are the motives? A rotated cross looks a lot less clean. Take a look

Re: New Python.org website?

2006-01-22 Thread Tony Meyer
>> But sheesh, if I objected to every picture of the moon I >> see (or pictures that vaguely resemble a moon), I would be >> in a very sad state. > > But you see Terry, the point is not that it is just a picture. And > let's not forget that as far as we know the moon has always been a > natural par

python-dev Summary for 2005-12-01 through 2005-12-15

2006-01-19 Thread Tony Meyer
/058784.html>`__ - `patch tracker ping: cross compile and mingw support <http://mail.python.org/pipermail/python-dev/2005-December/058803.html>`__ - `Needed tester for patch in urllib.py module <http://mail.python.org/pipermail/python-dev/2005-December/058817.html>`__ Epilo

python-dev Summary for 2005-12-16 through 2005-12-31

2006-01-19 Thread Tony Meyer
r/059195.html>`__ - `set.copy documentation string <http://mail.python.org/pipermail/python-dev/2005-December/059222.html>`__ - `Bug in Py_InitModule4 <http://mail.python.org/pipermail/python-dev/2005-December/059272.html>`__ - `floating point literals don't work in non-USlocale in 2.5 <

Re: another docs problem - imp

2006-01-09 Thread Tony Meyer
[EMAIL PROTECTED] > Another Python docs problem... > > I was trying to use imp.find_module(). > [...] > I saw not a hint of this in the docs. In fact > they seem to say that the first (unworking) > form *should* work. Bye bye about two > hours altogether... > > I thought I would post this and ho

python-dev Summary for 2005-11-16 through 2005-11-30

2006-01-01 Thread Tony Meyer
logue This is a summary of traffic on the `python-dev mailing list`_ from November 16, 2005 through November 30, 2005. It is intended to inform the wider Python community of on-going developments on the list on a semi-monthly basis. An archive_ of previous summaries is available online.

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

2005-12-05 Thread Tony Meyer
> Well, I was running Python-2.4.1 so I upgraded to 2.4.2 and guess > what? The docs still reference the old Howto. Perhaps you meant > to say "will be fixed in 2.5" rather than "has been fixed"? No, I meant has been fixed. A fixed version hasn't been released, but that doesn't make it any le

Re: Bitching about the documentation...

2005-12-04 Thread Tony Meyer
> But, the standard responce of "don't complain, fix it yourself" is > bogus too. There are plenty of people on this list willing to sing > python's > praises, for balance, there should be people willing to openly > point out > python's flaws. This makes no sense. If you want to complain abo

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

2005-12-04 Thread Tony Meyer
>> It's "site:", but even if you just left that out and used >> 'wiki.python.org sorting "how to"', the first link is the one you're >> after. Laziness is no excuse. > > You miss my point. Having outdated documentaion distributed > with Python is the problem. Have some newer stuff out on some >

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

2005-12-04 Thread Tony Meyer
Among the treasures available in The Wiki is the current copy of "the Sorting min-howto": http://www.amk.ca/python/howto/sorting/sorting.html >>> >>> Why is this a "treasure" when it is way out of date? >> >> Note that the updated version of this is at: http://wiki.py

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

2005-12-04 Thread Tony Meyer
>> Among the treasures available in The Wiki is the current >> copy of "the Sorting min-howto": >> http://www.amk.ca/python/howto/sorting/sorting.html > > Why is this a "treasure" when it is way out of date? Note that the updated version of this is at: http://wiki.python.org/ moin

Re: os.rename copies when old is in-use - is this deliberate?

2005-12-03 Thread Tony Meyer
[Tony Meyer] >> Is this the intended behaviour? > [Martin v. Löwis] > Sort-of. os.rename invokes the C library's rename, and does whatever > this does. It is expected that most platform's C libraries do what > the documentation says rename does, but platforms may vary

os.rename copies when old is in-use - is this deliberate?

2005-12-03 Thread Tony Meyer
On Windows, if I do os.rename(old, new) where old is a file that is in-use (e.g. python itself, or a dll that is loaded), I would expect that an error would be raised (e.g. as when os.remove is called with an in-use file). However, what happens is that a copy of the file is made, and the old file

python-dev Summary for 2005-10-01 through 2005-10-15

2005-11-21 Thread Tony Meyer
2005 through October 15, 2005. It is intended to inform the wider Python community of on-goingdevelopments on the list on a semi-monthly basis.  An archive_ ofprevious summaries is available online.An `RSS feed`_ of the titles of the summaries is available. You can also watch comp.lang.python or co

Re: python-dev summary

2005-11-17 Thread Tony Meyer
On 17/11/2005, at 7:20 PM, Titus Brown wrote: >> [The HTML version of this Summary is available at >> http://www.python.org/dev/summary/2005-09-01_2005-09-15.html] > > no... no, it's not ;) Sorry; I should amend the copy that's posted to say "will be available". The summaries get posted here,

python-dev Summary for 2005-09-01 to 2005-09-15

2005-11-16 Thread Tony Meyer
1.165.2.2 `__ - `Variant of removing GIL. <http://mail.python.org/pipermail/python- dev/2005-September/056423.html>`__ - `Compatibility between Python 2.3.x and Python 2.4.x `__ - `Example for "property" violates "Python is not a one pass compiler" <http://mail.py

Re: [OT] Re: output from external commands

2005-10-24 Thread Tony Meyer
On 25/10/2005, at 3:36 PM, Steven Bethard wrote: > I wouldn't fret too much about a sharp remark from Fredrik Lundh. > They're pretty much all that way. ;) [...] It takes a little > training to get used to > him, but if you can look past the nasty bite, he's really a valuable > resource around h

Re: A Moronicity of Guido van Rossum

2005-09-30 Thread Tony Meyer
On 30/09/2005, at 10:56 PM, Gerrit Holl wrote: > Tony Meyer wrote: > >> X-Spambayes-Classification: ham; 0.048 >> X-Spambayes-Evidence: '*H*': 0.90; '*S*': 0.00; 'bug.': 0.07; >> 'flagged': 0.07; >> "i'd&quo

Re: A Moronicity of Guido van Rossum

2005-09-29 Thread Tony Meyer
> I know nobody wants to do add "white/black-listing", so we can do it > probabilistically. In case it is not obvious, mailings with the words > "jargon" or "moron" and their derrivatives should be flagged as 99.9% > probability for Moronicity Xha Lee, Jargonizer, spam. If spam bayes > can't > fi

Re: A Moronicity of Guido van Rossum

2005-09-29 Thread Tony Meyer
On 30/09/2005, at 9:50 AM, Delaney, Timothy (Tim) wrote: > You have to admit though, he's remarkably good at getting past > Spambayes. Despite classifying *every* Xah Lee post as spam, he still > manages to get most of his posts classified as 0% or 1% spam. I can't believe that people are using c

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Tony Meyer
On 29/09/2005, at 3:45 AM, Fredrik Lundh wrote: > Tony Meyer wrote: > >>> I thought about it, but I didn't mention it in the end because this >>> feature ("name mangling") isn't intended as a mechanism for making >>> things private - it

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Tony Meyer
On 28/09/2005, at 11:55 PM, Simon Brunning wrote: > On 9/28/05, Tony Meyer <[EMAIL PROTECTED]> wrote: > >> I'm not sure why I haven't seen this mentioned yet, but a leading >> double-underscore does really make a member private: >> > > I though

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Tony Meyer
On 28/09/2005, at 11:54 PM, Paul Rubin wrote: > Tony Meyer <[EMAIL PROTECTED]> writes: > >> I'm not sure why I haven't seen this mentioned yet, but a leading >> double-underscore does really make a member private:... >> As you see, it's there in the

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Tony Meyer
On 28/09/2005, at 11:05 PM, Simon Brunning wrote: > On 9/28/05, could ildg <[EMAIL PROTECTED]> wrote: > >> Python is wonderful except that it has no real private and protected >> properties and methods. >> Every py object has dict so that you can easily find what fields >> and methods >> an obj

Re: PEP 350: Codetags

2005-09-26 Thread Tony Meyer
On 27/09/2005, at 12:21 PM, Paul Rubin wrote: > Neil Hodgson <[EMAIL PROTECTED]> writes: > >> The PEP system allows for the documentation of a convention as an >> "Informational PEP". Documenting conventions is useful. > > If the preferred method of doing something is > consistent enough that

Re: py2app without a mac?

2005-09-13 Thread Tony Meyer
> I don't want to require the users to have python installed so I > don't think distutils would work here. Recent versions of OS X include Python - there's a pretty good chance that the users have Python already, so you could possibly use distutils after all. =Tony.Meyer -- http://mail.pyt

RE: To the python-list moderator

2005-09-02 Thread Tony Meyer
> What still puzzles me is why the spamblocker that embargoed > me and others did not catch such obvious spam as Subject: Re: > The penis is way too delicate for masturbation (and occasional > others like this). I know nothing about how spambayes is setup for python-list, but my guess would be

RE: SpamBayes wins PCW Editors Choice Award for anti-spam software.

2005-08-31 Thread Tony Meyer
> IMHO, there is a great opportunity here for the python community: [...] > Surely that's worth a simple team name, for mnemonic purposes > if nothing else. Something different or unusual, like one of my > favourites, "Legion of the Bouncy Castle", who are a group of Java > cryptography dudes I

RE: SpamBayes wins PCW Editors Choice Award for anti-spam software.

2005-08-31 Thread Tony Meyer
> While it may not adequately credit the implementation > language, Was this "it" the PCW article or SpamBayes? If the latter, please let spambayes-dev@python.org know how you think Python should be more appropriately credited; we are certainly trying to do this. (Python is mentioned all over t

python-dev Summary for 2005-08-01 through 2005-08-15

2005-08-29 Thread Tony Meyer
on a semi-monthly basis. An archive_ of previous summaries is available online. An `RSS feed`_ of the titles of the summaries is available. You can also watch comp.lang.python or comp.lang.python.announce for new summaries (or through their email gateways of python-list or python-announce, res

python-dev Summary for 2005-07-16 through 2005-07-31

2005-08-20 Thread Tony Meyer
ity of on-going developments on the list on a semi-monthly basis. An archive_ of previous summaries is available online. An `RSS feed`_ of the titles of the summaries is available. You can also watch comp.lang.python or comp.lang.python.announce for new summaries (or through their email gateways of

RE: rfc822 module bug?

2005-08-01 Thread Tony Meyer
[rfc822 module bug] >> Date: Tue,26 Jul 2005 13:14:27 GMT +0200 >> >> It seems to be correct¹, but parsedate_tz is not able to >> decode it, it is confused by the absence of a space after >> the ",". [...] > I think I'll submit this bug on the Python web-site. Please don't. The rfc822 module is

RE: [path-PEP] Path inherits from basestring again

2005-07-31 Thread Tony Meyer
> Above all, nobody can tell me that there's any programmer who > doesn't instantly recognize '/' as a directory separator. There is a programmer who doesn't instantly recognise '/' as a directory separator. I teach programming. The above is true. I think that the statement "any programmer wou

RE: [path-PEP] Path inherits from basestring again

2005-07-31 Thread Tony Meyer
> While people are loathe to admit it, many stereotypes have > some basis in fact. The problem is when people extend that to generalize > about others (especially in a negative way). The intent was to use the basis-in-fact stereotype without having to explain in detail the factual basis, which

RE: [path-PEP] Path inherits from basestring again

2005-07-31 Thread Tony Meyer
>> I agree. It's yuck. > > So don't use it. If it were that simple, I wouldn't have bothered bringing it up. I really do believe this is a case of "There should be one-- and preferably only one --obvious way to do it" (as well as "Explicit is better than implicit" and "Readability counts"). If

RE: [path-PEP] Path inherits from basestring again

2005-07-31 Thread Tony Meyer
> Is classic Macintosh OS still supported on Python? No. At least, AFAIK, there is no intent to produce packages of new Python versions for Mac pre OS X. Old versions of Python still work, of course, but whatever version of Path makes it into Python (if any) is extremely unlikely to be supported

RE: [path-PEP] Path inherits from basestring again

2005-07-31 Thread Tony Meyer
> Yes, I read and understood it. Saying "Don't read this if > you don't want to be offended" doesn't make an offensive > statement inoffensive. No, but it makes complaining that it was offensive pointless. > I grant that Python is much easier to learn than other > programming languages; stude

RE: [path-PEP] Path inherits from basestring again

2005-07-29 Thread Tony Meyer
>> (Those who are offended by sweeping generalisations should >> ignore this next bit) [...generalisation bit snipped...] > This is not only bullshit, it's elitist bullshit. "Windows users are > more clueless than users of posix systems." Pfui. Prove it > or withdraw it. Sigh. I guess you di

RE: [path-PEP] Path inherits from basestring again

2005-07-29 Thread Tony Meyer
> We're talking at this point about how Path should work, not > whether it's preferable to os.path.join, even though that was > really the point of Reinhard's original post. That's not what I'm talking about. I'm talking about whether __div__ should be a shortcut to joinwith, or whether users sh

RE: Ten Essential Development Practices

2005-07-28 Thread Tony Meyer
[Robert Kern] > Sure, and I can find programming advice in the Old Testament, > too, if I try hard enough [...] > Proverbs 28:14 JPS "Happy is the man that feareth alway; > but he that hardeneth his heart shall fall into evil." > Obviously an exhortation to not ignore raised exceptions with > "ex

RE: [path-PEP] Path inherits from basestring again

2005-07-28 Thread Tony Meyer
> Well, I actually had some correspondence with Jason on this > very subject a year or so ago: [...] > Obviously, I don't know how much weight Jason's original > ideas have on the prepped-for-syslib module, but it does > support what other people have been saying: that the Path > should behave

RE: [path-PEP] Path inherits from basestring again

2005-07-28 Thread Tony Meyer
[using __div__ to mean join] > I'm not too happy with it, too, but do we have alternatives? > As paths are strings, we can hardly override the '+' operator, > so there's not much operators left. > > Of course, one can use joinwith() if he doesn't like '/'. My argument is that the alternative is

RE: [path-PEP] Path inherits from basestring again

2005-07-28 Thread Tony Meyer
> I, herewith, claim to have used it in the past. > > But I am indifferent as to if its needed, it just looks natural to me. So far there seem to have been a few +0s, but no +1s... > What I use quite often is:: > >path(__file__).dirname() / "somesiblingfileiknowisthere" > > you do not have

RE: [path-PEP] Path inherits from basestring again

2005-07-28 Thread Tony Meyer
> def functions_which_modifies_some_file_in_place(path): > output = open(path+'.tmp', 'w') > . > > I dont want a seperator inserted between path and the new extension. Fair enough. Forget using '+' for join, then (which I was never that keen on - TIOWTDI), but I'm still -1 on using '/' for

RE: [path-PEP] Path inherits from basestring again

2005-07-24 Thread Tony Meyer
[...] > Open issues: [...] > What about path * 4? If you keep the current join meaning of __div__, then assigning any sort of multiplication meaning to __mul__ would not be a good idea, IMO. It's natural to expect that __div__ and __mul__ are opposites. I suppose this means that you could make _

RE: Thoughts on Guido's ITC audio interview

2005-07-07 Thread Tony Meyer
> "Java" as a term means different things to different people, Agreed. Python is similar in this respect - it's common to refer to cPython here as Python, for example. > but I expect most would think of the core language and its > standard library first and the JRE/JVM second. So saying "the

RE: Thoughts on Guido's ITC audio interview

2005-07-07 Thread Tony Meyer
> Your first sentence contradicts the rest of your post; how is > Java the problem if it runs nice on a Mac and is sluggish on > Windows ? Because any Java program on (any version of) Windows (in my experience) is sluggish, and this is not true (again, in my experience) for Java programs on a Ma

RE: Thoughts on Guido's ITC audio interview

2005-07-07 Thread Tony Meyer
> Everyone complaining about Eclipse in this thread needs to go > try 3.1. The interface is much much much more responsive. The problem with Eclipse, IMO, is Java. I've tried 3.1 on a WinXP machine and, like just about any Java program, it's incredibly slow and a real pain to use. On a (similar

RE: Do a "Python beginners e-mail list" exist?

2005-07-07 Thread Tony Meyer
> 1. I don't want to post banal questions about Python > to main Python list. Does a "banal Python questions > list" or a "Python beginners list" exist? Yes: There are plenty of people there that will be glad to help! =Tony.Meyer -- http://mail.

RE: Modules for inclusion in standard library?

2005-06-28 Thread Tony Meyer
>>> Do you have any other good and valued Python modules that you would >>> think are bug-free, mature (that includes a long release >>> distance) and useful enough to be granted a place in the stdlib? >> >> First of all, numeric/numarray, obviously! > > There has been recent discussion about t

RE: Tracing down segfault

2005-06-26 Thread Tony Meyer
[Tony Meyer] >> I have (unfortunately) a Python program that I can >> consistently (in a reproducible way) segfault. [Tim Peters] > The _best_ thing to do next is to rebuild Python, and as many other > packages as possible, in debug mode. [...] > It's especially useful

Tracing down segfault

2005-06-24 Thread Tony Meyer
but I'm not sure why that would be causing a problem; I am join()ing all threads before this happens). Does anyone have any advice for tracking this down? Thanks! Tony Meyer -- http://mail.python.org/mailman/listinfo/python-list

RE: inactive Spambayes w/ Outlook

2005-06-12 Thread Tony Meyer
> I had installed spambayes with outlook 2003 a while ago and > it worked great. Then I did who know what it stopped working. If Peter's link doesn't help, I suggest you try the spambayes mailing list: =Tony.Meyer -- http://mail.python.org/

RE: What are OOP's Jargons and Complexities?

2005-05-26 Thread Tony Meyer
[Paul Rubin] > Strong typing means there [are] a lot of variables whose names > are in ALL CAPS. +1 QOTW. =Tony.Meyer -- http://mail.python.org/mailman/listinfo/python-list

RE: Checking for a full house

2005-05-25 Thread Tony Meyer
[Tony Meyer] >> def isfullHouse(roll): >> return len(set(roll)) != 2 [Robert Kern] > [1, 1, 1, 1, 2] is not a full house. Opps. I did say it was untested (that should have been == not !=, too). What about: def isfullHouse(roll): return len(set(roll)) == 2 and roll.count(

RE: Checking for a full house

2005-05-25 Thread Tony Meyer
> def removeAll(element, num2Rem, list): > l = list[:] > for num in range(0, num2Rem): > l.remove(element) > return l > > def isfullHouse(roll): > for die in range(1,7): > if roll.count(die)==3: > l = removeAll(die, 3, roll) > if l[0]==l[1]:

RE: problem uploading ZIP file tp PyPI

2005-05-19 Thread Tony Meyer
>> So (if the former is what you meant) would a workaround for >> now be to do something like: >> >> setup.py sdist --format=gztar upload > > (1) error: command 'tar' failed: No such file or directory I was assuming that tar and gzip were available. There are various tar/gzip applications avai

RE: problem uploading ZIP file tp PyPI

2005-05-19 Thread Tony Meyer
> setup.py sdist --format=zip Try without the --format arg. The code is being too paranoid. >>> >>> Oh, so even without --format, a ZIP source dist file is produced >>> anyway? If this is the case, please file a bug against PyPI. >> >> How is this a bug? sdist is meant to produce a

RE: problem uploading ZIP file tp PyPI

2005-05-19 Thread Tony Meyer
setup.py sdist --format=zip >>> >>> Try without the --format arg. The code is being too paranoid. >> >> Result: (A) produces a zip file with only minor differences >> (presumably a timestamp): > > Oh, so even without --format, a ZIP source dist file is > produced anyway? If this is the cas

python-dev Summary for 2005-04-16 through 2005-04-30

2005-05-15 Thread Tony Meyer
7.html>`__ - `os.urandom uses closed FD (sf 1177468) <http://mail.python.org/pipermail/python-dev/2005-April/052716.html>`__ - `Removing --with-wctype-functions support <http://mail.python.org/pipermail/python-dev/2005-April/052968.html>`__ Epilogue This is a s

RE: Quote-aware string splitting

2005-04-25 Thread Tony Meyer
> I need to split a string as per string.strip(), but with a > modification: > I want it to recognize quoted strings and return them as one > list item, > regardless of any whitespace within the quoted string. See the recent python-tutor thread starting here:

RE: os.path.walk

2005-04-13 Thread Tony Meyer
> I think if you try this you will find that it doesn't work because > os.path.walk will try to call the *result* of processDirectory(a,b,c) > for each directory in the path. Opps. I missed the "path", so gave an answer for os.walk. Apologies. The actual answer, then, I guess is that the OP c

RE: os.path.walk

2005-04-12 Thread Tony Meyer
> If I have os.path.walk(name, processDirectory, None) and > processDirectory needs three arguments how can I ass them > because walk only takes 3? Assuming that processDirectory is a function of yours that returns a bool, then you'd do something like: os.path.walk(name, processDirectory(a,b,

RE: Python 2.4 killing commercial Windows Python development ?

2005-04-12 Thread Tony Meyer
> installs it where? the MS docs seem to indicate that they > want you to install it in the program directory, rather than > in a "shared" location: > > http://support.microsoft.com/default.aspx?scid=kb;en-us;326922 From

RE: Python 2.4 killing commercial Windows Python development ?

2005-04-12 Thread Tony Meyer
[Nemesis] > OK, so the python installer _does_ ship this dll. So also the > win installer has the redistribution problem, or does they > pay for redistributing msvcr71.dll? If you have a legal copy of one of the commercial MS compilers that includes msvcr71.dll, you get the right to redistribut

RE: Python 2.4 killing commercial Windows Python development ?

2005-04-11 Thread Tony Meyer
[problems with dependency on msvr71.dll snipped] One option is to create a Windows Python 2.4 installer that includes a Python not built with MSVC7 - for example gcc or MSVC6 - which doesn't have the dependency on mscvr71.dll. Both VC6 and gcc are feasible, although there may be a reasonable amou

RE: compound strip() string problem

2005-04-10 Thread Tony Meyer
> As Sidharth Kuruvila pointed out, time.strftime() is probably > the best choice for your situation. For the general case of > removing whitespace from a sting, one method is: > > ''.join(mystring.split()) Alternatively, you could do something like: import string for c in string.whitespace:

RE: Unexpected result when comparing method with variable

2005-04-04 Thread Tony Meyer
[David Handy] > I had a program fail on me today because the following didn't > work as I expected: > > >>> class C: > ... def f(self): > ... pass > ... > >>> c = C() > >>> m = c.f > >>> m is c.f > False [...] > The workaround really awkward: What's wrong with this? >>> class C: ...

RE: IMAP4.search by message-id ?

2005-03-30 Thread Tony Meyer
> Can anyone tell me how to get a message's number from the message-id > using IMAP4.search? > I've tried this: > resp, items = server.search(None, 'HEADER', > '"Message-id"', msgID) but it gives me a 'bogus search criteria' error >>> import imaplib >>> i = imaplib.IMAP4("mail.example.com")

RE: Python & LEGO Mindstorm control...

2005-03-29 Thread Tony Meyer
> I have a question re the use of Python to control a robot > built with the LEGO Mindstorm system. > This is to help my 11yr old with his increased interest in > 'programming' and 'robotics'... If not feasible, he wants to > use the graphical-tool that comes with it... > > Would you suggest: >

RE: sorting a dictionary?

2005-03-22 Thread Tony Meyer
> mydict = {'the':358, 'they':29, 'went':7, 'said':65} > > Is there an easy to sort this dictionary and get a > list like the following (in decreasing order)? > > the 358 > said 65 > they 29 > went 7 The dictionary's keys and values are lists, which can be sorted, so you can just use that.

RE: sorting a dictionary?

2005-03-22 Thread Tony Meyer
> Thank you scott, but 'sorted' itself is not a python > library function. So I assume by > "sorted(mydict.items()", you meant the object of > mydict.items() which has been sorted, right? It's a builtin as of Python 2.4: Python 2.4.1c1 (#63, Mar 10 2005, 10:36:41) [MSC v.1310 32 bit (Intel)] on

Python 2.4, asyncore and errors

2005-03-08 Thread Tony Meyer
Changes in asyncore from 2.3 to 2.4 mean that asyncore.poll() now passes all the sockets in the map to select.select() to be checked for errors, which is probably a good thing. If an error occurs, then handle_expt() is called, which by default logs the error. asyncore.dispatcher creates nonblocki

RE: Dictionaries of Lists

2005-03-07 Thread Tony Meyer
> I'd like to associate certain lists with keywords, and > retrieve them. But this is not possible as lists are > not hashable. A dictionary's values don't have to be hashable, so if the keywords are the keys in the dictionary, this would work. >>> d = {} >>> d['key1'] = [1,2,3] >>> d['key2'] =

RE: select random entry from dictionary

2005-03-07 Thread Tony Meyer
> How can I select a random entry from a dictionary, regardless of its > key-values? >>> import random >>> d = {1:'a', 2:'b', 3:'c'} >>> a = random.choice(d.keys()) >>> a, d[a] (2, 'b') (etc) =Tony.Meyer -- http://mail.python.org/mailman/listinfo/python-list

RE: convert a list to a string?

2005-03-03 Thread Tony Meyer
> Suppose I have a list > > myList = ["this", "is", "a", "sample", "list"] > > If I don't want to iterate through it and concatenate > the list elements, how do I easily convert it to a > string like > > "this is a sample list" " ".join(myList) =Tony.Meyer -- http://mail.python.org/mailman/

RE: reading only new messages in imaplib

2005-02-23 Thread Tony Meyer
[Raghul] >>> Is it posssible to read only the new messages or unread >>> messages using imaplib in python? If it is possible pls >>> specify the module or give a sample code. [Tony Meyer] >> This will print out the first 20 chars of each undeleted message. &g

RE: reading only new messages in imaplib

2005-02-22 Thread Tony Meyer
> Is it posssible to read only the new messages or unread > messages using imaplib in python? If it is possible pls > specify the module or give a sample code. This will print out the first 20 chars of each undeleted message. You should be able to figure out how to do what you want from it. >>

RE: Dealing with config files what's the options

2005-02-22 Thread Tony Meyer
> How are the expert pythoneers dealing with config files? [...] You can just "import ConfigParser", or look at the various alternatives: =Tony.Meyer -- http://mail.python.org/mailman/listinfo/python-list

RE: copying or moving the mail message using imaplib

2005-02-21 Thread Tony Meyer
> My problem is I want to move the mail message to other folder in > the mail using imaplib (E.g) I want to move a message from > the inbox to the Draft folder in my account using python > code. Can any one help me by giving a sample code to do this? IMAP is a terrible terrible protocol. It is

RE: how can i randomly choose keys in dictionary

2005-02-17 Thread Tony Meyer
> Hi,there. How can I choose a key in dictionary randomly? > > Say, random.choice() in lists, A dictionary's keys() are a list, so you already have the answer: >>> import random >>> d = {'a': 1, 'b': 2, 'c': 3} >>> random.choice(d.keys()) =Tony.Meyer -- http://mail.python.org/mailman/listinfo

RE: parsing IMAP responses?

2005-02-14 Thread Tony Meyer
> Is there a library somewhere that impliments the IMAP protocol > syntax? Twisted has pretty good IMAP support (particularly client), and it's much higher level than imaplib. It probably does what you're after. Of course, the catch is that you have to use twisted <0.5 wink>. =Tony.Meyer --

RE: - E02 - Support for MinGW Open Source Compiler

2005-02-14 Thread Tony Meyer
>> In addition, there are some unresolved licensing questions >> concerning the .NET runtime file for extensions (msvcr71.dll): [...] > msvcr71.dll is a redistributable for applications written using their > compiler. You can redistribute that. If (and only if) you own a copy of the (non-free) M

RE: OS env for Windows

2005-02-13 Thread Tony Meyer
> Is there any other way > of distinguishing between XP and 2000 I wonder? WinXP SP2: >>> import win32api >>> major, minor, spack, platform, ver_str = win32api.GetVersionEx() >>> print major, minor, spack, platform, ver_str 5 1 2600 2 Service Pack 2 WinNT SP4: >>> import win32api >>> major, min

RE: Where are list methods documented?

2005-02-03 Thread Tony Meyer
> You're not the only one with a hard time finding the list > documentation. It's even crazier for string docs. > > If you want to see how to strip strings in Python you have to go to > the library docs, then click "sequence types" (betcha don't think of > strings as sequences), then scroll to the

RE: getting data from a port in use

2005-02-01 Thread Tony Meyer
>>> I am trying to use Python to get the data received at a >>> specific port (in use) on my computer. I already tried below >>> code which seems to hang at the statement accepting >>> connections. > > Yes. It hangs at accept. I always end up doing end task > because it never passes the "accept"

RE: getting data from a port in use

2005-01-31 Thread Tony Meyer
> I am trying to use Python to get the data received at a > specific port (in use) on my computer. I already tried below > code which seems to hang at the statement accepting > connections. Seems to hang, or does hang? Using print statements will tell you whether that's where it's getting stuck

RE: gmail access with python!

2005-01-30 Thread Tony Meyer
> i want to write a python program which will grab all my gmail > msgs and store them on my hard drive. [...] > my question is: does anyone have a working script which can > grab msgs from a gmail inbox ? Possibly not of use, but if you're not using POP3 access to your gmail account for anything

RE: Which is faster?

2005-01-26 Thread Tony Meyer
> Any idea which of the following is faster? > > 'a/b/c/'[:-1] > > or > > 'a/b/c/'.rstrip('/') > > Thanks in advance. > > P.S. I could time it but I thought of trying my luck here > first, in case someone knows already, and of course the reason. Timing it is almost no work, though: >>> impo

RE: site.here on python 2.4

2005-01-13 Thread Tony Meyer
> can we assume that, on all platforms, the old site.here is > the same as: > > >>> os.path.join(sys.prefix, 'lib', 'python%s' % sys.version[:3]) > '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3' > > or is it better to use, as you suggest, > > >>> import os > >>> os.

RE: Please Contribute Python Documentation!

2005-01-09 Thread Tony Meyer
> It *is* in the docs now -- see the top of > http://www.python.org/doc/2.4/doc/doc.html Oops. I ought to have checked rather than going by memory (I suppose the last time I looked 2.3 would have been current). Thanks for correcting me! =Tony.Meyer -- http://mail.python.org/mailman/listinfo/p

  1   2   >