Re: regular expression

2005-03-26 Thread Paul McGuire
Aaron - Here's a pyparsing approach (requires latest 1.3 pyparsing version). It may not be as terse or fast as your regexp, but it may be easier to maintain. By defining floatNum ahead of DOT in the scanner definition, you specify the dot-containing expressions that you do *not* want to have dots

Re: Grouping code by indentation - feature or ******?

2005-03-26 Thread Jacob Lee
On Sat, 26 Mar 2005 10:02:13 +0100, Javier Bezos wrote: > > "Tim Tyler" <[EMAIL PROTECTED]> escribió en el mensaje > news:[EMAIL PROTECTED] >> What do you guys think about Python's grouping of code via indentation? >> >> Is it good - perhaps because it saves space and eliminates keypresses? >> >>

Re: Suggesting a new feature - "Inverse Generators"

2005-03-26 Thread Oren Tirosh
"Jordan Rastrick" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Hmmm, I like the terminology consumers better than acceptors. Here's an implementation of Python consumers using generators: http://groups.google.co.uk/[EMAIL PROTECTED] Oren -- http://mail.python.org/mailman

Re: Turn of globals in a function?

2005-03-26 Thread Oren Tirosh
Ron_Adam <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Is there a way to hide global names from a function or class? > > I want to be sure that a function doesn't use any global variables by > mistake. So hiding them would force a name error in the case that I > omit an initi

Re: Python slogan, was Re: Grouping code by indentation - feature or ******?

2005-03-26 Thread Peter Otten
Kent Johnson wrote: > Interesting that in the quote on wikiquote, Churchill indicates that the > sentiment is not original with him: > "Indeed, it has been said that democracy is the worst form of government > except all those other forms that have been tried from time to time." > > Note the "it

Re: Python for a 10-14 years old?

2005-03-26 Thread Joal Heagney
Simon Brunning wrote: On 23 Mar 2005 21:03:04 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Is there something out there like "Python for kids" which would explain *basic* programming concepts in a way which is accessible and entertaining for kids aged 10-14 (that about where her brain is ri

Re: Why tuple with one item is no tuple

2005-03-26 Thread Joal Heagney
Antoon Pardon wrote: So python choose a non-deterministic direction. To me (2,3) + (4,5) equals (6,8). I don't dispute that having an operator to combine (2,3) and (4,5) in (2,3,4,5) is usefull, but they should never have used the "+" for that. ("alph", "bravo") + ("delta", "max") --> ("alphdelta"

Re: Suggesting a new feature - "Inverse Generators" -- tangential topic

2005-03-26 Thread phil_nospam_schmidt
> The ability to have 'full coroutines', or at least more 'coroutiney > behaviour' than is provided by generators alone, was I think what I was Jordan, This is somewhat off-topic, but perhaps you might be interested in taking a look at the Lua language (http://www.lua.org/). It supports coroutine

Re: Turn off globals in a function?

2005-03-26 Thread Ron_Adam
>If you put the above def b in e.g. a_module.py, >and do a (untested ;-) > >from a_module import b > >instead of defining it locally, then the global references >from b (and whatever else you import from a_module) >should be to the global dict defined for a_module (i.e., its >outermost scope),

Re: ossaudiodev full duplex

2005-03-26 Thread rjm
Thanks that was helpful. The mixer seems werid though. I tested first with the alsamixer and the only way I can get the line-in in to record is to put the "mix" channel into capture mode. However, doing that mixes all the record sources together so I get the orginal sound that is played through t

Re: Python slogan, was Re: Grouping code by indentation - feature or ******?

2005-03-26 Thread Kent Johnson
Peter Otten wrote: Skip Montanaro wrote: >> Or, paraphrasing Mark Twain, "Python is the worst possible >> programming language, except for all the others." Google thinks it's Winston Churchill as well. I did come across a quote wiki: http://www.wikiquote.org/ Wikiquote is nice. I misse

Re: Turn of globals in a function?

2005-03-26 Thread Ron_Adam
On Sat, 26 Mar 2005 12:18:39 -0800, Michael Spencer <[EMAIL PROTECTED]> wrote: >Ron_Adam wrote: >> Is there a way to hide global names from a function or class? >> >> I want to be sure that a function doesn't use any global variables by >> mistake. So hiding them would force a name error in the

Re: html tags and python

2005-03-26 Thread Jeremy Bowers
On Sat, 26 Mar 2005 18:07:01 -0800, EP wrote: > Then... about the time you start to try to build a real application with > JavaScript, it will start to drive you mad... and you will have a new, > greater affection for Python. Actually, if you dig into it really hard, it's not bad. In fact of all t

Re: html tags and python

2005-03-26 Thread EP
> > January > February > March > April > May > June > July > August > September > October > November > December > > > The thing is: > I also want the user to choose a date > I will make thi

ANN: pyparsing-1.3 released

2005-03-26 Thread Paul McGuire
I'm happy to announce that 1) pyparsing has been pretty stable for the past 6 months (the last formal release 1.2.2 was last September), and 2) I finally found the time to put together a new release, version 1.3. This release also includes all of the enhancements I posted to CVS last fall as versi

Re: character-filtering and Word (& company)

2005-03-26 Thread John Machin
Charles Hartman wrote: > I'm working on text-handling programs that want plain-text files as > input. It's fine to tell users to feed the programs with plain-text > only, but not all users know what this means, even after you explain > it, or they forget. So it would be nice to be able to handle g

Re: ossaudiodev full duplex

2005-03-26 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, rjm wrote: > [recording the output] > > Any ideas? Am I doing something fundamentally wrong? Any help would > be greatly appreciated. You have to use the mixer to select which channel(s) should be the source of the recording. It's best is to deselect all other sources e

Re: Once again a unicode question

2005-03-26 Thread Nicolas Evrard
* Serge Orlov [23:45 26/03/05 CET]: Nicolas Evrard wrote: Hello, I'm puzzled by this test I made while trying to transform a page in html to plain text. Because I cannot send unicode to feed, nor str so how can I do this ? Seems like the parser is in the broken state after the first exception. Fe

Re: Grouping code by indentation - feature or ******?

2005-03-26 Thread James Stroud
On Saturday 26 March 2005 02:52 pm, Mike Meyer wrote: > Because newlines are optional statement terminators. Yes; I have accidentally found that ; can be used also as an optional statement terminator--when rewriting some perl code. James -- http://mail.python.org/mailman/listinfo/python-list

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

2005-03-26 Thread Cameron Laird
as they got it formed, they elected Whitney Young as the chairman, and who [do] you think became the co-chairman? Stephen Currier, the white man, a millionaire. Powell was talking about it down at the Cobo [Hall] today. This is what he was talking about. Powell knows it happened. Randolph knows it

Re: The Greatest News Ever!

2005-03-26 Thread James Stroud
On Saturday 26 March 2005 01:55 pm, Dennis Lee Bieber wrote: > On Sat, 26 Mar 2005 17:02:56 + (UTC), R.Meijer > > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > Now, what I don't understand is what this is doing in a python newsgroup? > > The same thing it was doing

Re: character-filtering and Word (& company)

2005-03-26 Thread Mike Meyer
Charles Hartman <[EMAIL PROTECTED]> writes: > I'm working on text-handling programs that want plain-text files as > input. It's fine to tell users to feed the programs with plain-text > only, but not all users know what this means, even after you explain > it, or they forget. So it would be nice t

Re: wxPython Install

2005-03-26 Thread Cousin Stanley
| | If I can't install an operating system then put wxPython on it | without jumping through hoops, my probelm will be wxPython. | James Under Debian GNU/Linux installing Python and wxpython using the apt package manager is accomplished via the command lines # apt-

Re: Grouping code by indentation - feature or ******?

2005-03-26 Thread Mike Meyer
James Stroud <[EMAIL PROTECTED]> writes: > On Friday 25 March 2005 08:39 am, Ivan Van Laningham wrote: > Why do we need : at the end of our if and for loops? I spend approximately 6 > minutes/100 lines of code going back and finding all of the times I missed :. > Is it for cheating? Because new

Re: Once again a unicode question

2005-03-26 Thread Serge Orlov
Nicolas Evrard wrote: > Hello, > > I'm puzzled by this test I made while trying to transform a page in > html to plain text. Because I cannot send unicode to feed, nor str so > how can I do this ? Seems like the parser is in the broken state after the first exception. Feed only binary strings to i

Once again a unicode question

2005-03-26 Thread Nicolas Evrard
Hello, I'm puzzled by this test I made while trying to transform a page in html to plain text. Because I cannot send unicode to feed, nor str so how can I do this ? [EMAIL PROTECTED]:~$ python2.4 .Python 2.4.1c2 (#2, Mar 19 2005, 01:04:19) .[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2 .Type "help", "

Re: The Greatest News Ever!

2005-03-26 Thread Erik de Castro Lopo
"R.Meijer" wrote: > > yahoo.com> writes: > > > > > http://www.jcil.blogspot.com << The Greatest News Ever! > > > > Wow, what a total bullshit (no offense to christians >_> ) Personally I find christians, especially this kind rather offense. > Now, what I don't understand is what this is doin

Re: Turn of globals in a function?

2005-03-26 Thread Bengt Richter
On Sat, 26 Mar 2005 20:01:28 GMT, Ron_Adam <[EMAIL PROTECTED]> wrote: > >Is there a way to hide global names from a function or class? > >I want to be sure that a function doesn't use any global variables by >mistake. So hiding them would force a name error in the case that I >omit an initializat

Re: Embedding Python

2005-03-26 Thread Heiko Wundram
Am Samstag, 26. März 2005 21:36 schrieb Mark Tolonen: > I also (before I originally posted) did a "find / -name libpython*" with no > success. Looks like Redhat 9 ships with a statically linked version of > python. Hmm... Sorry to have thought otherwise... RedHat is braindead. :-) -- --- Heiko.

Re: Embedding Python

2005-03-26 Thread Mark Tolonen
"Reinhold Birkenfeld" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Heiko Wundram wrote: >> Am Samstag, 26. März 2005 20:43 schrieb Mark Tolonen: >>> On my system, for whatever reason, the .so library isn't present. I >>> have >>> the python-devel package installed. >> >> I actu

wxPython Install

2005-03-26 Thread James Stroud
Hello All, I will soon have an excuse to install a new operating system on my computer. I would like to know exactly what operating system I should have so that I can get wxPython going. wxPython is my only hold-out on my current system. wxPython seems to need gnome. So I have tried to build ga

urllib.urlretireve problem

2005-03-26 Thread Ritesh Raj Sarraf
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello Everybody, I've got a small problem with urlretrieve. Even passing a bad url to urlretrieve doesn't raise an exception. Or does it? If Yes, What exception is it ? And how do I use it in my program ? I've searched a lot but haven't found anythi

Re: Turn of globals in a function?

2005-03-26 Thread Michael Spencer
Ron_Adam wrote: Is there a way to hide global names from a function or class? I want to be sure that a function doesn't use any global variables by mistake. So hiding them would force a name error in the case that I omit an initialization step. This might be a good way to quickly catch some hard

Re: Embedding Python

2005-03-26 Thread Reinhold Birkenfeld
Heiko Wundram wrote: > Am Samstag, 26. März 2005 20:43 schrieb Mark Tolonen: >> On my system, for whatever reason, the .so library isn't present. I have >> the python-devel package installed. > > I actually can't believe this; do > > ldconfig -p|grep "python" Or, use ldd =python to exactly di

Turn of globals in a function?

2005-03-26 Thread Ron_Adam
Is there a way to hide global names from a function or class? I want to be sure that a function doesn't use any global variables by mistake. So hiding them would force a name error in the case that I omit an initialization step. This might be a good way to quickly catch some hard to find, but e

Re: Embedding Python

2005-03-26 Thread Heiko Wundram
Am Samstag, 26. März 2005 20:43 schrieb Mark Tolonen: > On my system, for whatever reason, the .so library isn't present. I have > the python-devel package installed. I actually can't believe this; do ldconfig -p|grep "python" as root and look for any output. And remember that the shared librar

Re: mysteriously nonfunctioning script - very simple

2005-03-26 Thread Heiko Wundram
Am Samstag, 26. März 2005 19:47 schrieb Sean McIlroy: > Why not try the following: >>> import datetime >>> x = datetime.datetime.now() >>> x datetime.datetime(2005, 3, 26, 21, 48, 13, 495765) >>> y = datetime.datetime(2005,3,26,21,50) # Wake me up today at 21:50 >>> y datetime.datetime(2005, 3,

Re: Embedding Python

2005-03-26 Thread Mark Tolonen
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> This works for me on Redhat 9: >> >> g++ x.cpp -o x -I/usr/include/python2.2 -pthread -lm >> -ldl -lutil /usr/lib/python2.2/config/libpython2.2.a >> > > Why did you chose the static variant? This should be equival

Re: mysteriously nonfunctioning script - very simple

2005-03-26 Thread Michael Spencer
Sean McIlroy wrote: Fair enough. Here's the verbose version: ## from time import sleep,time,localtime wakeuptime = (7,00) ## I WANT TO BE WOKEN UP AT 7AM (FOR EXAMPLE) onehourlater = (wakeuptime[0]+1, wakeuptime[1]) ## ONE HOUR

Re: mysteriously nonfunctioning script - very simple

2005-03-26 Thread Peter Otten
Sean McIlroy wrote: > Fair enough. Here's the verbose version: > from time import sleep,time,localtime > > wakeuptime = (7,00) > ## I WANT TO BE WOKEN UP AT 7AM (FOR EXAMPLE) > > onehourlater = (wakeuptime[0]+1, wakeuptime[1]) > ## ONE HOUR LATER THAN THAT IS 8AM > > while not wakeuptime < loc

Re: Example Code - Named Pipes (Python 2.4 + ctypes on Windows)

2005-03-26 Thread Paul Du Bois
Srijit Kumar Bhadra wrote: > However, I wish that there was more documentation of win32all beyond > existing PyWin32.chm. I suspect you have already used the "more documentation" -- it's the MSDN docs. p -- http://mail.python.org/mailman/listinfo/python-list

Re: Python slogan, was Re: Grouping code by indentation - feature or ******?

2005-03-26 Thread Peter Otten
Skip Montanaro wrote: > >> Or, paraphrasing Mark Twain, "Python is the worst possible > >> programming language, except for all the others." > Google thinks it's Winston Churchill as well. I did come across a quote > wiki: > > http://www.wikiquote.org/ > > None of the quotes attrib

Re: mysteriously nonfunctioning script - very simple

2005-03-26 Thread Diez B. Roggisch
> ## > from time import sleep,time,localtime > > wakeuptime = (7,00) > ## I WANT TO BE WOKEN UP AT 7AM (FOR EXAMPLE) > > onehourlater = (wakeuptime[0]+1, wakeuptime[1]) > ## ONE HOUR LATER THAN THAT IS 8AM > > while not wakeupti

Re: Embedding Python

2005-03-26 Thread Diez B. Roggisch
> This works for me on Redhat 9: > > g++ x.cpp -o x -I/usr/include/python2.2 -pthread -lm > -ldl -lutil /usr/lib/python2.2/config/libpython2.2.a > Why did you chose the static variant? This should be equivalent: g++ x.cpp -o x -I/usr/include/python2.2 -pthread -lm -ldl -lutil -lpython2.2 -

Re: mysteriously nonfunctioning script - very simple

2005-03-26 Thread Sean McIlroy
Fair enough. Here's the verbose version: ## from time import sleep,time,localtime wakeuptime = (7,00) ## I WANT TO BE WOKEN UP AT 7AM (FOR EXAMPLE) onehourlater = (wakeuptime[0]+1, wakeuptime[1]) ## ONE HOUR LATER THAN THAT IS

Re: Embedding Python

2005-03-26 Thread Mark Tolonen
"Markus Franz" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi! > > I wanted to run some Python code from inside a C program, so I did it > like it was explained in the Python manual: > > #include > int main(int argc, char *argv[]) { > Py_Initialize(); > PyRun_SimpleString("prin

Re: Archives and magic bytes

2005-03-26 Thread andrea crotti
> Perhaps this is mostly a reflection on me as a programmer :-} but I > found the job surprisingly tricky. No I think you're right... It's not very important for me retrieve exactly what kind of file it is, it could be just something more in my little program (an organizer that put files in the rig

Re: Example Code - Named Pipes (Python 2.4 + ctypes on Windows)

2005-03-26 Thread Thomas Heller
Harald Massa <[EMAIL PROTECTED]> writes: > "Srijit Kumar Bhadra" <[EMAIL PROTECTED]> wrote in >> Here is an example of Multithreaded Pipe Server and Client using the >> excellent ctypes library (Windows). > > Excellent. Maybe you would also like to post it to the > > http://starship.python.net/cre

Re: Example Code - Named Pipes (Python 2.4 + ctypes on Windows)

2005-03-26 Thread Thomas Heller
"Srijit Kumar Bhadra" <[EMAIL PROTECTED]> writes: > Hello, > I am quite familiar with Mark Hammond's win32all. It is excellent. > However, I wish that there was more documentation of win32all beyond > existing PyWin32.chm. I am aware of "Python Programming on Win32" but I > do not have access to i

py_compile vs. IndentationError

2005-03-26 Thread Mr. Magoo
Why does py_compile print IndentationError in a different format than SyntaxError? It makes it harder to parse the output in a non-python program. Sorry: IndentationError: ('unindent does not match any outer indentation level', ('foo.py', 19, 17, '\t\t\t return 0.0 \n')) instead of File

Re: Grouping code by indentation - feature or ******?

2005-03-26 Thread Ron_Adam
On Fri, 25 Mar 2005 11:31:33 -0800, James Stroud <[EMAIL PROTECTED]> wrote: >On Friday 25 March 2005 08:39 am, Ivan Van Laningham wrote: >> As far as grouping by indentation goes, it's why I fell in love with >> Python in the first place.  Braces and so on are just extraneous cruft >> as far as I'

PyGreSQL binary for Windows

2005-03-26 Thread Ellinghaus, Lance
Title: PyGreSQL binary for Windows Has anyone built PyGreSQL for windows 2000 that would be willing to send me the binary version? I do not have a windows compiler and need to run it. Thank you, lance Lance Ellinghaus -- http://mail.python.org/mailman/listinfo/python-list

Re: Example Code - Named Pipes (Python 2.4 + ctypes on Windows)

2005-03-26 Thread Harald Massa
"Srijit Kumar Bhadra" <[EMAIL PROTECTED]> wrote in > Here is an example of Multithreaded Pipe Server and Client using the > excellent ctypes library (Windows). Excellent. Maybe you would also like to post it to the http://starship.python.net/crew/theller/moin.cgi/CtypesModule Ctypes-Wiki for eas

Re: html tags and python

2005-03-26 Thread gene . tani
http://diveintopython.org/file_handling/index.html really good tutorial on exceptions. The whole book is well done, in fact, I recommend it. I also like Practical Python, and the Oreilly "Learning Python", but they're not online. For production purposes, you'd still do date-check on the client

Re: Embedding Python

2005-03-26 Thread Diez B. Roggisch
Markus Franz wrote: > Diez B. Roggisch wrote: > >>>/home/mmf/tmp/ccVD2V4h.o(.text+0x1d): In function `main': >>>: undefined reference to `Py_Initialize' >>>/home/mmf/tmp/ccVD2V4h.o(.text+0x2a): In function `main': >>>: undefined reference to `PyRun_SimpleString' >>>/home/mmf/tmp/ccVD2V4h.o(.text+

Re: Embedding Python

2005-03-26 Thread Markus Franz
Diez B. Roggisch wrote: /home/mmf/tmp/ccVD2V4h.o(.text+0x1d): In function `main': : undefined reference to `Py_Initialize' /home/mmf/tmp/ccVD2V4h.o(.text+0x2a): In function `main': : undefined reference to `PyRun_SimpleString' /home/mmf/tmp/ccVD2V4h.o(.text+0x32): In function `main': : undefined re

Re: The Greatest News Ever!

2005-03-26 Thread R.Meijer
yahoo.com> writes: > > http://www.jcil.blogspot.com << The Greatest News Ever! > Wow, what a total bullshit (no offense to christians >_> ) Now, what I don't understand is what this is doing in a python newsgroup? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to ensure Maximize button shows in Linux/Unix (Tkinter)

2005-03-26 Thread Diez B. Roggisch
Harlin Seritt wrote: > Diez, > > Thanks for the quick reply. I am running this under KDE. I actually > haven't tried doing so under any other wm for the moment. Any ideas how > to get it to show in KDE? I also run kde, and it shows that maximze-button. I've no idea why that doesn't work for you.

How to ensure Maximize button shows in Linux/Unix (Tkinter)

2005-03-26 Thread Harlin Seritt
I have a tkinter program that shows the 'maximize' button while running on Windows but not in Linux. Is there a way to make it show in Linux? Thanks, Harlin Seritt -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is a JIT compiler faster than a byte-compiler

2005-03-26 Thread Alexey Shamrin
http://www-106.ibm.com/developerworks/linux/library/l-psyco.html?t=gr,lnxw03=PsycoC http://gnosis.cx/publish/programming/charming_python_b9.html On Sat, 26 Mar 2005 11:22:03 +0100, Torsten Bronger <[EMAIL PROTECTED]> wrote: > Hallöchen! > > "dodoo" <[EMAIL PROTECTED]> writes: > > > http://www-9

Re: How to ensure Maximize button shows in Linux/Unix (Tkinter)

2005-03-26 Thread Harlin Seritt
Diez, Thanks for the quick reply. I am running this under KDE. I actually haven't tried doing so under any other wm for the moment. Any ideas how to get it to show in KDE? Thanks, Harlin Seritt -- http://mail.python.org/mailman/listinfo/python-list

Re: Grouping code by indentation - feature or ******?

2005-03-26 Thread Jeremy Bowers
On Sat, 26 Mar 2005 15:42:03 +, Tim Tyler wrote: > I very much favour the smalltalk-inspired idea of keeping the actual > language as small as is reasonably possible. > > I wonder if there are any promising new kids on the dynamic > scripting-language block that I haven't heard about yet - i.e

Re: How to ensure Maximize button shows in Linux/Unix (Tkinter)

2005-03-26 Thread Diez B. Roggisch
Harlin Seritt wrote: > I have a tkinter program that shows the 'maximize' button while running > on Windows but not in Linux. Is there a way to make it show in Linux? On linux (or X-Windows in general) the windowdecorations (which maximize is a part of) are managed by the windowmanager, not the g

Re: Suggesting a new feature - "Inverse Generators"

2005-03-26 Thread Jordan Rastrick
Hmmm, I like the terminology consumers better than acceptors. The ability to have 'full coroutines', or at least more 'coroutiney behaviour' than is provided by generators alone, was I think what I was trying to get at with my original idea, although things got a bit sidetracked by the way I focus

Re: Grouping code by indentation - feature or ******?

2005-03-26 Thread Tim Tyler
Javier Bezos <[EMAIL PROTECTED]> wrote or quoted: > "Tim Tyler" <[EMAIL PROTECTED]> escribi? en el mensaje > > What do you guys think about Python's grouping of code via indentation? > > > > Is it good - perhaps because it saves space and eliminates keypresses? [...] > I particularly hate it, bu

Re: Example Code - Named Pipes (Python 2.4 + ctypes on Windows)

2005-03-26 Thread Srijit Kumar Bhadra
Hello, I am quite familiar with Mark Hammond's win32all. It is excellent. However, I wish that there was more documentation of win32all beyond existing PyWin32.chm. I am aware of "Python Programming on Win32" but I do not have access to it at present. Best Regards, /Srijit -- http://mail.python.

Re: html tags and python

2005-03-26 Thread Hansan
Hi and thanks for the replies. It is starting to make a little sense. But its still not that clear... If I import the DateTime or install and import the mx package. Where should I then change something in my code? I guess that I will have to see if the entered number is valid when the user click

Re: Grouping code by indentation - feature or ******?

2005-03-26 Thread Tim Tyler
Peter Otten <[EMAIL PROTECTED]> wrote or quoted: > I, Tim Tyler wrote: > > What do you guys think about Python's grouping of code via indentation? > > This is a Python newsgroup. Assume that we all have been brainwashed. ;-) I had a good look for comp.lang.python.advocacy before posting my ques

The Greatest News Ever!

2005-03-26 Thread Ron_Grossi_038
http://www.jcil.blogspot.com << The Greatest News Ever! -- http://mail.python.org/mailman/listinfo/python-list

ossaudiodev full duplex

2005-03-26 Thread rjm
I'm messing around with trying to record sound reflections off of various objects at different frequencies. I'm using python 2.4 on Fedora Core 3 and I have an SBLive card. Basically, I want to send some samples through a speaker and then record from an input source (the line input on the sound ca

Re: Bug in threading.Thread.join() ?

2005-03-26 Thread Peter Hansen
Peter Hansen wrote: I'll take your last sentence as a form of blessing to go file a bug report... Filed as http://sourceforge.net/tracker/index.php?func=detail&aid=1171023&group_id=5470&atid=105470 I guess it makes more sense for any further discussion to go on there... (Coincidentally, another b

Re: DBAPI Paramstyle

2005-03-26 Thread Scott David Daniels
Tim Roberts wrote: In theory, using a paramstyle allows the query to be sent to the SQL database backend and compiled like a program. Then, successive uses of the same query can be done by sending just the parameters, instead of sending the entire query string to be parsed and compiled again and a

Re: Embedding Python

2005-03-26 Thread Diez B. Roggisch
> /home/mmf/tmp/ccVD2V4h.o(.text+0x1d): In function `main': > : undefined reference to `Py_Initialize' > /home/mmf/tmp/ccVD2V4h.o(.text+0x2a): In function `main': > : undefined reference to `PyRun_SimpleString' > /home/mmf/tmp/ccVD2V4h.o(.text+0x32): In function `main': > : undefined reference to `

Re: Suggesting a new feature - "Inverse Generators"

2005-03-26 Thread Andrew Koenig
"Jordan Rastrick" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > But I'm not so much interested in alternate solutions to the problem > itself, which is to be honest trivial. I'm intereseted in the > implications of the imaginary solution of the Acceptor function. Of course. But

Re: [perl-python] limericks

2005-03-26 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Andras Malatinszky <[EMAIL PROTECTED]> wrote: > Xah Lee wrote: > > Better: > > > > there is a Python, pithy > > mighty, lissome, and tabby > > algorithms it puffs > > conundrums it snuffs > > and cherished by those savvy > > > > > > there is a camel, kooky > > u

Re: Anonymus functions revisited : tuple actions

2005-03-26 Thread Reinhold Birkenfeld
Ron_Adam wrote: > On Fri, 25 Mar 2005 18:58:27 +0100, Reinhold Birkenfeld > <[EMAIL PROTECTED]> wrote: > >>Ron_Adam wrote: >> >>> What if you could: >>> >>> x = lambda{ x, y: x+y} >>> Hmm comma creates a problem here. so... >> > from __future__ import braces >>SyntaxError: not a chance

Re: float default formatting

2005-03-26 Thread Bernard Delmée
Are you trying to do currency? There are better ways, using the locale methods. No, just dumping some data structures and I'd rather not check every item's type and format floats explicitly. I was hoping the sprintf mask float's __str__ probably uses was somehow exposed and could be altered. -- ht

Re: Python slogan, was Re: Grouping code by indentation - feature or ******?

2005-03-26 Thread Skip Montanaro
>> Or, paraphrasing Mark Twain, "Python is the worst possible >> programming language, except for all the others." Peter> I've been trying to establish that a while ago, but would Peter> attribute it to Winston Churchill -- so I'm a little confused Peter> now. Google thinks i

Re: Bug in threading.Thread.join() ?

2005-03-26 Thread Peter Hansen
Tim Peters wrote: [Peter Hansen] If you hit Ctrl-C while the join's wait() is occurring, you'll raise a KeyboardInterrupt and bypass the release() call. Then you're doing something other than what you described. Here on WinXP SP2 w/ Python 2.4c2: [snip] I can hit Ctrl+C all day at this point, and

Re: Python slogan, was Re: Grouping code by indentation - feature or ******?

2005-03-26 Thread Kent Johnson
Peter Otten wrote: Tim Roberts wrote: Or, paraphrasing Mark Twain, "Python is the worst possible programming language, except for all the others." I've been trying to establish that a while ago, but would attribute it to Winston Churchill -- so I'm a little confused now. Can you provide the text w

Re: mysteriously nonfunctioning script - very simple

2005-03-26 Thread Peter Hansen
Sean McIlroy wrote: Can anybody help me make sense of the fact that the following script doesn't work? It's so simple I can't imagine what I'm missing. Any help will be much appreciated. Always post actual tracebacks of the problem, if indeed it is producing a traceback. Do this always by *cut and

Re: regular expression

2005-03-26 Thread Peter Hansen
Bengt Richter wrote: On Fri, 25 Mar 2005 23:54:32 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: Suggestion: whip up a variety of automated test cases and make sure you run them all whenever you make changes to this code... Goes to show you ;-/ Do we need more tests than these? [snip loads of tests

Re: html tags and python

2005-03-26 Thread gene . tani
get the mx package here: http://www.egenix.com/files/python/eGenix-mx-Extensions.html#Download-mxBASE = >>> import mx.DateTime >>> print mx.DateTime.DateTime(2004,2,31) # Feb. 31? Traceback (most recent call last): File "", line 1, in ? mx.DateTime.RangeE

Re: Suggest more finesse, please. I/O and sequences.

2005-03-26 Thread Peter Hansen
Qertoip wrote: Peter Hansen wrote: -- import sys corpus = {} for word in open(sys.argv[1]).read().split(): corpus[word] = corpus.get( word, 0 ) + 1 words = reversed(sorted(data[::-1] for data in corpus.iteritems())) open(sys.argv[2], 'w').writelines('%7d : %s\n' % data f

Embedding Python

2005-03-26 Thread Markus Franz
Hi! I wanted to run some Python code from inside a C program, so I did it like it was explained in the Python manual: #include int main(int argc, char *argv[]) { Py_Initialize(); PyRun_SimpleString("print 'Hallo World!'\n"); Py_Finalize(); return 0; } Then I trie

Re: html tags and python

2005-03-26 Thread Patrik Andreasen
Hansan wrote: Hi. Yeah I also like just to be able to write in numbers. That is how it works right now. But then I will have to make some code, that validates if the day number is higher than allowed. Like if it is January, the days arnt allowed to be higher than 31. Will one be so kind and expla

Re: mysteriously nonfunctioning script - very simple

2005-03-26 Thread Piet van Oostrum
> [EMAIL PROTECTED] (Sean McIlroy) (SM) wrote: >SM> Can anybody help me make sense of the fact that the following script >SM> doesn't work? It's so simple I can't imagine what I'm missing. Any >SM> help will be much appreciated. What do you mean `it doesn't work'? -- Piet van Oostrum <[EMAIL

Re: html tags and python

2005-03-26 Thread Hansan
Hi. Yeah I also like just to be able to write in numbers. That is how it works right now. But then I will have to make some code, that validates if the day number is higher than allowed. Like if it is January, the days arnt allowed to be higher than 31. Will one be so kind and explain how I wri

Python slogan, was Re: Grouping code by indentation - feature or ******?

2005-03-26 Thread Peter Otten
Tim Roberts wrote: > Rocco Moretti <[EMAIL PROTECTED]> wrote: > >>Antoon Pardon wrote: >>> I have problems with all languages >>> currently available, so I use those which rub me wrong the least. >>> ... [I]t doesn't weight heavy enough >>> to go and use an other language, although I keeping look

Re: Why is a JIT compiler faster than a byte-compiler

2005-03-26 Thread Torsten Bronger
HallÃchen! "dodoo" <[EMAIL PROTECTED]> writes: > http://www-900.ibm.com/developerworks/cn/linux/sdk/python/charm-28/index_eng.shtml I can't reach it. Is there an alternative URL? TschÃ, Torsten. -- Torsten Bronger, aquisgrana, europa vetus -- http://mail.python.org/mailman/listinfo/python-l

Re: tree data structure

2005-03-26 Thread runsun pan
couple of links for python tree: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/217212 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/201423 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/305313 http://www.rexx.com/~dkuhlman/ -- http://mail.python.org/mailman/listinfo/

Re: DBAPI Paramstyle

2005-03-26 Thread woodsplitter
Tim Roberts wrote: > In theory, using a paramstyle allows the query to be sent to the SQL > database backend and compiled like a program. Then, successive uses of the > same query can be done by sending just the parameters, instead of sending > the entire query string to be parsed and compiled aga

Re: Suggest more finesse, please. I/O and sequences.

2005-03-26 Thread Qertoip
Dnia Fri, 25 Mar 2005 21:09:41 -0500, Peter Hansen napisał(a): Thanks for comments! :) > Qertoip wrote: >> Good friend of mine heard about my attempt to create compact, simple Python >> script and authored the following PHP script: > [snip 7-line PHP script] >> ...which has the same functionalit

Re: html tags and python

2005-03-26 Thread Tim Roberts
"Hansan" wrote: > >Hi all > >I am making something for my webpage > >Where the user can choose a month: I have made that with a dropdown box. > > >January >February >March >April >May >June >July >August >September >O

Re: Grouping code by indentation - feature or ******?

2005-03-26 Thread Javier Bezos
"Tim Tyler" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > What do you guys think about Python's grouping of code via indentation? > > Is it good - perhaps because it saves space and eliminates keypresses? > > Or is it bad - perhaps because it makes program flow dependent on >

Re: Grouping code by indentation - feature or ******?

2005-03-26 Thread Tim Roberts
Rocco Moretti <[EMAIL PROTECTED]> wrote: >Antoon Pardon wrote: >> I have problems with all languages >> currently available, so I use those which rub me wrong the least. >> ... [I]t doesn't weight heavy enough >> to go and use an other language, although I keeping looking at >> the other language

Re: float default formatting

2005-03-26 Thread Tim Roberts
Bernard Delmée <[EMAIL PROTECTED]> wrote: > >Is there a simple way to modify the default sprintf mask >used for floats ? (eg something like sys.float_mask = '%.2f') >I've tried assigning to float.__dict__[ '__str__' ], but >that's apparently not allowed. No. The mask string is passed relatively d

Re: ANN: Twisted version 2.0

2005-03-26 Thread Tim Roberts
Christopher Armstrong <[EMAIL PROTECTED]> wrote: > >Twisted 2.0 is a major upgrade, changing many things not only in the >code but also in the structure of the project. As of 2.0, Twisted was >split up into many sub-projects which you can read about in the >Twisted Split FAQ[1]. > >2.0 also marks

Re: DBAPI Paramstyle

2005-03-26 Thread Tim Roberts
Bob Parnes <[EMAIL PROTECTED]> wrote: > >I have a mediocre talent at programming, which is why I chose python. >For me it was a good choice. I note this so that I hope you understand why >I say that I don't know what you are driving at. My understanding is that a >paramstyle is more efficient than

__getslice__ passed INT_MAX rather than sys.maxint for missing endpoint?

2005-03-26 Thread Dave Huang
Hi, I don't actually know Python; I'm just trying to debug a problem I encounted in another program, so apologies if this has been covered before. I did do some Google searches though, and didn't find anything that specifically addressed this :) According to the documentation at

  1   2   >