Grant Edwards enlightened us with:
> It sounds like you ran a computer user training department. I don't
> think it could be called computer science.
Being a computer science student at the University of Amsterdam, I can
tell you that it definitely should not be called "computer science".
> I ca
Forgot to mention: Download pyparsing at
http://pyparsing.sourceforge.net.
-- Paul
--
http://mail.python.org/mailman/listinfo/python-list
bandw wrote:
> Robert,
>
> Thanks for your reply. However, I am still having problems. Sometimes
> I get a scalar return
> and sometimes I get an array. For example, using the netCDF file:
>
> netcdf simple {
>dimensions:
>num = 3 ;
>variables:
>float temp0(num)
Brian van den Broek wrote:
> Hi all,
>
> I guess it is more of a maths question than a programming one, but it
> involves use of the decimal module, so here goes:
>
> As a self-directed learning exercise I've been working on a script to
> convert numbers to arbitrary bases. It aims to take any of w
On 7/5/05, Guy Lateur <[EMAIL PROTECTED]> wrote:
> > I just tried this and it failed with IP addresses but not
> > hostnames/machine names, try it again with the server name. :)
>
> Nope, same problem. I think TJG might be right, and our server probably
> doesn't have IMAP running (yet).
Could y
[EMAIL PROTECTED] wrote:
> When I try to import gtk, or even start some programs that use Python I
> get the error:
>
> "ImportError: /usr/lib/python2.4/site-packages/gtk-2.0/gobject.so:
> undefined symbol: PyUnicodeUCS4_AsUnicode"
>
> Can anyone shed some light on this?
>
> FWIW, I have reinsta
Peter Hansen <[EMAIL PROTECTED]> writes:
> Tom Anderson wrote:
>> +1 insight of the century. This is the heart of the unix way - lots
>> of simple little programs that do exactly one thing well, and can be
>> composed through simple, clean interfaces. For actually getting
>> things done, a toolkit
"Devan L" wrote:
> def flatten(iterable):
> if not hasattr(iterable, '__iter__'):
> return [iterable]
> return sum([flatten(element) for element in iterable],[])
> Recursion makes things so much shorter.
The last line can faster and more compact by:
from itertools import imap
de
Rocco Moretti <[EMAIL PROTECTED]> writes:
> John Roth wrote:
> > "Peter Maas" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >
> >> George Sakkis schrieb:
> >>
> >>> Given that the latest 2.x python will be 2.9
> >>
> >>
> >> Why not 2.13 or 2.4711? Version strings are sequences
"Tim Williams (gmail)" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
> Could you SMTP it back in ? It would gain an extra Received: header
> but the rest of the email would most likely be unaltered.
I don't understand what you mean. How does this have to do with connecting
to
Hello All.
First, I'd like to thank you all for the tremendous help I've received in
the past while posting here. I'd like to ask another question.
I'd like to use Python to invoke ffmpeg to encode some still-frames into
an animation. I'd like to use MySQL to store the frames as a BLOB objec
thank you George!!!
THIS is what I was looking for :)
Peace.
Vibha
From: "George Sakkis" <[EMAIL PROTECTED]>
To: python-list@python.org
Date: 5 Jul 2005 12:43:26 -0700
Subject:Re: Python Regular Expressions: re.sub(regex,
replacement, subject)
Plain Text Attachment [ Download Fi
"guy lateur" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
|
| "Tim Williams (gmail)" <[EMAIL PROTECTED]> schreef in bericht
| news:[EMAIL PROTECTED]
| > Could you SMTP it back in ? It would gain an extra Received: header
| > but the rest of the email would most likely be unalte
On Tue, 5 Jul 2005, Terry Hancock wrote:
> Having said that, I too will miss the *concept* of an anonymous
> function, although I wouldn't mind at all if its name changed, or if it
> were somehow integrated into the "def" keyword's usage. Using backticks
> or some other syntax delimiter also s
On Tue, 5 Jul 2005, Terry Hancock wrote:
> Really, the only *right* thing to do is to raise an exception ASAP after
> the NaN comes up.
That sounds like a very good idea.
Are there any uses for NaN that aren't met by exceptions?
tom
--
[Philosophy] is kind of like being driven behind the sof
Christopher Subich wrote:
>Francois De Serres wrote:
>
>
>>- so, on callback, I create a new thread, after checking that the
>>previous one has returned already (WaitOnSingleObject(mythread)) so we
>>only have one thread involved.
>>
>>
>
>Uh... to me, this looks like a frighteningly ineff
Sybren Stuvel ha scritto:
>>If using Vim it would be something like "set softtabstop=4".
>
>
> This gives you a mixture of tabs and spaces, which I don't like. I'd
> rather use real tabs for indenting. If you then use another tab width,
> you only see a wider indent, but the rest of the code is o
I've been reading the beloved Paul Graham's "Hackers and Painters".
He claims he developed a web app at light speed using Lisp and lots
of macros.
It got me curious if Lisp
is inherently faster to develop complex apps in. It would seem if you
could create your own language in Lisp using macros th
Hello all,
If this isn't the correct newsgroup, please redirect me.
I'm trying to extract the song length from variable bit rate mp3's.
Does anyone know of a library or bit of code that will do this? I've
tried pymad, but it seems to grab the bitrate of the first frame and
then apply that to the
Bah, sorry about the incorrect email and name!
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> I've been reading the beloved Paul Graham's "Hackers and Painters".
> He claims he developed a web app at light speed using Lisp and lots
> of macros.
>
> It got me curious if Lisp
> is inherently faster to develop complex apps in. It would seem if you
> could create y
Very hard to say.
LISP has OOP too, Google for CLOS.
Operator overloading is something to avoid anyway, IMHO, just like
static typing is something to avoid if you need fast development, on
schedule and the like.
LISP has one thing that Python does not have: LISP code is LISP data.
A thorough stu
hi,
although Dive into Python is a *very, very* good Python book (I own the
"real" book) I would not recommend it as your first book to learn
Python. Take a look at Practical Python by Hetland first for instance,
it will teach you all the basic stuff. Then move over to Dive
into Python and also co
Hi All--
Tom Anderson wrote:
>
> I understand that the backslash is popular in some ivory-tower functional
> languages. Currently, a backslash can be used for explicit line joining,
> and is illegal elsewhere on a line outside a string literal, so i think
> it's available for this. It would be ut
[EMAIL PROTECTED] wrote:
> I've been reading the beloved Paul Graham's "Hackers and Painters".
> He claims he developed a web app at light speed using Lisp and lots
> of macros.
>
> It got me curious if Lisp
> is inherently faster to develop complex apps in. It would seem if you
> could create yo
Hi my name is Andrew beginning/intermediate Python User. I am using a
win xp computer Python 2.4
I would like to write a python application that would allow me to view
paths of all installed files and registry values associated with that
file for example I enter the file C:\WINDOWS\iexplorer.ex
Thanks again. I will take your advice. My concern is in not knowing
where in all
my python code I am assuming a scalar return in certain circumstances.
But I
guess I can take care of the errors as they come up.
Fred
--
http://mail.python.org/mailman/listinfo/python-list
I think you'll have to go through extensions:
http://starship.python.net/crew/mhammond/
Regards,
Philippe
Kakushi wrote:
> Hi my name is Andrew beginning/intermediate Python User. I am using a
> win xp computer Python 2.4
>
> I would like to write a python application that would allow me to
Tom Anderson wrote:
> The trouble with these is that they make a lot of temporary lists -
> George's version does it with the recursive calls to flatten, and Ron's
> with the slicing and concatenating. How about a version which never
> makes new lists, only appends the base list? We can use rec
[EMAIL PROTECTED] (Roy Smith) writes:
(...)
> We've got code coveage tools. This is a testing tool. You keep
> running tests and it keeps track of which lines of code are executed
> (i.e. which logic branches are taken). One theory of testing says you
> should keep writing test cases until you'
> Well, his Viaweb company was founded in about '95, right? So he probably just
> used Lisp because Python wasn't as well known yet. ;-)
David
That is what I thought too. It makes sense but I wasn't sure. Still
ain't.
The problem is that questions like 'What lang is fastest to develop
in?'
are
> Ok... How about a non-recursive flatten in place? ;-)
>
> def flatten(seq):
> i = 0
> while i!=len(seq):
> while isinstance(seq[i],list):
> seq.__setslice__(i,i+1,seq[i])
> i+=1
> return seq
>
> seq = [[1,2],[3],[],[4,[5,6]]]
> print flatten(seq)
>
> I
[EMAIL PROTECTED] wrote:
> The problem is that questions like 'What lang is fastest to develop
> in?' are hard to answer definitively.
That's because the answer depends on lots of context such what is the
problem domain and who is the programmer. Really, it's an impossible
question to answer.
I've been reading Deitel's Introducing Python, and Fredrik Lundh's
Introduction to Tkinter, trying to familiarize myself with Python and
GUI design in Tk, and I've run into a puzzling problem. I'm trying to
draw a column of 10 checkboxes, each with a separate variables and
commands. The easy way to
Hi Michael,
Thanks for taking a careful look, and thanks for the balanced analysis!
Michael Chermside wrote:
> A better name would help with this.
OK. After getting so many beatings I'd agree to anything. :)
> The need for locals() is unavoidable.
It is in fact not unavoidable. I pointed to my
On Tuesday 05 July 2005 04:11 pm, MooMaster wrote:
> self.InUse =[BooleanVar(), BooleanVar(), BooleanVar(), BooleanVar(),
> BooleanVar(), BooleanVar(), BooleanVar()]
>
for i in range(1,11):
for t in range(7):
if(t==0):
Checkbutton(self.frame2
On Tuesday 05 July 2005 04:11 pm, MooMaster wrote:
> self.InUse =[BooleanVar(), BooleanVar(), BooleanVar(), BooleanVar(),
> BooleanVar(), BooleanVar(), BooleanVar()]
>
for i in range(1,11):
for t in range(7):
if(t==0):
Checkbutton(self.frame2
Hi,
I have the following question:
l = ['ABCDE','FGHI']
l[1:] #returns ['FGHI']
l[1:][0] #return 'FGHI'
a = l[1:][0] + 'J' #a becomes 'FGHIJ'
l[1:][0] += 'J' #NO ERROR BUT l[1:][0] == 'FGHI'
What am I missing ?
Thanks,
Philippe
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 05 Jul 2005 09:46:41 -0500, Terry Hancock wrote:
> On Tuesday 05 July 2005 08:17 am, Steven D'Aprano wrote:
>> Sorry, but you are mistaken. "lambda" is a _reserved_ word in the
>> Python language, while "function" etc are not, but they are certainly
>> part of the language. Try explaining
On Tue, 05 Jul 2005 10:10:47 -0500, Terry Hancock wrote:
> I have to mention that the idea of a math package that
> allows NaN to propagate as though it were a number
> scares the willies out of me. God help me if I were to use
> it on something like Engineering where lives might
> depend on th
right, I'm basically drawing a table with 3 columns, and I want
checkboxes when we are at column 0. In columns 1-3 I will want Entries
and Labels, but I always want checkboxes @ column 0.
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 05 Jul 2005 12:11:47 -0700, mcherm wrote:
> And besides, "def" isn't a "magic" word... it's an abreviation for
> "define"...
Really? I thought it was an abbreviation for "definition". As in,
"definition of MyFunc is..."
> I hope that any student who didn't understand a word as
> common
UhmI'm a dunce. Thanks James!
--
http://mail.python.org/mailman/listinfo/python-list
UhmI'm a dunce. Obviously having it only use t[0] is going to make
it cleverly look like I'm using different variables, when in fact I'm
not. Thanks James!
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 5 Jul 2005, Ron Adam wrote:
> Tom Anderson wrote:
>
>> The trouble with these is that they make a lot of temporary lists -
>> George's version does it with the recursive calls to flatten, and Ron's
>> with the slicing and concatenating. How about a version which never
>> makes new lists
Philippe C. Martin wrote:
> l = ['ABCDE','FGHI']
Okay so far...
> l[1:] #returns ['FGHI']
Which is a _copy_ (via slicing) of part of the list. Another way of
saying this is that it is a _new_ list which has a copy of the
references from the appropriate part of the old list.
Try "l[1:] is l[1
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> I've been reading the beloved Paul Graham's "Hackers and Painters".
> He claims he developed a web app at light speed using Lisp and lots
> of macros.
>
> It got me curious if Lisp
> is inherently faster to develop complex apps in. It would seem
This is what I've got... the code should work on a typical Windows
system, I think...
import os
import random
import time
# I'm not sure what to expect for Win98, WinME, etc. I've
# only tried it with xp...
if os.name in ['nt', 'win98', 'me']:
osW
Grant Edwards wrote:
> [EMAIL PROTECTED] wrote:
>> So I'd say that it's a pretty obscure name that most people
>> wouldn't know.
>
> I can't believe that anybody with any computer science
> background doesn't know it.
Perhaps this reflects on the quality of education in the United States
;) but
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote:
> On Tue, 05 Jul 2005 09:46:41 -0500, Terry Hancock wrote:
[snip]
> > Having said that, I too will miss the *concept* of an anonymous
> > function, although I wouldn't mind at all if its name changed, or if it
> > were somehow integrated into the "def"
"Tom Anderson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I guess setslice is a lot faster than i thought.
Nope, the example is too short to be meaningful.
> How are python lists
> implemented? Presumably not as straightforward arrays, where inserting a
> bunch of items at th
Terrance N. Phillip wrote:
> This is what I've got... the code should work on a typical Windows
> system, I think...
> if os.name in ['nt', 'win98', 'me']:
> osWindows = True
> else:
> osWindows = False
[snip]
> if os_type = 'W':
I think you might have a problem with the above, where
"Steven Bethard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> OTOH, I fully agree with Peter Hansen: "Really, the name is such a
> trivial, unimportant part of this whole thing that it's hardly worth
> discussing."
>From a certain viewpoint, I would agree. Yet, the word 'lambda
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
>> Well, his Viaweb company was founded in about '95, right? So he probably just
>> used Lisp because Python wasn't as well known yet. ;-)
>
> David
>
> That is what I thought too. It makes sense but I wasn't sure. Still
> ain't.
> The problem is t
"George Sakkis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Still it's hard to explain why four specific python keywords - def,
> del, exec and elif - were chosen to be abbreviated,
Precedence in other languages and CS usage?
> So, who would object the full-word versions for p
Thanks, I though it was a reference (tough to implement I'm sure)
Regards,
Philippe
Peter Hansen wrote:
> Philippe C. Martin wrote:
>> l = ['ABCDE','FGHI']
>
> Okay so far...
>
>> l[1:] #returns ['FGHI']
>
> Which is a _copy_ (via slicing) of part of the list. Another way of
> saying this
you probably want
if sys.platform == 'win32':
instead of
if os.name in ['nt', 'win98', 'me']:
-Chris
On 7/5/05, Terrance N. Phillip <[EMAIL PROTECTED]> wrote:
> This is what I've got... the code should work on a typical Windows
> system, I think...
>
>
Tom Anderson wrote:
>
> We really ought to do this benchmark with a bigger list as input - a few
> thousand elements, at least. But that would mean writing a function to
> generate random nested lists, and that would mean specifying parameters
> for the geometry of its nestedness, and that wou
I guess my slicing was wrong, l[-1] worked
Regards,
Philippe
--
http://mail.python.org/mailman/listinfo/python-list
Patch / Bug Summary
___
Patches : 348 open ( +4) / 2879 closed ( +4) / 3227 total ( +8)
Bugs: 898 open ( +1) / 5103 closed ( +9) / 6001 total (+10)
RFE : 193 open ( +2) / 170 closed ( +0) / 363 total ( +2)
New / Reopened Patches
__
tarfile.p
I'd like to dynamically find and invoke a method in a Python CGI.
In javascript, the running script is 'this' (Python's 'self'), except
that 'self' is not defined.
I want to do this:
var m = this["MethodName"]; //where the method name is passed via an
http variable
m(); //this invokes a method
Devan L wrote:
> Claiming that sum etc. do the same job is the whimper of
> someone who doesn't want to openly disagree with Guido.
>
> Could you give an example where sum cannot do the job(besides the
> previously mentioned product situation?
Here's a couple of examples from my own code:
# from
BAOW is a lightweight content manage system based on python language
and SQL database, help you to develop complex web applications.
= Highlights =
* BBS or forum system, like phpBB.
* Documents manage.
* News manage.
* Private messages.
* with some Wiki or Blog features.
* use MoinMoin Wik
[EMAIL PROTECTED] wrote:
> I'd like to dynamically find and invoke a method in a Python CGI.
>
> In javascript, the running script is 'this' (Python's 'self'), except
> that 'self' is not defined.
>
> I want to do this:
>
> var m = this["MethodName"]; //where the method name is passed via an
>
[EMAIL PROTECTED] wrote:
> I'd like to dynamically find and invoke a method in a Python CGI.
getattr(self, methodName)()
But make sure to validate user input first, of course.
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] enlightened us with:
> var m = this["MethodName"];
> m(); //this invokes a method in javascript
>
> How do I do the same in python?
getattr. Read the documentation, it's all in there.
Sybren
--
The problem with the world is stupidity. Not saying there should be a
capital punis
Dan Bishop wrote:
> There's also the issue of having to rewrite old code.
It's Python 3000. You will have to rewrite old code regardless if reduce
stays.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richar
Donnal Walter wrote:
> Each "presenter" (instance) needs its own "view" (instance). The class
> attribute references a wxPython class. The resulting instance attribute
> references a wxPython object (widget or container).
This is a reasonable idea, but it would be less confusing
to give the cla
[EMAIL PROTECTED] wrote:
> I'd like to dynamically find and invoke a method in a Python CGI.
>
boundmeth = obj.meth # nb: no ()
# stuff.
boundmeth() # call it, with args if needed
--
http://mail.python.org/mailman/listinfo/python-list
Peter Hansen wrote:
> Jeffrey Maitland wrote:
> > I was hoping that python would allow for the cpu threading such in
> > Java etc.. but I guess not. (from the answers,and other findings) I
> > guess I will have to write this part of the code in something such as
> > java or c or something that allo
Terry Reedy wrote:
> I also suspect that the years of fuss over Python's lambda being what it is
> rather that what it is 'supposed' to be (and is in other languages) but is
> not, has encourage Guido to consider just getting rid of it. I personally
> might prefer keeping the feature but using
Terry Reedy wrote:
> "George Sakkis" <[EMAIL PROTECTED]> wrote in message
>>So, who would object the full-word versions for python 3K ?
>>def -> define
>>del -> delete
>>exec -> execute
>
>
> These three I might prefer to keep.
>
>
>>elif -> else if
>
>
> This one I dislike and would prefer
I was going to drop the lambda discussion, as it has
been going on and on and on, but Terry's comment
strikes me as so wrong that it needs to be challenged.
Terry Reedy wrote:
> From a certain viewpoint, I would agree. Yet, the word 'lambda' *is* the
> center of most of the fuss. For beginne
Robert Kern wrote:
> Dan Bishop wrote:
>
>> There's also the issue of having to rewrite old code.
>
>
> It's Python 3000. You will have to rewrite old code regardless if reduce
> stays.
>
And from what I understand Python 2.x will still be maintained and
supported. It will probably be more
Jp Calderone wrote:
> fileIter = iter(big_file)
> for line in fileIter:
> line_after = fileIter.next()
>
> Don't mix iterating with any other file methods, since it will confuse the
> buffering scheme.
>
Isn't a file an iterable already?
[GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)]
sorry lost the first line in pasting:
Python 2.4.1 (#1, Jun 21 2005, 12:38:55)
:/
--
http://mail.python.org/mailman/listinfo/python-list
On Tuesday 05 July 2005 06:57 pm, Steven D'Aprano wrote:
> On Tue, 05 Jul 2005 12:11:47 -0700, mcherm wrote:
>
> > And besides, "def" isn't a "magic" word... it's an abreviation for
> > "define"...
>
> Really? I thought it was an abbreviation for "definition". As in,
> "definition of MyFunc is..
On Tuesday 05 July 2005 10:04 am, jwaixs wrote:
> The python re module is, in my opinion, a non beginner user friendly
> module. And it's not meant for beginning python programmers. I don't
> have any experience with perl or related script/programming languages
> like python. (I prefer to do things
Terry Hancock wrote:
> It's a generalization rather than a specialization:
>
> double (or couple)
> triple
> quadruple
> quintuple
> sextuple
> septuple
> octuple
> nontuple
> ...
>
> Maybe a wee bit less obvious, but still understandable.
The general form is explicitly called an "n-tuple" or "
On Tuesday 05 July 2005 03:53 pm, Renato Ramonda wrote:
> Why not use just spaces? Vim simplifies this immensely:
>
> set tabstop=4
> set shiftwidth=4
> set expandtab
> set smarttab
> set autoindent
>
> AFAICT this gives me all spaces, 4 spaces indent, tab inserts spaces and
> backspace over a b
101 - 180 of 180 matches
Mail list logo