Re: Parsing a date-time string?

2005-12-23 Thread Tim Roberts
"Tim N. van der Leeuw" <[EMAIL PROTECTED]> wrote: > >I want to parse strings containing date-time, which look like the >following: > > "Mon Dec 19 11:06:12:333 CET 2005" > >That's a problem for strptime it seems, b/c I cannot find any >format-spec for the milliseconds-part in here. (I'm also not su

Re: sorting with expensive compares?

2005-12-23 Thread gene tani
Dan Stromberg wrote: > Hi folks. > > Python appears to have a good sort method, but when sorting array elements > that are very large, and hence have very expensive compares, is there some > sort of already-available sort function that will merge like elements into > a chain, so that they won't ha

Re: sorting with expensive compares?

2005-12-23 Thread bonono
Dan Stromberg wrote: > Hi folks. > > Python appears to have a good sort method, but when sorting array elements > that are very large, and hence have very expensive compares, is there some > sort of already-available sort function that will merge like elements into > a chain, so that they won't ha

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

2005-12-23 Thread Paul Rubin
Robert Kern <[EMAIL PROTECTED]> writes: > RMS has said precisely the opposite, in fact. > http://lists.debian.org/debian-legal/2002/11/msg00217.html I guess you mean: > [RMS:] > As for the more general question, we think that a program that uses > Emacs facilities needs to be GPL-covered, but a p

Re: problem adding list values

2005-12-23 Thread gene tani
David M. Synck wrote: > > """ This function asks the user to input any credits not shown on their > bank statement > (OT I know, but just so you know, you *may* get away with using floats for financial calculations if you're handling small numbers of floats of roughly same order of magnitu

Re: sorting with expensive compares?

2005-12-23 Thread gene tani
[EMAIL PROTECTED] wrote: > Dan Stromberg wrote: > > Hi folks. > > > > Python appears to have a good sort method, but when sorting array elements > > that are very large, and hence have very expensive compares, is there some > > sort of already-available sort function that will merge like elements

Re: sorting with expensive compares?

2005-12-23 Thread bonono
gene tani wrote: > [EMAIL PROTECTED] wrote: > > Dan Stromberg wrote: > > > Hi folks. > > > > > > Python appears to have a good sort method, but when sorting array elements > > > that are very large, and hence have very expensive compares, is there some > > > sort of already-available sort function

Re: sorting with expensive compares?

2005-12-23 Thread Ben Sizer
Dan Stromberg wrote: > Python appears to have a good sort method, but when sorting array elements > that are very large, and hence have very expensive compares, is there some > sort of already-available sort function that will merge like elements into > a chain, so that they won't have to be recomp

Re: Python IMAP4 Memory Error

2005-12-23 Thread Jean-Paul Calderone
On Fri, 23 Dec 2005 14:21:27 +1100, Dody Suria Wijaya <[EMAIL PROTECTED]> wrote: >Noah wrote: >> This looks like a bug in your build of Python 2.4.2 for Windows. >> Basically it means that C's malloc() function in the Python interpreter >> failed. >> > >On a second trial, it's also failed on Python

RE: Parsing a date-time string?

2005-12-23 Thread Leeuw van der, Tim
Hi Tim,   Thanks a lot! That sounds like quite a useful routine, that I can use without going through extra documentation and adding extra libraries!   Cheers,   --Tim J   From: Tim Williams (gmail) [mailto:[EMAIL PROTECTED] Sent: donderdag 22 december 2005 16:38 To: Leeuw

Re: Python IMAP4 Memory Error

2005-12-23 Thread Fredrik Lundh
Jean-Paul Calderone wrote: > >On a second trial, it's also failed on Python 2.3.5 for Windows, Python > >2.3.3 for Windows, and Python 2.2.3 for Windows. So this seems to me as > >a Windows system related bug, not a particular version of Python bug. > > Arguably, it's a bug in Python's imaplib mod

Re: newbie: concatenate literals (using jython)

2005-12-23 Thread razornl
Note that "getListenPort()" returns an int. Is that a problem? yes, that's a problem. Python needs strings for concatenation apparently. you can use the .toString() methon on the int to convert it to a string ;) a=1 s='hello' print s+a TypeError: __add__ nor __radd__ defined for these operands

email package and line ending

2005-12-23 Thread Manlio Perillo
Regards. The problem is this code: >>> import email.Message >>> msg = email.Message.Message() >>> msg["subject"] = "email bug" >>> msg["from"] = "Manlio Perillo" >>> print repr(msg.as_string()) 'subject: email bug\nfrom: Manlio Perillo\n\n' Why line ending is '\n' and not '\r\n' ? RFC 2822

questions about locale and Windows

2005-12-23 Thread Manlio Perillo
Regards. I have a few questions about locale handling on Windows. The first: why getlocale() returns (None, None) when the locale is 'C'? The second is: why this code fails?: >>> loc, enc = locale.getdefaultlocale() >>> print loc, enc it_IT cp1252 >>> locale.setlocale(locale.LC_ALL, (loc, en

Re: How to check if a string "is" an int?

2005-12-23 Thread Fredrik Lundh
Grant Edwards wrote: > > So? the isdigit method tests whether all characters are digits. > > > '15'.isdigit() > > True > > But that is "obviously" wrong, since '15' is not a digit. no, but all characters in the string belongs to the "digit" character class, which is what the "is" predicates

why does Py_Finalize() always crashes?

2005-12-23 Thread Moon In Pale
I used Python as embeded in C++ program, which is made up of a EXE and a DLL. Py_Initialize() and Py_Finalize() are put in DllMain(). But everytime after the program starts, an "Access Violation" will be thrown. I looked up the Assembly code, the crash appears after Py_Finalize() returns:  }els

Re: How to check if a string "is" an int?

2005-12-23 Thread Paul Rubin
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > no, but all characters in the string belongs to the "digit" character > class, which is what the "is" predicates look for. That description is not quite right. All characters in the empty string belong to the "digit" character class, but isdigit retur

Re: How to check if a string "is" an int?

2005-12-23 Thread Fredrik Lundh
Paul Rubin wrote: > That description is not quite right. All characters in the empty > string belong to the "digit" character class A: are there any blue cars on the street? B: no. not a single one. A: you're wrong! all cars on the street are blue! B: no, the street is empty.

Desc of packages for XML processing

2005-12-23 Thread ankit
There are various packages availaible for XML processing using python. So which to choose and when. I summarized some of the features, advantages and disadvantages of some packages int the following text. Have a look to it. May this get out of the dillema of choice. Here we go: OPTIONS =

Detect File System changes

2005-12-23 Thread Lukas Meyer
Hello, I'm trying to detect changes in a directory. E.g if someone crates a file, i'll execute another function on this file. I tried to solve this by creating a loop that permanently checks the contents of this directory with os.listdir() and compares it with the one before. But this isn't reall

Re: Guido at Google

2005-12-23 Thread bearophileHUGS
This topic is discussed on Slashdot too: http://slashdot.org/articles/05/12/22/1832226.shtml?tid=217 There are some interesting comments, for example from curious Java or Perl programmers, etc. Some of them can probably appreciate this: http://cheeseshop.python.org/pypi/typecheck Among the noise

Re: Herds of cats (was: Guido at Google)

2005-12-23 Thread Nicola Musatti
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Nicola Musatti <[EMAIL PROTECTED]> wrote: > . > >Ah, the closed source days! Back then you could just buy the company > >and be done with it. Now you have to chase developers one by one all > >over the world... ;-) >

Re: How to check if a string "is" an int?

2005-12-23 Thread Paul Rubin
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > A: are there any blue cars on the street? > B: no. not a single one. > A: you're wrong! all cars on the street are blue! B and A are both correct. It's just logic ;-). -- http://mail.python.org/mailman/listinfo/python-list

Re: Detect File System changes

2005-12-23 Thread Fuzzyman
The proper way to do this is to use the facilities provided by the operating system. This means the solution is going to be different for different platforms. I've *not* done this before - but certainly for Windows I've seen discussions about this in this group previously. The win32 extensions exp

Re: How to check if a string "is" an int?

2005-12-23 Thread Duncan Booth
Fredrik Lundh wrote: > no, but all characters in the string belongs to the "digit" character > class, which is what the "is" predicates look for. > then gave examples including: "Life of Brian".istitle() > False I don't see how istitle() matches your definition of what the "is" predicate

Re: Detect File System changes

2005-12-23 Thread Noah
In the UNIX world the common tool is FAM -- File Allocation Monitor. This is a daemon that will report filesystem changes to clients. There is a Python interface to libfam called "Python FAM" here: http://python-fam.sourceforge.net/ It looks mature, but I have never used it. There are also som

Some errors when running code in diveintopython: (

2005-12-23 Thread iclinux
Environment: WinXP SP2 + Python 2.4.2, with SOAPpy-0.11.6.zip, fpconst-0.7.2.zip, and PyXML-0.8.4.win32-py2.4.exe installed. Problem: I'm reading DiveIntoPython these days. When running code of "Example 12.11. Calling A Web Service Through A WSDL Proxy", I got some errors as follow. Will you plea

Some errors when running code in diveintopython: (

2005-12-23 Thread iclinux
Environment: WinXP SP2 + Python 2.4.2, with SOAPpy-0.11.6.zip, fpconst-0.7.2.zip, and PyXML-0.8.4.win32-py2.4.exe installed. Problem: I'm reading DiveIntoPython these days. When running code of "Example 12.11. Calling A Web Service Through A WSDL Proxy", I got some errors as follow. Will you plea

Re: Some errors when running code in diveintopython: (

2005-12-23 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I'm reading DiveIntoPython these days. When running code of "Example > 12.11. Calling A Web Service Through A WSDL Proxy", I got some errors > as follow. Will you please give me some suggestion? > gaierror: (11001, 'getaddrinfo failed') this usually means that your com

Re: Guido at Google

2005-12-23 Thread elegans
Of the three languages, Java, C# and Python, Python is my pet. c# is very 90tyish and VS is showing it's age reminding me of Borland's old c++ IDE. Python represents the new direction in program language development and has the needed flexibility. I look forward to Google making Python, or it's sis

Re: sorting with expensive compares?

2005-12-23 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Dan Stromberg wrote: >>Python appears to have a good sort method, but when sorting array elements >>that are very large, and hence have very expensive compares, is there some >>sort of already-available sort function that will merge like elements into >>a chain, so that t

Re: Guido at Google

2005-12-23 Thread Bengt Richter
On 22 Dec 2005 23:06:43 -0800, "Anand" <[EMAIL PROTECTED]> wrote: My newsreader automatically (and configurably) generates the above line. Has a new reader come into frequent use that by default does not? ISTM that I've seen a lot of unattributed quotes posted recently. >> It's like having James

Re: Some errors when running code in diveintopython: (

2005-12-23 Thread iclinux
I can visit those two websites above, but when I run your code, I get those errors(BTW,I have closed my firewall ): >>> import socket >>> socket.getaddrinfo("www.xmethods.net", 80) Traceback (most recent call last): File "", line 1, in -toplevel- socket.getaddrinfo("www.xmethods.net", 80) g

Re: "Humane" programmer interfaces

2005-12-23 Thread Kent Johnson
Dave Benjamin wrote: > There's been a lot of discussion lately regarding Ruby and the notion of > a "humane" interface to objects like arrays and maps, as opposed to > "minimalist" ones. I believe the article that started the debates was > this one by Martin Fowler: > > http://www.developertesti

Re: Desc of packages for XML processing

2005-12-23 Thread Kent Johnson
ankit wrote: > There are various packages availaible for XML processing using python. > So which to choose and when. I summarized some of the features, > advantages and disadvantages of some packages int the following text. > Have a look to it. May this get out of the dillema of choice. > > Here w

Re: Detect File System changes

2005-12-23 Thread Kent Johnson
Lukas Meyer wrote: > Hello, > > I'm trying to detect changes in a directory. E.g if someone crates a > file, i'll execute another function on this file. > > I tried to solve this by creating a loop that permanently checks the > contents of this directory with os.listdir() and compares it with the

Re: sorting with expensive compares?

2005-12-23 Thread Paul Rubin
Kent Johnson <[EMAIL PROTECTED]> writes: > > [a] -> [ (hash(a), a) ] > > This won't work - elements with different hashes will sort by hash and > elements with the same hash will still be compared which is exactly > what the OP is trying to avoid. ds = sorted([(hash(c), i) for i,c in enumerate(a)

Vaults of Parnassus hasn't been updated for months

2005-12-23 Thread Wolfgang Grafen
What happened to the Vaults of Parnassus? It was always my favourite resource for Python code since ever. The latest entry is now 8/23. It has been up to date for years but now... What a pity! wolfgang -- http://mail.python.org/mailman/listinfo/python-list

Re: Some errors when running code in diveintopython: (

2005-12-23 Thread Istvan Albert
must be something with your settings ... I remeber once I had truly puzzling problem that manifested itself the same way ... Firefox and cygwin python would work fine but the windows python would raise errors when trying to connect via http ... ... finally I realized that the day before IE was s

Re: File object question

2005-12-23 Thread S. D. Rose
Yes, len() will do what I want. I didn't realize it would work with binary, I thought it was good only for variables, lists, etc. Thanks! -Dave "Kent Johnson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > S. D. Rose wrote: > > Hello all. > > If I read a binary file: > > > > fil

Re: Vaults of Parnassus hasn't been updated for months

2005-12-23 Thread Olivier Grisel
Wolfgang Grafen a écrit : > What happened to the Vaults of Parnassus? It was always my > favourite resource for Python code since ever. The latest > entry is now 8/23. It has been up to date for years but now... > What a pity! Everybody is using the cheeseshop now: http://cheeseshop.python.org/py

Re: How to check if a string "is" an int?

2005-12-23 Thread Grant Edwards
On 2005-12-23, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: > >> > So? the isdigit method tests whether all characters are digits. >> > >> '15'.isdigit() >> > True >> >> But that is "obviously" wrong, since '15' is not a digit. > > no, but all characters in the string belong

Re: print UTF-8 file with BOM

2005-12-23 Thread Kevin Yuan
Sorry, I'm newbie in python. I can't help you further, indeed I don't know either.:)2005/12/23, David Xiao <[EMAIL PROTECTED]>: Hi Kuan:Thanks a lot! One more question here: How to write if I want tospecify locale other than current locale?For example, running on Korea locale system, and try read a

Re: Detect File System changes

2005-12-23 Thread Lukas Meyer
Hello, Thank you for your assistance. I could manage it using your link to the already discussed thread. best regards, Lukas -- http://mail.python.org/mailman/listinfo/python-list

Re: print UTF-8 file with BOM

2005-12-23 Thread davihigh
FYI. I had just receive something from a friend, he give me following nice example! I have one more question on this: How to write if I want to specify locale other than current locale? For example, program runn on Korea locale system, and try reading a UTF-8 file that save chinese characters. --

Re: print UTF-8 file with BOM

2005-12-23 Thread Carsten Haese
> 2005/12/23, David Xiao <[EMAIL PROTECTED]>: > Hi Kuan: > > Thanks a lot! One more question here: How to write if I want > to > specify locale other than current locale? > > For example, running on Korea locale system, and try read a >

Re: Guido at Google

2005-12-23 Thread rbt
Anand wrote: >> It's like having James Bond as your very own personal body guard ;) > > That is such a nice quote that I am going to put it in my email > signature ! :) > > -Anand > Go right ahead. Perhaps we should do one for Perl too: It's like having King Kong as your very own personal body

Re: sorting with expensive compares?

2005-12-23 Thread Aahz
In article <[EMAIL PROTECTED]>, Dan Stromberg <[EMAIL PROTECTED]> wrote: > >Python appears to have a good sort method, but when sorting array >elements that are very large, and hence have very expensive compares, >is there some sort of already-available sort function that will merge >like elements

Logging: Formatter: name of the function

2005-12-23 Thread Gregor Horvath
Hi, Is there a possibility to format a log message to give the function name where the log appears? Example import logging def aTestFunction(): logger.debug("This is a message") The log should read: aTestFunction This is a message. There is a possibilty to format the module namewith %(m

urlretrieve() questions

2005-12-23 Thread Rene Lopez
I'm building an app that needs to download a file from the web. I'm trying to make sure I catch any issues with the download but I've run into a problem. here's what I have so far: try: urllib.urlretrieve(url,filename) print "File: ", filename, " downloaded" except IOError: print

Re: Providing 'default' value with raw_input()?

2005-12-23 Thread planetthoughtful
My intention is to build a GUI for this app, yes, but given that I'm about a week old in my learning of Python, I thought a command-line app was a better place to start. I'm actually quite surprised at how featured I've managed to make this app all things considered, and now I'm running into things

Re: Providing 'default' value with raw_input()?

2005-12-23 Thread planetthoughtful
Thank you for the suggestion, I'll have a look at this as an alternative. I must admit, it seems a little like a 'kludge', though -- but probably a necessary one, given the limitations of the OS. I'm assuming os.popen() keeps track of when the editor closes? Or would I have to manually fire an 'o

Re: GUI and graph

2005-12-23 Thread Fabrizio Milo
> pydot is pretty amazing in its abilitity to make nice, readable renderings of > graph data. > http://dkbza.org/pydot.html Well It's thanks to graphwiz.. http://www.research.att.com/sw/tools/graphviz/ I suggest to read the DOT language specification ( it is really easy ) and to roll up your ow

Have a very Pythonic Christmasolstihanukwanzaa

2005-12-23 Thread infidel
Happy holidays to my fellow Pythonistas. Love, Saint Infidel the Skeptic -- http://mail.python.org/mailman/listinfo/python-list

Re: print UTF-8 file with BOM

2005-12-23 Thread John Bauman
UTF-8 shouldn't need a BOM, as it is designed for character streams, and there is only one logical ordering of the bytes. Only UTF-16 and greater should output a BOM, AFAIK. -- http://mail.python.org/mailman/listinfo/python-list

Re: GUI and graph

2005-12-23 Thread bearophileHUGS
Maybe this graph library can be useful to you: http://sourceforge.net/projects/pynetwork/ Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Some errors when running code in diveintopython: (

2005-12-23 Thread David Wahler
Istvan Albert wrote: > I remeber once I had truly puzzling problem that manifested itself the > same way ... Firefox and cygwin python would work fine but the windows > python would raise errors when trying to connect via http ... > > ... finally I realized that the day before IE was set to use a p

Re: Guido at Google

2005-12-23 Thread David E. Konerding DSD staff
In article <[EMAIL PROTECTED]>, Greg Stein wrote: > Guido would acknowledge a query, but never announce it. That's not his > style. > > This should have a positive impact on Python. His job description has a > *very* significant portion of his time dedicated specifically to > working on Python. (m

Re: Detect File System changes

2005-12-23 Thread Lawrence Oluyede
Il 2005-12-23, Lukas Meyer <[EMAIL PROTECTED]> ha scritto: > Hello, > > I'm trying to detect changes in a directory. E.g if someone crates a > file, i'll execute another function on this file. pyinotify (wrapper of inotify) is for you (it's not portable however) http://pyinotify.sourceforge.net/

Re: Herds of cats

2005-12-23 Thread Alex Martelli
Nicola Musatti <[EMAIL PROTECTED]> wrote: ... > > >Ah, the closed source days! Back then you could just buy the company > > >and be done with it. Now you have to chase developers one by one all > > >over the world... ;-) > > . > > You propellor-heads (I write that in all fond

Re: Providing 'default' value with raw_input()?

2005-12-23 Thread Alex Martelli
planetthoughtful <[EMAIL PROTECTED]> wrote: > Thank you for the suggestion, I'll have a look at this as an > alternative. > > I must admit, it seems a little like a 'kludge', though -- but probably > a necessary one, given the limitations of the OS. Hmmm, what OS? The recipe I mentioned is prob

Re: print UTF-8 file with BOM

2005-12-23 Thread Walter Dörwald
John Bauman wrote: > UTF-8 shouldn't need a BOM, as it is designed for character streams, and > there is only one logical ordering of the bytes. Only UTF-16 and greater > should output a BOM, AFAIK. However there's a pending patch (http://bugs.python.org/1177307) for a new encoding named utf-

Re: Logging: Formatter: name of the function

2005-12-23 Thread Bengt Richter
On Fri, 23 Dec 2005 16:23:57 +0100, Gregor Horvath <[EMAIL PROTECTED]> wrote: >Hi, > >Is there a possibility to format a log message to give the function name >where the log appears? > >Example > >import logging > >def aTestFunction(): > logger.debug("This is a message") > >The log should read:

Re: Guido at Google

2005-12-23 Thread Luis M. González
rbt wrote: > Go right ahead. Perhaps we should do one for Perl too: > > It's like having King Kong as your very own personal body guard ;) Good analogy: You know, they call Perl the "eight-hundred-pound gorilla" of scripting languages. Although most of the time, it would be a a very unsuitable bo

Re: What is unique about Python?

2005-12-23 Thread D H
Kay Schluehr wrote: > gsteff wrote: > > >>So I'm wondering, what is >>innovative about Python, either in its design or implementation? Or is >>its magic really just in combining many useful features of prior >>languages in an unusually pleasant way? >> >>Greg > > > The latter. > > http://www.

Re: How to get started in GUI Programming?

2005-12-23 Thread D H
Kay Schluehr wrote: > [EMAIL PROTECTED] wrote: > >>I am trying to learn GUI programming in Python, but have to confess I >>am finding it difficult. > > > Don't do it if you can prevent it. What kind of helpful advice is that? > Conclusion: if you are already familiar with BASIC I would just >

Re: How to get started in GUI Programming?

2005-12-23 Thread Tim Peters
[D H] > ... > Doesn't the python community already have enough assholes as it is? The Python Software Foundation may well wish to fund a study on that. Write a proposal! My wild-ass guess is that, same as most other Open Source communities, we average about one asshole per member. I'd love to p

Re: Python IMAP4 Memory Error

2005-12-23 Thread Dody Suria Wijaya
like magic it did the trick :D This should be applied to future Python release. Thanks. Fredrik Lundh wrote: > Jean-Paul Calderone wrote: > if you look at the debug output (which you may already have done), > it's an obvious case of fragmentation-inducing behaviour. any malloc- > based system ma

Re: Herds of cats

2005-12-23 Thread Steve Holden
Alex Martelli wrote: > Nicola Musatti <[EMAIL PROTECTED]> wrote: >... > Ah, the closed source days! Back then you could just buy the company and be done with it. Now you have to chase developers one by one all over the world... ;-) >>> >>>. >>>You propellor-head

Re: sorting with expensive compares?

2005-12-23 Thread Dan Stromberg
On Thu, 22 Dec 2005 22:06:42 +, Dan Stromberg wrote: > > Hi folks. > > Python appears to have a good sort method, but when sorting array elements > that are very large, and hence have very expensive compares, is there some > sort of already-available sort function that will merge like elemen

Re: Vaults of Parnassus hasn't been updated for months

2005-12-23 Thread Wolfgang Grafen
> Everybody is using the cheeseshop now: > > http://cheeseshop.python.org/pypi?%3Aaction=browse > Everybody excluding me. Looks like a huge pile of cheese thrown above a table. Sorry, I don't find what I am looking for. Can somebody explain the improvement over Parnassus for me? It is not onl

Re: sorting with expensive compares?

2005-12-23 Thread bonono
Dan Stromberg wrote: > On Thu, 22 Dec 2005 22:06:42 +, Dan Stromberg wrote: > > > > > Hi folks. > > > > Python appears to have a good sort method, but when sorting array elements > > that are very large, and hence have very expensive compares, is there some > > sort of already-available sort f

Re: How to get started in GUI Programming?

2005-12-23 Thread Heiko Wundram
Tim Peters wrote: > My wild-ass guess is that, same as most other Open > Source communities, we average [at] about one asshole per member. Tim, you saved my day. QOTW! --- Heiko. -- http://mail.python.org/mailman/listinfo/python-list

Re: urlretrieve() questions

2005-12-23 Thread Dan M
> Pretty straight forward...but what I'm finding is if the > url is pointing to a file that is not there, the server > returns a file that's a web page displaying a 404 error. > > Anyone have any recommendations for handling this? You're right, that is NOT documented in a way that's easy to find

Indentation/whitespace

2005-12-23 Thread Joe
Is Python going to support s syntax the does not use it's infamous whitespace rules? I recall reading that Python might include such a feature. Or, maybe just a brace-to-indentation preprocessor would be sufficient. Many people think Python's syntax makes sense. There are strong feelings both ways

Re: sorting with expensive compares?

2005-12-23 Thread Alex Martelli
Dan Stromberg <[EMAIL PROTECTED]> wrote: ... > I'm wanting to sort a large number of files, like a bunch of output files > from a large series of rsh or ssh outputs on a large series of distinct > machines, a music collection in .ogg format (strictly redistributable and > legally purchased music

Re: Guido at Google

2005-12-23 Thread rbt
Luis M. González wrote: > rbt wrote: >> Go right ahead. Perhaps we should do one for Perl too: >> >> It's like having King Kong as your very own personal body guard ;) > > Good analogy: > You know, they call Perl the "eight-hundred-pound gorilla" of scripting > languages. Absolutely. It's big, ha

Re: Indentation/whitespace

2005-12-23 Thread Larry Bates
Joe wrote: > Is Python going to support s syntax the does not use it's infamous > whitespace rules? I recall reading that Python might include such a > feature. Or, maybe just a brace-to-indentation preprocessor would be > sufficient. > > Many people think Python's syntax makes sense. There are st

Re: Indentation/whitespace

2005-12-23 Thread Alex Martelli
Joe <[EMAIL PROTECTED]> wrote: > Is Python going to support s syntax the does not use it's infamous > whitespace rules? No, never (even apart from the "its" vs "it's" issue here...;-). > I recall reading that Python might include such a > feature. And I recall reading that Elvis is still alive

Re: sorting with expensive compares?

2005-12-23 Thread Peter Otten
Dan Stromberg wrote: > I'm wanting to sort a large number of files, like a bunch of output files > from a large series of rsh or ssh outputs on a large series of distinct > machines, a music collection in .ogg format (strictly redistributable and > legally purchased music), a collection of .iso cd

Re: sorting with expensive compares?

2005-12-23 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Dan Stromberg wrote: [...] >>I've been using the following compare function, which in short checks, in >>order: >> >>1) device number >>2) inode number >>3) file length >>4) the beginning of the file >>5) an md5 hash of the entire file >>6) the entire file [...] > Why wou

Re: Providing 'default' value with raw_input()?

2005-12-23 Thread Scott David Daniels
planetthoughtful wrote: > ... > I had thought to build GUIs in wxPython - is Tkinter any easier to > learn? I certainly found Tkinter easier. There are a couple of good tutorials (and there is always the Grayson book) on the web to get started. What is easiest to learn is (in many cases) a prope

Re: Indentation/whitespace

2005-12-23 Thread Dave Benjamin
Alex Martelli wrote: > The main reason I suggest a general-purpose mechanism for the hooking-up > of the preprocessor is that such a mechanism might stand a chance to be > accepted (via the usual PEP procedure), as long as other interesting use > cases can be found; I suspect that if the only use c

Re: Some errors when running code in diveintopython: (

2005-12-23 Thread beryan
El Fri, 23 Dec 2005 05:18:30 -0800, iclinux escribió: > I can visit those two websites above, but when I run your code, I get > those errors(BTW,I have closed my firewall > ): > import socket socket.getaddrinfo("www.xmethods.net", 80) > > Traceback (most recent call last): > File "",

Re: Parsing a date-time string?

2005-12-23 Thread linda.s
Hi, I got the message of "There was an error in the DDE conversation with Pythonwin" when I tried to run Pythonwin. I googled and found the possible solution is: modify the Pythonwin shortcut to pass a "/nodde" command-line option. I got lost how to do that. Thanks for any help! -- http://mail.pyt

jython/wlst: How to avoid newlines in output from "cd" command (and others)

2005-12-23 Thread davidmichaelkarr
I'm using WebLogic Scripting Tool, which uses Jython, which uses Python 2.1. In a script I'm writing, executing a "cd()" always emits a newline to stdout. Is there a way to make it not emit that newline on the "cd()" command (and others like it)? -- http://mail.python.org/mailman/listinfo/pytho

Re: Indentation/whitespace

2005-12-23 Thread Thomas Bartkus
"Joe" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Is Python going to support s syntax the does not use it's infamous > whitespace rules? I recall reading that Python might include such a > feature. Or, maybe just a brace-to-indentation preprocessor would be > sufficient. > > Many

Re: Vaults of Parnassus hasn't been updated for months

2005-12-23 Thread Do Re Mi chel La Si Do
Hi! >>> Just a poll: Who misses the Vaults of Parnassus like me? Me (+1) @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

run line or selection

2005-12-23 Thread linda.s
is there any tool like "run line or selection" in Pythonwin? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: How to call function which is in one program ...

2005-12-23 Thread Shahriar Shamil Uulu
Thank you Fredrik Lundh for your help ... it worked ... the problem was in saving of file first.py Fredrik Lundh wrote: > "Shahriar Shamil Uulu" wrote: > > > i got another questions. For example i have two programs in python > > like: first.py, second.py. > > In first.py i have a function test() li

Re: Indentation/whitespace

2005-12-23 Thread Terry Hancock
On Fri, 23 Dec 2005 11:51:23 -0700 Dave Benjamin <[EMAIL PROTECTED]> wrote: > +1 on the preprocessor idea, especially if it would allow > us to hook in at the AST level as well. (No comment on > the curlies. ;) Only +0 on it myself, but I do know of a use-case -- certain types of web-templating f

pyQt for windows

2005-12-23 Thread relativity
I have downloaded and installed pyQt 3.14 educational but when I run any of the examples I get an error saying qt-mtedu333.dll was not found. I have also installed the qt4 opensource version for windows but I am not sure everything was set up correctly. When I run configure it complains about f

Re: sorting with expensive compares?

2005-12-23 Thread Steven D'Aprano
On Fri, 23 Dec 2005 09:20:55 -0800, bonono wrote: > > Dan Stromberg wrote: [snip] >> I've been using the following compare function, which in short checks, in >> order: >> >> 1) device number >> 2) inode number >> 3) file length >> 4) the beginning of the file >> 5) an md5 hash of the entire fi

query on csv file reading and replacing

2005-12-23 Thread muttu2244
Hi everybody Am trying to read a csv file "temp.csv", which has the below info, compName macAddripAddr opSys Chris-Dev 0003469F44CC 10.160.24.226 Microsoft Windows XP Professional Shivayogi-Dev 000D5234F44C 10.160.24.136 Microsoft Windows XP Profe

Re: Herds of cats

2005-12-23 Thread Mike Meyer
Steve Holden <[EMAIL PROTECTED]> writes: > Alex Martelli wrote: >> Not a bad point at all, although perhaps not entirely congruent to >> open >> source: hiring key developers has always been a possibility (net of >> non-compete agreements, but I'm told California doesn't like those). California pl

Re: sorting with expensive compares?

2005-12-23 Thread Steven D'Aprano
On Fri, 23 Dec 2005 19:26:11 +0100, Peter Otten wrote: > Dan Stromberg wrote: > >> I'm wanting to sort a large number of files, like a bunch of output files >> from a large series of rsh or ssh outputs on a large series of distinct >> machines, a music collection in .ogg format (strictly redistri

Re: print UTF-8 file with BOM

2005-12-23 Thread Martin v. Löwis
John Bauman wrote: > UTF-8 shouldn't need a BOM, as it is designed for character streams, and > there is only one logical ordering of the bytes. Only UTF-16 and greater > should output a BOM, AFAIK. Yes and no. Yes, UTF-8 does not need a BOM to identify endianness. No, usage of the BOM with UTF

Re: Logging: Formatter: name of the function

2005-12-23 Thread Sylvain Defresne
Le vendredi 23 décembre 2005 à 16:23 +0100, Gregor Horvath a écrit : > Hi, > > Is there a possibility to format a log message to give the function name > where the log appears? > > Example > > import logging > > def aTestFunction(): >logger.debug("This is a message") > > The log should re

Re: What is unique about Python?

2005-12-23 Thread Max
gsteff wrote: > I'm a computer science student, and have recently been trying to > convince the professor who teaches the programming language design > course to consider mentioning scripting languages in the future. Along > those lines, I've been trying to think of features of Python, and > scrip

Re: sorting with expensive compares?

2005-12-23 Thread Paul Rubin
Dan Stromberg <[EMAIL PROTECTED]> writes: > I've been using the following compare function, which in short checks, in > order: > > 1) device number > 2) inode number > 3) file length > 4) the beginning of the file > 5) an md5 hash of the entire file > 6) the entire file > > (If #1 and #2 are iden

  1   2   >