Re: merits of Lisp vs Python

2006-12-13 Thread Lars Brinkhoff
Bill Atkins <[EMAIL PROTECTED]> writes: > the macro is just a friendlier syntax for expressing an idea. I like that phrase! -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-13 Thread Paul Rubin
Neil Cerutti <[EMAIL PROTECTED]> writes: > Is the above 'duck-typing' idiom considered very useful to a > Lisper? It seems logical to me that duck-typing works best in an > environment where it is ubiquitous. If users have to implement > accessors specifically to use your library, it is not as good

Re: merits of Lisp vs Python

2006-12-13 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Let us note that it's not FSF that gives this stuff away for free -- or > if it is them proximally, it is not them ultimately -- ultimately it's > the engineers who did all that work that gave it away for free. When I worked there, they paid me ;-)

Re: merits of Lisp vs Python

2006-12-13 Thread Paul Rubin
Bill Atkins <[EMAIL PROTECTED]> writes: > You should be pragmatic about this - I have never used a CL > implementation that didn't do TCO optimization (indeed, are there > any?). Although the standard doesn't require it, I treat it as a de > facto requirement and don't worry too much about it. I

Re: merits of Lisp vs Python

2006-12-13 Thread Juan R.
Kay Schluehr wrote: > > You mean a universal language adapter? I guess this is always possible > using alpha conversion but I don't believe this leads to theoretical or > practical interesting solutions but is just a limit concept. Not familiarized with you terminology. I think that i would call t

Re: merits of Lisp vs Python

2006-12-13 Thread Timofei Shatrov
On Wed, 13 Dec 2006 16:07:01 +1300, greg <[EMAIL PROTECTED]> tried to confuse everyone with this message: >Robert Uhl wrote: > >> o Symbols >> >> In Lisp, a symbol is essentially a hashed string; > >Are you aware that strings can be interned in Python? >Furthermore, any string literal in the sour

Re: merits of Lisp vs Python

2006-12-13 Thread tim . peters
[Bill Atkins] >> (Why are people from c.l.p calling parentheses "brackets"?) [Kaz Kylheku] > Because that's what they are often called outside of the various > literate fields. For example, the English are "outside of the various literate fields"? FWIW, Python documentation consistently uses the

Re: merits of Lisp vs Python

2006-12-13 Thread Timofei Shatrov
On 12 Dec 2006 18:03:49 -0800, "Paddy" <[EMAIL PROTECTED]> tried to confuse everyone with this message: >There are a lot of people that use Wikipedia. I think some of them >might want to learn to program. I think you misunderstood the goal of Wikipedia. It is not to teach people programming. >I

Re: Is anyone using Python for embedded applications?

2006-12-13 Thread Andre Meyer
Not sure what your target embedded platform is, but there is a Python version for the Nokia S60 mobile phone platform (Symbian). http://s60.com/ Python for S60 Python for S60 allows develop

Re: how can i write a hello world in chinese with python

2006-12-13 Thread Leo Kislov
kernel1983 wrote: > and I tried unicode and utf-8 How did you try unicode? Like this? : EasyDialogs.Message(u'\u4e2d') > I tried to both use unicode&utf-8 head just like "\xEF\xBB\xBF" and not > to use > > Anyone knows about the setting in the python code file? > Maybe python doesn't know I'm t

Re: One module per class, bad idea?

2006-12-13 Thread billie
Isaac Rodriguez wrote: > > Yes, it would be a bad idea. =) > > Saying it is a bad idea and not explaining why will not help anyone. I > would like you to elaborate on why it is a bad idea to have one file > per class. > > Thanks, > > - Isaac. Because it's just a useless limitation. Python lets y

Re: merits of Lisp vs Python

2006-12-13 Thread Juan R.
greg ha escrito: > Juan R. wrote: > > > I see no dinamism on your example, just static overloading. > > There's nothing static about it: > >q = raw_input() >if q == "A": > a = 1 > b = 2 >else: > a = "x" > b = "y" >c = a + b > > There is no way that the compiler

Re: merits of Lisp vs Python

2006-12-13 Thread Christophe
Robert Uhl a écrit : > [EMAIL PROTECTED] (Aahz) writes: >> Consider this: Lisp has had years of development, it has had millions of >> dollars thrown at it by VC firms -- and yet Python is winning over Lisp >> programmers. Think about it. > > The argument from popularity is invalid. French units

Re: About alternatives to Matlab

2006-12-13 Thread Jon Harrop
Filip Wasilewski wrote: > Jon, both Python and Matlab implementations discussed here use the > lifting scheme, while yours is a classic convolution based approach. I've done both in OCaml. The results are basically the same. > These are two *different* algorithms for computing wavelet transforms.

Re: merits of Lisp vs Python

2006-12-13 Thread Jan Dries
Christophe wrote: > Robert Uhl a écrit : >> [EMAIL PROTECTED] (Aahz) writes: >>> Consider this: Lisp has had years of development, it has had millions of >>> dollars thrown at it by VC firms -- and yet Python is winning over Lisp >>> programmers. Think about it. >> The argument from popularity is

Re: merits of Lisp vs Python

2006-12-13 Thread Rob Warnock
Raffael Cavallaro <[EMAIL PROTECTED]'espam-s'il-vous-plait-mac.com>: +--- | "George Sakkis" <[EMAIL PROTECTED]> said: | > If you mistakenly select an extra parenthesis or omit one, it's | > the same thing. | | Because you can't mistakenly select an extra paren or omit one in a | lisp-

Re: merits of Lisp vs Python

2006-12-13 Thread Paddy
On Dec 13, 8:39 am, [EMAIL PROTECTED] (Timofei Shatrov) wrote: > On 12 Dec 2006 18:03:49 -0800, "Paddy" <[EMAIL PROTECTED]> tried to confuse > everyone with this message: > > >There are a lot of people that use Wikipedia. I think some of them > >might want to learn to program. > I think you misun

Re: merits of Lisp vs Python

2006-12-13 Thread Slawomir Nowaczyk
On Wed, 13 Dec 2006 02:41:29 -0500 Raffael Cavallaro <[EMAIL PROTECTED]'espam-s'il-vous-plait-mac.com> wrote: #> On 2006-12-12 19:18:10 -0500, "George Sakkis" <[EMAIL PROTECTED]> said: #> #> > If you mistakenly select an extra parenthesis or omit one, it's #> > the same thing. #> #> Because you

call of __del__ non-deterministic in python 2.4 (cpython)?

2006-12-13 Thread Holger Joukl
Hi all, I've recently run into a problem that I haven't seen with python 1.5.2 and python 2.3. It seems that under certain conditions __del__ does not get immediately called when a local variable goes out of scope. I ended up with deadlocks in a threaded application because a locked section was

[unicode] inconvenient unicode conversion of non-string arguments

2006-12-13 Thread Holger Joukl
Hi there, I consider the behaviour of unicode() inconvenient wrt to conversion of non-string arguments. While you can do: >>> unicode(17.3) u'17.3' you cannot do: >>> unicode(17.3, 'ISO-8859-1', 'replace') Traceback (most recent call last): File "", line 1, in ? TypeError: coercing to Unicod

Re: merits of Lisp vs Python

2006-12-13 Thread Juan R.
[EMAIL PROTECTED] ha escrito: > FWIW, Python documentation consistently uses the jargon: > > () parentheses > {} braces > [] brackets > > That matches North American conventions, but occasionally confuses an > international audience (for example, the English call parentheses > "bracke

Re: About alternatives to Matlab

2006-12-13 Thread Jon Harrop
[EMAIL PROTECTED] wrote: > A concrete example of interest to me: can I get an OCaml-to-native > compiler for an IBM BlueGene? The processor is in the PowerPC family, > but it has some modifications, and the binary format is different > from standard Linux as well. No idea. OCaml has quite a good P

Re: One module per class, bad idea?

2006-12-13 Thread mystilleef
Matias Jansson wrote: > I come from a background of Java and C# where it is common practise to have > one class per file in the file/project structure. As I have understood it, > it is more common practice to have many classes in a Python module/file. > What is the motivation behind it, would it be

Re: inconvenient unicode conversion of non-string arguments

2006-12-13 Thread Leo Kislov
Holger Joukl wrote: > Hi there, > > I consider the behaviour of unicode() inconvenient wrt to conversion of > non-string > arguments. > While you can do: > > >>> unicode(17.3) > u'17.3' > > you cannot do: > > >>> unicode(17.3, 'ISO-8859-1', 'replace') > Traceback (most recent call last): > File

Re: call of __del__ non-deterministic in python 2.4 (cpython)?

2006-12-13 Thread Fredrik Lundh
Holger Joukl wrote: > Anyway: Is relying on __del__ getting called immediately when the refcount > drops to 0 a no-no? yes, but more importantly, relying on the refcount dropping to 0 when something goes out of scope is a major no-no. > If so should that maybe be prominently stated in the docs?

Re: Re: inconvenient unicode conversion of non-string arguments

2006-12-13 Thread Holger Joukl
[EMAIL PROTECTED] schrieb am 13.12.2006 11:02:30: > > Holger Joukl wrote: > > Hi there, > > > > I consider the behaviour of unicode() inconvenient wrt to conversion of > > non-string > > arguments. > > While you can do: > > > > >>> unicode(17.3) > > u'17.3' > > > > you cannot do: > > > > >>> unico

Re: Sybase module 0.38pre1 released

2006-12-13 Thread Sébastien Sablé
By the way, I forgot to say that new releases can now be downloaded from this page: https://sourceforge.net/project/showfiles.php?group_id=184050 regards -- Sébastien Sablé 2006/12/12, Sébastien Sablé <[EMAIL PROTECTED]>: > WHAT IS IT: > > The Sybase module provides a Python interface to the Sy

Re: merits of Lisp vs Python

2006-12-13 Thread Kay Schluehr
Juan R. schrieb: > Kay Schluehr wrote: > > > > You mean a universal language adapter? I guess this is always possible > > using alpha conversion but I don't believe this leads to theoretical or > > practical interesting solutions but is just a limit concept. > > Not familiarized with you terminolo

Re: merits of Lisp vs Python

2006-12-13 Thread Rob Warnock
Paul Rubin wrote: +--- | CLTL2 is a model of precision and thoroughness compared | with any document that's ever been written about Python. +--- It's a great book, but one needs to be clear that CLtL2 is *not* the same as the ANSI Common Lisp sta

Re: merits of Lisp vs Python

2006-12-13 Thread Pascal Bourguignon
Christophe <[EMAIL PROTECTED]> writes: > Robert Uhl a écrit : >> [EMAIL PROTECTED] (Aahz) writes: >>> Consider this: Lisp has had years of development, it has had millions of >>> dollars thrown at it by VC firms -- and yet Python is winning over Lisp >>> programmers. Think about it. >> >> The arg

Re: merits of Lisp vs Python

2006-12-13 Thread Christophe
[EMAIL PROTECTED] a écrit : > Bjoern Schliessmann wrote: >> Robert Uhl wrote: >> >>> Because it's the language for which indentation is automatically >>> determinable. That is, one can copy/paste a chunk of code, hit a >>> key and suddenly everything is nicely indented. >> Cool, so in other langua

Re: inconvenient unicode conversion of non-string arguments

2006-12-13 Thread Fredrik Lundh
Holger Joukl wrote: > Ok, but I still don't see why these arguments shouldn't simply be silently > ignored >>> import this -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-13 Thread hit_the_lights
Paul Rubin schrieb: > Neil Cerutti <[EMAIL PROTECTED]> writes: > > Is the above 'duck-typing' idiom considered very useful to a > > Lisper? It seems logical to me that duck-typing works best in an > > environment where it is ubiquitous. If users have to implement > > accessors specifically to use

Re: YouTube written in Python

2006-12-13 Thread Simon Brunning
On 12/13/06, Terry Reedy <[EMAIL PROTECTED]> wrote: > <[EMAIL PROTECTED]> wrote: > > Really? > > It's awful! > > Awesome? Well, it's got some pretty awful clips on it, but I don't think you can blame that on the technology. ;-) -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/s

Re: merits of Lisp vs Python

2006-12-13 Thread John Thingstad
On Wed, 13 Dec 2006 03:13:26 +0100, Paddy <[EMAIL PROTECTED]> wrote: > Not even close. > > In my example above: > for a in y: >dosomethingwith(a) > y could be a lot of built-in types such as an array, list, tuple, dict, > file, or set. > - Paddy. > I was refering to the recursive Lisp exampl

Re: Re: call of __del__ non-deterministic in python 2.4 (cpython)?

2006-12-13 Thread Holger Joukl
[EMAIL PROTECTED] schrieb am 13.12.2006 11:09:13: > Holger Joukl wrote: > > > Anyway: Is relying on __del__ getting called immediately when the refcount > > drops to 0 a no-no? > > yes, but more importantly, relying on the refcount dropping to 0 when > something goes out of scope is a major no-no.

Re: merits of Lisp vs Python

2006-12-13 Thread John Thingstad
On Wed, 13 Dec 2006 09:39:44 +0100, Timofei Shatrov <[EMAIL PROTECTED]> wrote: > On 12 Dec 2006 18:03:49 -0800, "Paddy" <[EMAIL PROTECTED]> tried to > confuse > everyone with this message: > >> There are a lot of people that use Wikipedia. I think some of them >> might want to learn to program.

Re: merits of Lisp vs Python

2006-12-13 Thread Christophe
Pascal Bourguignon a écrit : > Christophe <[EMAIL PROTECTED]> writes: > >> Robert Uhl a écrit : >>> [EMAIL PROTECTED] (Aahz) writes: Consider this: Lisp has had years of development, it has had millions of dollars thrown at it by VC firms -- and yet Python is winning over Lisp progr

Re: merits of Lisp vs Python

2006-12-13 Thread Rob Warnock
Robert Uhl <[EMAIL PROTECTED]> wrote: +--- | "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: | > I have the code here (probably not the latest bcs I left the company | > when it was acquired), let's do a little experiment, for what it's | > worth: 89727 lines of Lisp code in 131 module

Re: Re: inconvenient unicode conversion of non-string arguments

2006-12-13 Thread Holger Joukl
[EMAIL PROTECTED] schrieb am 13.12.2006 11:37:03: > Holger Joukl wrote: > > > Ok, but I still don't see why these arguments shouldn't simply be silently > > ignored > > >>> import this > > > You probably refer to "Explicit is better than implicit.". In that particular case I still think it woul

Re: inconvenient unicode conversion of non-string arguments

2006-12-13 Thread Leo Kislov
Holger Joukl wrote: > [EMAIL PROTECTED] schrieb am 13.12.2006 > 11:02:30: > > > > > Holger Joukl wrote: > > > Hi there, > > > > > > I consider the behaviour of unicode() inconvenient wrt to conversion of > > > non-string > > > arguments. > > > While you can do: > > > > > > >>> unicode(17.3) > > >

Re: merits of Lisp vs Python

2006-12-13 Thread greg
Timofei Shatrov wrote: > Are you aware that you hardly know any Lisp yet make such bold and unfounded > claims? Unless interning a string somehow gives it a property list, slot value > and function value it doesn't give you the same capabilities. I'm talking about the capability of comparing symb

slices - handy summary

2006-12-13 Thread meridian
If, like me, you're always forgetting which way around your list/seq slices need to go then worry no more. Just put my handy "slice lookupper" (TM) ) on a (large!) PostIt beside your screen and, Hey Presto! no more tediously typing a 1-9 seq into your interpreter and then getting a slice just to ch

Re: YouTube written in Python

2006-12-13 Thread [EMAIL PROTECTED]
Leif K-Brooks wrote: > Terry Reedy wrote: > > In a thread on the PyDev list, Guido van Rossum today wrote: > >> And I just found out (after everyone else probably :-) that YouTube is > >> almost entirely written in Python. (And now I can rub shoulders with > >> the developers since they're all Goo

Re: inconvenient unicode conversion of non-string arguments

2006-12-13 Thread Fredrik Lundh
Holger Joukl wrote: >>> Ok, but I still don't see why these arguments shouldn't simply be >>> silently ignored >> >> >>> import this > > You probably refer to "Explicit is better than implicit.". "Errors should never pass silently." is a better match, I think. you're trying to do an invalid

Re: Tarfile .bz2

2006-12-13 Thread Piet van Oostrum
> "Martin v. Löwis" <[EMAIL PROTECTED]> (MvL) wrote: >MvL> Jordan schrieb: >>> Not really on topic anymore but what's the method for tar.gz? >MvL> It works like .tar.bz2, except that it uses gzip (www.gzip.org) >MvL> as the compression library. The underlying compression algorithm >MvL> is L

Re: YouTube written in Python

2006-12-13 Thread [EMAIL PROTECTED]
Leif K-Brooks wrote: > Terry Reedy wrote: > > In a thread on the PyDev list, Guido van Rossum today wrote: > >> And I just found out (after everyone else probably :-) that YouTube is > >> almost entirely written in Python. (And now I can rub shoulders with > >> the developers since they're all Goo

Re: Is anyone using Python for embedded applications?

2006-12-13 Thread Paul Boddie
Hendrik van Rooyen wrote: > > It depends a *lot* on what is meant by "embedded" : Indeed. > This definition seems to cover everything from: > - a cut down PC in a non standard box, through > - a processor in a Washing Machine, to > - a bare PIC processor in a Burglar Alarm... CPython

Re: slices - handy summary

2006-12-13 Thread Dustan
meridian wrote: > If, like me, you're always forgetting which way around your list/seq > slices need to go then worry no more. Just put my handy "slice > lookupper" (TM) ) on a (large!) PostIt beside your screen and, Hey > Presto! no more tediously typing a 1-9 seq into your interpreter and > then

Re: namespace question

2006-12-13 Thread Piet van Oostrum
> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> (jssgc) wrote: >jssgc> This one works. But I suppose there must be a way to artificially >jssgc> create a new block of code, some thing like this, >jssgc> class Test: >jssgc>c = None >jssgc><>: >jssgc># Objects created here are local to

Re: merits of Lisp vs Python

2006-12-13 Thread André Thieme
Markus Triska schrieb: > Ken Tilton <[EMAIL PROTECTED]> writes: > >> I think all-rules-all-the-time Prolog is the poster boy for paradigm >> slavery. (I did try for a famous two months to use Prolog as a >> general-purpose programming language.) > > Don't expect to learn Prolog properly in so li

Re: namespace question

2006-12-13 Thread Paul Boddie
[EMAIL PROTECTED] wrote: > Yes. I want to have only one class variable called c and a and b are > required as temporary variables to calculate the value for c. > > I just found one way: > class Test: > a = 1 > b = 2 > c = a + b > del a,b Or even... a = 1 b = 2 class Test: c =

Re: paramiko public key

2006-12-13 Thread eight02645999
hg wrote: > [EMAIL PROTECTED] wrote: > > > paramiko > http://www.lag.net/paramiko/docs/ > > __str__ ? hi thanks for the tip i done up a function to generate priv/pub key pairs like this def keygen(bits,fil,password=None): k = paramiko.RSAKey.generate(bits) k.write_private_key_fil

Re: Re: inconvenient unicode conversion of non-string arguments

2006-12-13 Thread Holger Joukl
[EMAIL PROTECTED] schrieb am 13.12.2006 12:05:33: > Holger Joukl wrote: > > >>> Ok, but I still don't see why these arguments shouldn't simply be > >>> silently ignored > >> > >> >>> import this > > > > You probably refer to "Explicit is better than implicit.". > > "Errors should never pass sile

Re: newb: Creating Exception

2006-12-13 Thread Dustan
johnny wrote: > Thank you Dennis, > So when line 2, gets executed, its exception goes to do_some1_error. > And when line 3, gets executed, its exception goes to do_some2_error > and so on. > > line 1: try > line 2:do_some1 > line 3:do_some2 > line 4:do_some3 > line 5: except do_some1_

Re: newb: Creating Exception

2006-12-13 Thread Dustan
Dustan wrote: > johnny wrote: > > Documentation is not written for newbs, it's written by guys with 6yrs > > of experience FOR guys with 6yrs of experience. > > You might want to get a book on python, rather than depend on the > documentation, which is, as you say, written for more experienced > p

Re: how can i write a hello world in chinese with python

2006-12-13 Thread John Machin
Leo Kislov wrote: > kernel1983 wrote: > > and I tried unicode and utf-8 > > How did you try unicode? Like this? : > > EasyDialogs.Message(u'\u4e2d') > > > I tried to both use unicode&utf-8 head just like "\xEF\xBB\xBF" and not > > to use > > > > Anyone knows about the setting in the python code fi

Re: oo problem

2006-12-13 Thread tool69
Hi, First, let me thanks you for all your clear comments. > > This is, in my mind, both a usage and a design flaw. > > You are creating (and throwing away) instances of drawable > objects to the draw method of a paper instance. But what does > paper.draw() actually do with the

Re: Re: call of __del__ non-deterministic in python 2.4 (cpython)?

2006-12-13 Thread Anthony Baxter
On 12/13/06, Holger Joukl <[EMAIL PROTECTED]> wrote: > I did read this but didn't think it applied to my situation. I'm quite > sure that the refcount of the local variable is 1 before the local scope > is left. > So let me rephrase the question: Even if I can make sure that non of the > problemati

Re: YouTube written in Python

2006-12-13 Thread Lad
Speaking of YouTube, does anyone know how they uploads big files( 100MB) I need to solve that problem ( in Python of course) and YouTube is a good sample of that. Lad. -- http://mail.python.org/mailman/listinfo/python-list

Re: Large files uploading

2006-12-13 Thread Lad
> to use any communications protocol (including HTTP), both ends must have > programs that can talk that protocol... > Sure, but browsers have FTP support. But how to call the FTP API from Python? Lad. -- http://mail.python.org/mailman/listinfo/python-list

Re: YouTube written in Python

2006-12-13 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > awesome.Could you give the link where guido told this you need to work on your google skills: http://mail.python.org/pipermail/python-dev/2006-December/070323.html -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I edit a PythonWin path to import custom built modules???

2006-12-13 Thread BartlebyScrivener
Fredrik Lundh wrote: > Python does *not* use the Path when searching for modules; sys.path is > initialized based on the contents of PYTHONPATH, the location of the > Python executable (or PYTHONHOME), some heuristics, and certain registry > entries. Now I'm stumped. Unless it's heuristics. The

Re: About alternatives to Matlab

2006-12-13 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Jon Harrop wrote: >> I don't think you would be much happier to see totally obfuscated golf >> one-liners. > > That doesn't even make sense. Squeezing code onto one line doesn't > improve byte count. So you don't count line endings when counting bytes. ;-) Ciao,

Re: Validate XML against a set of XSD files, with Python

2006-12-13 Thread Laszlo Nagy
> Fast google query, uncheked, leads to: > > - XSV: http://www.ltg.ed.ac.uk/~ht/xsv-status.html > I tried this before. Unfortunately, xsv is not officially supported on my system (FreeBSD 6.1) :-( > - libxml : http://codespeak.net/lxml/ > Probably this is what I need to use. (However, I

Re: [unicode] inconvenient unicode conversion of non-string arguments

2006-12-13 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Holger Joukl wrote: > Der Inhalt dieser E-Mail ist vertraulich. Falls Sie nicht der angegebene > Empfänger sind oder falls diese E-Mail irrtümlich an Sie adressiert wurde, > verständigen Sie bitte den Absender sofort und löschen Sie die E-Mail > sodann. Das unerlaubte Kopie

Iterating over several lists at once

2006-12-13 Thread Gal Diskin
Hi, I am writing a code that needs to iterate over 3 lists at the same time, i.e something like this: for x1 in l1: for x2 in l2: for x3 in l3: print "do something with", x1, x2, x3 What I need to do is go over all n-tuples where the first argument is from the first list,

Re: Iterating over several lists at once

2006-12-13 Thread Fredrik Lundh
"Gal Diskin" wrote: > I am writing a code that needs to iterate over 3 lists at the same > time, i.e something like this: > > for x1 in l1: >for x2 in l2: >for x3 in l3: >print "do something with", x1, x2, x3 > > What I need to do is go over all n-tuples where the first arg

Re: binary input and memory address passing

2006-12-13 Thread Eric Carlson
Thanks Dennis and Scott for both responses. Since Dennis has slam dunked my notion of sharing memory addresses (my ignorance in computing is pretty much unbounded), I guess I will need to continue on with sharing through files. Opening up and loading the binary info into a string variable is v

Re: Iterating over several lists at once

2006-12-13 Thread Roberto Bonvallet
Gal Diskin wrote: > Hi, > I am writing a code that needs to iterate over 3 lists at the same > time, i.e something like this: > > for x1 in l1: >for x2 in l2: >for x3 in l3: >print "do something with", x1, x2, x3 What's wrong with this? [...] > I'd be very happy to receiv

newbie - HTML character codes

2006-12-13 Thread ardief
Hi sorry if I'm asking something very obvious but I'm stumped. I have a text that looks like this: Sentence 401 4.00pm — We set off again; this time via Tony's home to collect a variety of possessions, finally arriving at hospital no.3. Sentence 402 4.55pm — Tony is ushered into a side ward wit

Re: About alternatives to Matlab

2006-12-13 Thread Jon Harrop
Marc 'BlackJack' Rintsch wrote: > So you don't count line endings when counting bytes. ;-) You'd probably replace "\n" -> " " so it wouldn't affect the byte count. Anyway, I think I was using non-whitespace bytes, so neither "\n" nor " " is counted. -- Dr Jon D Harrop, Flying Frog Consultancy O

How to manage two (different) sockets without using threads?

2006-12-13 Thread billie
Hi all. I'm (re)writing an FTP server application by using asyncore/asynchat modules. FTP tipically got two different channels: command and data. I'm succesfully managing command channel through asynchat framework, but I'm not sure about how to manage data channel without using a thread/subprocess.

Re: newbie - HTML character codes

2006-12-13 Thread Roberto Bonvallet
ardief wrote: [...] > And I want the HTML char codes to turn into their equivalent plain > text. I've looked at the newsgroup archives, the cookbook, the web in > general and can't manage to sort it out. I thought doing something like > this - > > file = open('filename', 'r') It's not a good idea

Re: newbie - HTML character codes

2006-12-13 Thread Fredrik Lundh
"ardief" wrote: > sorry if I'm asking something very obvious but I'm stumped. I have a > text that looks like this: > > Sentence 401 > 4.00pm — We set off again; this time via Tony's home to collect > a variety of possessions, finally arriving at hospital no.3. > Sentence 402 > 4.55pm — Tony is

Re: Large files uploading

2006-12-13 Thread Jussi Salmela
Lad kirjoitti: >> to use any communications protocol (including HTTP), both ends must have >> programs that can talk that protocol... >> > Sure, but browsers have FTP support. But how to call the FTP API from > Python? > Lad. > See Python Library Reference for documentation on 'ftplib -- FTP prot

Re: Iterating over several lists at once

2006-12-13 Thread Paul Rubin
"Gal Diskin" <[EMAIL PROTECTED]> writes: > I am writing a code that needs to iterate over 3 lists at the same > time, i.e something like this: > > for x1 in l1: > for x2 in l2: > for x3 in l3: > print "do something with", x1, x2, x3 This does look a little kludgy (unteste

Re: Iterating over several lists at once

2006-12-13 Thread Peter Otten
Gal Diskin wrote: > I am writing a code that needs to iterate over 3 lists at the same > time, i.e something like this: > for x1 in l1: > for x2 in l2: > for x3 in l3: > print "do something with", x1, x2, x3 > I was wondering if one could write this more easily in some ma

Re: Iterating over several lists at once

2006-12-13 Thread Gal Diskin
Nothing seriously wrong, but it's not too elegent. Especially when the number of lists you want to iterate over gets bigger (especially because of the indentation in python). As you noticed (an phrased better than me), what I was wondering is if there is a way to iterate over the cartesian product,

Re: Iterating over several lists at once

2006-12-13 Thread Kay Schluehr
Gal Diskin schrieb: > Hi, > I am writing a code that needs to iterate over 3 lists at the same > time, i.e something like this: > > for x1 in l1: > for x2 in l2: > for x3 in l3: > print "do something with", x1, x2, x3 > > What I need to do is go over all n-tuples where the

Conditional iteration

2006-12-13 Thread at
I would like to spark the discussion about the following syntax problem I encounter. THE PROBLEM I have a lot times the following code: for x in [-2, -1, 0, 1, 2, 3, 4]: if x > 0: ... more code... It is not the addional line containing 'if x > 0:' that bothers me, but

Re: Iterating over several lists at once

2006-12-13 Thread Gal Diskin
Thanks, that's an improvment (your first way). But I still wish I could find an even shorter (or more elegent) way of doing it. (Well, I guess if I expect every wish I have to come true I should at least wish for something more valuable.) Thanks again, Gal On Dec 13, 3:58 pm, "Fredrik Lundh" <[EM

Re: Conditional iteration

2006-12-13 Thread Giovanni Bajo
at wrote: > THE PROBLEM > > I have a lot times the following code: > > for x in [-2, -1, 0, 1, 2, 3, 4]: > if x > 0: > ... more code... > > > It is not the addional line containing 'if x > 0:' that bothers me, but the > additional indentation. for x in ...: if not x

Re: Frame hacking

2006-12-13 Thread George Sakkis
George Sakkis wrote: > Gabriel Genellina wrote: > > On 12 dic, 17:46, "George Sakkis" <[EMAIL PROTECTED]> wrote: > > > > > I wonder if the following is possible: > > > > > > def inject_n_call(func, **kwds): > > > '''Call func by first updating its locals with kwds.''' > > > > > > def f(): > > >

Re: Validate XML against a set of XSD files, with Python

2006-12-13 Thread Sébastien Boisgérault
On Dec 13, 2:28 pm, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > > Fast google query, uncheked, leads to: > > > - XSV:http://www.ltg.ed.ac.uk/~ht/xsv-status.htmlI tried this before. > > Unfortunately, xsv is not officially supported on > my system (FreeBSD 6.1) :-(> - libxml :http://codespeak.net

Re: newbie - HTML character codes

2006-12-13 Thread ardief
thank you both - in the end I used recode, which I wasn't aware of. Fredrik, I had come across your script while googling for solutions, but failed to make it work On Dec 13, 2:21 pm, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > "ardief" wrote: > > sorry if I'm asking something very obvious bu

Re: Conditional iteration

2006-12-13 Thread Roberto Bonvallet
at wrote: > More pythonic in view would be: > > for x in [-2, -1, 0, 1, 2, 3, 4] if x > 0: >... more code ... Pythonic? Do you realize that Python hasn't even adopted well-known statements like 'switch' and 'do while' because they would be redundant? This could be more convenient to you

Re: not a big deal or anything, but, curiously:

2006-12-13 Thread Jussi Salmela
Tim Peters kirjoitti: > [Simon Schuster] >> following this tutorial, > > Which tutorial? He's reading this tutorial which he was already advised not to do: === === === Simon Sc

Re: Large files uploading

2006-12-13 Thread Fredrik Lundh
Lad wrote: >> to use any communications protocol (including HTTP), both ends must have >> programs that can talk that protocol... >> > Sure, but browsers have FTP support. ftp upload support ? > But how to call the FTP API from Python? if you want the users to upload things using FTP, why do *y

Re: Conditional iteration

2006-12-13 Thread Neil Cerutti
On 2006-12-13, Roberto Bonvallet <[EMAIL PROTECTED]> wrote: > at wrote: >> More pythonic in view would be: >> >> for x in [-2, -1, 0, 1, 2, 3, 4] if x > 0: >>... more code ... > > Pythonic? Do you realize that Python hasn't even adopted > well-known statements like 'switch' and 'do while'

Re: Conditional iteration

2006-12-13 Thread Paul Rubin
at <[EMAIL PROTECTED]> writes: > I have a lot times the following code: > > for x in [-2, -1, 0, 1, 2, 3, 4]: > if x > 0: > ... more code... Use: for x in (x in [-2, -1, 0, 1, 2, 3, 4] if x > 0): ... more code ... -- http://mail.python.org/mailman/listinfo/python-

Re: Sybase module 0.38pre1 released

2006-12-13 Thread vasudevram
Sébastien Sablé wrote: > By the way, I forgot to say that new releases can now be downloaded > from this page: > > https://sourceforge.net/project/showfiles.php?group_id=184050 > > regards > > -- > Sébastien Sablé > Thanks. Vasudev -- http://mail.python.org/mailman/listinfo/python-list

Re: Conditional iteration

2006-12-13 Thread Chris Mellon
On 13 Dec 2006 07:47:23 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > at <[EMAIL PROTECTED]> writes: > > I have a lot times the following code: > > > > for x in [-2, -1, 0, 1, 2, 3, 4]: > > if x > 0: > > ... more code... > > Use: > > for x in (x in [-2, -1, 0,

Re: Large files uploading

2006-12-13 Thread Istvan Albert
Lad wrote: > Or is there another way( besides FTP) how to upload large files to > server? You can upload via http. The primary problem is that the browser don't work well with large uploads (give little feedback on the process, IE may hang etc). You can workaround some limitations by using apple

Re: merits of Lisp vs Python

2006-12-13 Thread Robert Uhl
"George Sakkis" <[EMAIL PROTECTED]> writes: > > Why is selecting a valid s-expression easier than selecting a python > block ? If you mistakenly select an extra parenthesis or omit one, it's > the same thing. Having said that, I find this problem is mostly > academic in both languages with modern e

Re: Iterating over several lists at once

2006-12-13 Thread Maksim Kasimov
Hi, if you "needs to iterate over 3 lists at the same" and according your example > for (x1,x2,x3) in (l1,l2,l3): > print "do something with", x1, x2, x3 i has guessed that you need this (may be i was wrong): a = (1,2,3, 1) b = (4,5,6) c = (7,8,9, 2, 3) for x, y, z in zip(a, b, c):

Re: Frame hacking

2006-12-13 Thread fumanchu
George Sakkis wrote: > Actually I thought about this and it would be more convenient in my > case if I could change the "signature" of f to "def f(x,y)" so that I > can pass positional arguments instead of a keywords (don't ask why). > I've tried creating a new code object by tweaking co_varnames,

Logging module: problem with some mapping keys

2006-12-13 Thread Tekkaman
I'm getting a strange behaviour from the "pathname" and "lineno" formatter mapping keys. Instead of my file and my line number I get: /usr/lib/python2.4/logging/__init__.py as the file, and 1072 as the line number. I set up my config as follows: logBaseConf = { 'level' : logging.DEBUG,

Re: How to manage two (different) sockets without using threads?

2006-12-13 Thread Maksim Kasimov
Hi, i don't know how to do it with asyncore/asynchat, but it is possible to handle different sockets in one process by using "select" standard module: for_reading, for_writing, where_errors =\ select.select( ( ), ( ), (), 0) you can find all necessary information in python

Please donate to the Python Software Foundation

2006-12-13 Thread sdeibel
Hi, I'm writing to urge members of the Python community to please keep the Python Software Foundation in mind in your "year end giving". The PSF is the 501(c)3 non-profit organization that holds and protects the intellectual property rights behind Python. We deal with the licensing, contribu

  1   2   3   >