Re: Set builtin lookups

2007-06-26 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Evan Klitzke wrote: > I have a question about the internal representation of sets in Python. > If I write some code like > > if x in some_list: > do_something() > > the lookup for the in statement is O(n), where n is the number of > elements in the list. Is this also

Set builtin lookups

2007-06-26 Thread Evan Klitzke
I have a question about the internal representation of sets in Python. If I write some code like if x in some_list: do_something() the lookup for the in statement is O(n), where n is the number of elements in the list. Is this also true if I am using a set or are sets represented by a hash ta

Re: ElementTree -- adding one structure to another?

2007-06-26 Thread Jan Danielsson
Jan Danielsson wrote: >If have an element tree representing an XML document, and I load > another tree from a file, is there an easy way to stick the second tree > into the first one? > >fooElement = ET.SubElement(...) > >tree = ET.parse(TEMPLDIR + '/welcome.xml') >elem = tree.get

ElementTree -- adding one structure to another?

2007-06-26 Thread Jan Danielsson
If have an element tree representing an XML document, and I load another tree from a file, is there an easy way to stick the second tree into the first one? fooElement = ET.SubElement(...) tree = ET.parse(TEMPLDIR + '/welcome.xml') elem = tree.getroot() Now I want to stick elem as

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-26 Thread Douglas Alan
Paul Rubin writes: > Douglas Alan <[EMAIL PROTECTED]> writes: >> > In the Maclisp era functions like mapcar worked on lists, and >> > generated equally long lists in memory. >> I'm aware, but there were various different mapping functions. "map", >> as opposed to "map

Re: How to destroy a Frame with condition

2007-06-26 Thread Gabriel Genellina
En Wed, 27 Jun 2007 01:39:22 -0300, senthil arasu <[EMAIL PROTECTED]> escribió: > In my code logic I need to check the frame existence and then destroy a > frame. > I dont know how to code this condition. > In Python tutorials what i reffered, "if "condition given only for > integers(like if x>

Re: New Thread- Supporting Multiline values in ConfigParser

2007-06-26 Thread Gabriel Genellina
En Wed, 27 Jun 2007 01:35:27 -0300, O.R.Senthil Kumaran <[EMAIL PROTECTED]> escribió: > * Gabriel Genellina <[EMAIL PROTECTED]> [2007-06-25 22:26:47]: > >> And how would you detect a multiline value? >> Because it is not a section nor looks like a new option? >> >> I'd try using this: >> >> if n

Re: p & br using ElementTree?

2007-06-26 Thread Gabriel Genellina
En Wed, 27 Jun 2007 01:12:10 -0300, Jan Danielsson <[EMAIL PROTECTED]> escribió: >This is probably a mind numbingly brain dead question.. But how do I > generate the following: > > Current date:2000-01-01 > >..using ElementTree? The element kind of needs two text blocks, > as far as I c

Re: ANN: YahooQuote 0.1.0

2007-06-26 Thread Kjell Magne Fauske
On Jun 27, 2:21 am, Maurice LING <[EMAIL PROTECTED]> wrote: > Hi David, > > I can't download from your > linkhttp://www.freenet.org.nz/python/yahooquote/YahooQuote-0.1.tar.gz > > Cheers > maurice > The correct download link seems to be: http://www.freenet.org.nz/python/yahooquote/YahooQuote-0.1.0

Re: p & br using ElementTree?

2007-06-26 Thread Jan Danielsson
Robert Kern wrote: [---] >> Current date:2000-01-01 [---] > Use the .tail attribute on the br element: > > In [1]: from xml.etree import ElementTree as ET > > In [4]: p = ET.Element('p') > > In [5]: p.text = 'Current date:' > > In [6]: br = ET.SubElement(p, 'br') > > In [7]: br.tail = '2000-01

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-26 Thread Douglas Alan
Paul Rubin writes: > Andy Freeman <[EMAIL PROTECTED]> writes: >> Compare that with what a programmer using Python 2.4 has to do if >> she'd like the functionality provided by 2.5's with statement. Yes, >> with is "just syntax", but it's extremely useful syntax, syntax

PyKQueue

2007-06-26 Thread Adam Atlas
Does anyone have a copy of PyKQueue 2.0 around? The site it's supposed to be on (http://python-hpio.net/trac/wiki/PyKQueue) is down. -- http://mail.python.org/mailman/listinfo/python-list

Re: p & br using ElementTree?

2007-06-26 Thread Robert Kern
Jan Danielsson wrote: > Hello all, > >This is probably a mind numbingly brain dead question.. But how do I > generate the following: > > Current date:2000-01-01 > >..using ElementTree? The element kind of needs two text blocks, > as far as I can tell? Use the .tail attribute on the br

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-26 Thread Graham Breed
Douglas Alan wote: > Graham Breed <[EMAIL PROTECTED]> writes: > > > Another way is to decorate functions with their local variables: > > from strict import my > @my("item") > > ... def f(x=1, y=2.5, z=[1,2,4]): > > ... x = float(x) > > ... w = float(y) > > ... return [item+x-y

How to destroy a Frame with condition

2007-06-26 Thread senthil arasu
Hi, In my code logic I need to check the frame existence and then destroy a frame. I dont know how to code this condition. In Python tutorials what i reffered, "if "condition given only for integers(like if x>0:) I need some one to help me. This is my condition If iframe==NULL//if frame not a

Re: New Thread- Supporting Multiline values in ConfigParser

2007-06-26 Thread O.R.Senthil Kumaran
* Gabriel Genellina <[EMAIL PROTECTED]> [2007-06-25 22:26:47]: > And how would you detect a multiline value? > Because it is not a section nor looks like a new option? > > > I can guess, this portion in the _read function will require change, > > any change to this affects the whole of parsing. :

Re: Can Readlines() go to next line after a Tab

2007-06-26 Thread gagsl-py2
(Please keep posting on this list) --- [EMAIL PROTECTED] escribió: > Thanks, but this method still reads the whole line > into memory. I would like to find a way for it to > stop reading when it encounters a \t and then go to > the next. This would be much faster. You can't avoid reading the who

p & br using ElementTree?

2007-06-26 Thread Jan Danielsson
Hello all, This is probably a mind numbingly brain dead question.. But how do I generate the following: Current date:2000-01-01 ..using ElementTree? The element kind of needs two text blocks, as far as I can tell? -- Kind regards, Jan Danielsson -- http://mail.python.org/mailman/listin

Re: guidance needed: best practice for script packaging

2007-06-26 Thread Josiah Carlson
Alan Isaac wrote: > This is a simple question about actual practice. > I just want to know how you (yes you) are > approaching this problem. > The problem: > What is the recommended packaging of > demo scripts or test scripts for a package > to be distributed to others to "play with". > (I.e., wit

Re: guidance needed: best practice for script packaging

2007-06-26 Thread Gabriel Genellina
En Tue, 26 Jun 2007 23:35:37 -0300, Alan Isaac <[EMAIL PROTECTED]> escribió: > This is a simple question about actual practice. > I just want to know how you (yes you) are > approaching this problem. > > The problem: > What is the recommended packaging of > demo scripts or test scripts for a pac

Re: Internals and complexity of types, containers and algorithms

2007-06-26 Thread Martin v. Löwis
Paul Rubin schrieb: > "Martin v. Löwis" <[EMAIL PROTECTED]> writes: >> Amortized O(1) for inserting into lists. > > I think you mean amortized O(1) for appending to lists. Indeed so; insertion is O(n). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Chroot Jail Not Secure for Sandboxing Python?

2007-06-26 Thread Martin v. Löwis
> To launch a child process in a chroot you can easily just fork and > then make the chroot syscall in the child process immediately after > the fork. It's not so easy. On Linux, you need to have the CAP_SYS_CHROOT capability to invoke the syscall; on other systems, you may have to be root. Regar

Re: Internals and complexity of types, containers and algorithms

2007-06-26 Thread Josiah Carlson
Harald Luessen wrote: > On Mon, 25 Jun 2007 Martin v. Löwis wrote: > >> Sure, see below: >> >> - tuples are represented as arrays, with a single block for the >> entire objects (object header, tuple size, and data) >> - list are represented as arrays, with two memory blocks: >> one for object he

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-26 Thread MSCHAEF.COM
In article <[EMAIL PROTECTED]>, Twisted <[EMAIL PROTECTED]> wrote: ... >In the other corner, we have just about every Unix application ever >developed. When a user needs help, they may do such things as manually >explore the directories where the application was installed >(equivalent to rootin

guidance needed: best practice for script packaging

2007-06-26 Thread Alan Isaac
This is a simple question about actual practice. I just want to know how you (yes you) are approaching this problem. The problem: What is the recommended packaging of demo scripts or test scripts for a package to be distributed to others to "play with". (I.e., without "installing".) Example: Su

Re: Can Readlines() go to next line after a Tab

2007-06-26 Thread Gabriel Genellina
En Tue, 26 Jun 2007 22:16:56 -0300, <[EMAIL PROTECTED]> escribió: > I have a module based app that can load many modules at startup. The > modules are text based with a '\t' separating the keyword from the > definition. The app reads each module to extract the keywords, but > because readlin

Re: Re: Padding en

2007-06-26 Thread Gabriel Genellina
En Tue, 26 Jun 2007 15:57:33 -0300, Sebastian Bassi escribió: > Si, pero resulta que lo tuve que complicar un poco porque sha esta en > distintas librerias segun la version de Python y tambien no puedo > hacer un upper() directamente sin verificar que manden un string > primero. Tambien otra di

Re: Unbound Local error --???

2007-06-26 Thread Gabriel Genellina
En Tue, 26 Jun 2007 21:48:50 -0300, hari sirigibathina <[EMAIL PROTECTED]> escribió: > -Calling a method say aMethod() from another method where i mistakenly > initialised a variable with name same as the called method like aMethod = > 'string'. When i run this py script triggered "Unbound Local

Re: urllib interpretation of URL with ".."

2007-06-26 Thread Gabriel Genellina
En Tue, 26 Jun 2007 17:26:06 -0300, sergio <[EMAIL PROTECTED]> escribió: > John Nagle wrote: > >> In Python, of course, "urlparse.urlparse", which is >> the main function used to disassemble a URL, has no idea whether it's >> being used by a client or a server, so it, reasonably enough, takes

Re: Converting Diff Output to XML?

2007-06-26 Thread Gabriel Genellina
En Tue, 26 Jun 2007 11:43:32 -0300, Debajit Adhikary <[EMAIL PROTECTED]> escribió: > What would be the best way to convert the regular (unix) diff output into > XML? > Are there any libraries at all which might help? You can use a SequenceMatcher object (see the difflib module http://docs.pyt

Re: [Bulk] RE: Python changing the keywords name

2007-06-26 Thread Gabriel Genellina
(Please keep posting on the list. You can reach a lot of helpful people, and I don't read this email account very often) At Sunday 24/06/2007 10:38, you wrote: >> Instead of changing Python grammar, you could convert your"translated" >> source into "original" Python using the code below, andc

Re: Python changing keywords name

2007-06-26 Thread Gabriel Genellina
En Tue, 26 Jun 2007 13:11:50 -0300, Sion Arrowsmith <[EMAIL PROTECTED]> escribió: > Gabriel Genellina <[EMAIL PROTECTED]> wrote: >> (I hope nobody will abuse this technique... Y perd=F3n a los >> hispanoparlantes por lo horrible de la traducci=F3n). > > Ah, I only spotted this when I came to p

Can Readlines() go to next line after a Tab

2007-06-26 Thread tim
I have a module based app that can load many modules at startup. The modules are text based with a '\t' separating the keyword from the definition. The app reads each module to extract the keywords, but because readlines() must read to the end of the current line to get to the next, the module l

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-26 Thread notbob
On 2007-06-27, Twisted <[EMAIL PROTECTED]> wrote: > irritating was the necessary frequent trips to the help. Even when the > help was easy to use (itself rare) that's a load of additional task > switching and crap. Of course, lots of the time the help was not easy > to use. Man pages and anything

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-26 Thread Twisted
On Jun 26, 6:17 am, Gian Uberto Lauri <[EMAIL PROTECTED]> wrote: > Children pick up other language without any conscious effort because > either they learn it by using with parents, relatives and friends or > they are involved in a game-like style of learning. Actually, it's proven that there'

Unbound Local error --???

2007-06-26 Thread hari sirigibathina
Hi all, Have a question which is making me unrest: -Calling a method say aMethod() from another method where i mistakenly initialised a variable with name same as the called method like aMethod = 'string'. When i run this py script triggered "Unbound Local error". can any one explain me whats g

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-26 Thread Twisted
On Jun 26, 6:06 am, Gian Uberto Lauri <[EMAIL PROTECTED]> wrote: > >> > HOW IN THE BLOODY HELL IS IT SUPPOSED TO OCCUR TO SOMEONE TO > >> ENTER > THEM, GIVEN THAT THEY HAVE TO DO SO TO REACH THE HELP THAT > >> WOULD TELL > THEM THOSE ARE THE KEYS TO REACH THE HELP?! > > >> What's your problem ? > >

Re: ANN: YahooQuote 0.1.0

2007-06-26 Thread Maurice LING
Hi David, I can't download from your link http://www.freenet.org.nz/python/yahooquote/YahooQuote-0.1.tar.gz Cheers maurice DavidM wrote: > Hi, > > After a 3-year break from working with it, I've just released version 0.1.0 > (the first formally packaged release) of YahooQuote. As the name impl

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-26 Thread Twisted
On Jun 26, 10:37 am, Bjorn Borud <[EMAIL PROTECTED]> wrote: > ...and of course, in addition you have access to history so you can > easily find previous parameters and edit them. this makes it very > efficient when you need to fiddle about in deep directory trees in a > way no GUI can yet offer. >

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-26 Thread Twisted
On Jun 26, 10:52 am, Bjorn Borud <[EMAIL PROTECTED]> wrote: > [Robert Uhl <[EMAIL PROTECTED]>] > | > | Agreed. Stallman got sidetracked by Scheme, which IMHO was a > | dead-end. > > too many people buying SICP and believing what they heard about it > being an important book. I too spent some time

Date<->UNIX timestamp mapping (was Portable general timestamp format, not 2038-limited)

2007-06-26 Thread Martin Gregorie
Paul Rubin wrote: > Martin Gregorie <[EMAIL PROTECTED]> writes: >>> Same one already given: http://cr.yp.to/proto/utctai.html >> >> Nope - you referenced leap seconds, not TAI and not that URL > > Oh whoops, I thought I put that url further up in the thread. > I remember grumbling to myself about

Re: subprocess.Popen() problem

2007-06-26 Thread 7stud
On Jun 26, 3:00 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On 6/26/07, 7stud <[EMAIL PROTECTED]> wrote: > > > p.stdin.write("hello") > > You need to add the linefeed, otherwise your mytest.py process is > still waiting for you to finish typing. So, use this instead: > > p.stdin.write("hello\n")

Re: simplifying algebraic expressions

2007-06-26 Thread DavidM
On Tue, 26 Jun 2007 04:22:23 -0700, Mark Westwood wrote: > I'm with Robin Becker on this one, if GP is good enough for your > problem, then the answers it produces should be good enough. Set the > fitness criteria in favour of shorter rather than longer expressions > and let you system run a litt

Re: something similar to shutil.copytree that can overwrite?

2007-06-26 Thread John J. Lee
Ben Sizer <[EMAIL PROTECTED]> writes: > On 20 Jun, 11:40, Justin Ezequiel <[EMAIL PROTECTED]> > wrote: >> On Jun 20, 5:30 pm, Ben Sizer <[EMAIL PROTECTED]> wrote: >> >> > I need to copy directories from one place to another, but it needs to >> > overwrite individual files and directories rather th

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-26 Thread Andy Freeman
On Jun 26, 10:10 am, Paul Rubin wrote: > Andy Freeman <[EMAIL PROTECTED]> writes: > > Compare that with what a programmer using Python 2.4 has to do if > > she'd like the functionality provided by 2.5's with statement. Yes, > > with is "just syntax", but it's extremely u

Re: Using PSE under Win32

2007-06-26 Thread Eduardo Dobay
On 24 jun, 21:19, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > What do you have PythonHandler set to and what does it identify? The > error above suggests that whatever you identify as the handler is not > a callable object like a function. Are you perhaps identifying some > sort of PSE template o

Re: Portable general timestamp format, not 2038-limited

2007-06-26 Thread sla29970
On Jun 26, 2:17 pm, Paul Rubin wrote: > Martin Gregorie <[EMAIL PROTECTED]> writes: > > > Same one already given:http://cr.yp.to/proto/utctai.html > > > > Nope - you referencedleap seconds, not TAI and not that URL > > Oh whoops, I thought I put that url further up in th

Re: urllib interpretation of URL with ".."

2007-06-26 Thread sergio
John Nagle wrote: > In Python, of course, "urlparse.urlparse", which is > the main function used to disassemble a URL, has no idea whether it's > being used by a client or a server, so it, reasonably enough, takes option > 1. >>> import urlparse >>> base="http://somesite.com/level1/"; >>> path="

Re: Portable general timestamp format, not 2038-limited

2007-06-26 Thread Paul Rubin
Martin Gregorie <[EMAIL PROTECTED]> writes: > > Same one already given: http://cr.yp.to/proto/utctai.html > > Nope - you referenced leap seconds, not TAI and not that URL Oh whoops, I thought I put that url further up in the thread. I remember grumbling to myself about having to look for it twice

Re: problem mixing gettext and properties

2007-06-26 Thread Peter Otten
André wrote: > On Jun 26, 4:17 pm, André <[EMAIL PROTECTED]> wrote: >> On Jun 26, 3:56 pm, Peter Otten <[EMAIL PROTECTED]> wrote: >> >> >> >> > André wrote: >> > > I've encountered a problem using gettext with properties while using >> > > a Python interpreter. >> >> > > Here's a simple program th

Re: Chroot Jail Not Secure for Sandboxing Python?

2007-06-26 Thread Evan Klitzke
On 6/25/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Jun 25, 11:58 am, Paul Boddie <[EMAIL PROTECTED]> wrote: > > On 25 Jun, 16:48, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > > > > > > I followed up with my ISP. Here's the answer I got: > > > > > The os.exec call prepends the

Re: What was that web interaction library called again?

2007-06-26 Thread Omer Khalid
On the RESTFul web service, I would like to piggy pack my own question two is there a way to make the connection secure between two Restful service running on GNU/linux? Thanks, Omer On 6/26/07, Kathryn Van Stone <[EMAIL PROTECTED]> wrote: So does anyone know of any equivalent library for te

Re: subprocess.Popen() problem

2007-06-26 Thread kyosohma
On Jun 26, 3:38 pm, 7stud <[EMAIL PROTECTED]> wrote: > I have this program: > > mytest.py > -- > myinput = raw_input("Enter input: ") > > if myinput == "hello": > print "goodbye" > -- > > and I want to execute it using subprocess.Popen(). I tried the > following but it

Re: Portable general timestamp format, not 2038-limited

2007-06-26 Thread Martin Gregorie
[EMAIL PROTECTED] wrote: > On Jun 25, 6:46 pm, Paul Rubin wrote: >> TAI really does seem like the most absolute--if you are a user in >> orbit or on Mars, then UTC timestamps will seem pretty meaningless and >> artificial. > > TAI makes sense for clocks on the surface of

Re: Portable general timestamp format, not 2038-limited

2007-06-26 Thread Martin Gregorie
Paul Rubin wrote: > Same one already given: http://cr.yp.to/proto/utctai.html Nope - you referenced leap seconds, not TAI and not that URL Thanks for the reference, though. -- martin@ | Martin Gregorie gregorie. | Essex, UK org | -- http://mail.python.org/mailman/listinfo/python-list

Re: Non-blocking keyboard read

2007-06-26 Thread Jean-Paul Calderone
On Tue, 26 Jun 2007 22:37:16 +0200, Laszlo Nagy <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] wrote: >> I am writing a curses application, but the getch() does not seem to >> give me all I want. Of course, if I press "d", it returns an ord("d") >> and so on. But I want to be able to detect whether

Re: subprocess.Popen() problem

2007-06-26 Thread Jerry Hill
On 6/26/07, 7stud <[EMAIL PROTECTED]> wrote: > p.stdin.write("hello") You need to add the linefeed, otherwise your mytest.py process is still waiting for you to finish typing. So, use this instead: p.stdin.write("hello\n") -- Jerry -- http://mail.python.org/mailman/listinfo/python-list

Re: problem mixing gettext and properties

2007-06-26 Thread André
On Jun 26, 4:17 pm, André <[EMAIL PROTECTED]> wrote: > On Jun 26, 3:56 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > > > > > André wrote: > > > I've encountered a problem using gettext with properties while using a > > > Python interpreter. > > > > Here's a simple program that illustrate the problem

subprocess.Popen() problem

2007-06-26 Thread 7stud
I have this program: mytest.py -- myinput = raw_input("Enter input: ") if myinput == "hello": print "goodbye" -- and I want to execute it using subprocess.Popen(). I tried the following but it just hangs: --- import subprocess f = open("/Users/me/2testing/d

Re: Non-blocking keyboard read

2007-06-26 Thread Laszlo Nagy
[EMAIL PROTECTED] wrote: > I am writing a curses application, but the getch() does not seem to > give me all I want. Of course, if I press "d", it returns an ord("d") > and so on. But I want to be able to detect whether alt, shift or ctrl > has been pressed also. Shift is normally covered by return

Re: What was that web interaction library called again?

2007-06-26 Thread Kathryn Van Stone
So does anyone know of any equivalent library for testing RESTful web services. In particular it needs to be able to handle more than 'GET' or "POST" http calls. -Kathy Van Stone [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: bicycle repair man help

2007-06-26 Thread Kathryn Van Stone
On Jun 23, 2007, at 2:24 PM, Rustom Mody wrote: > Does someone know that when using bicycle repair man to refactor > python code what exactly extract local variable means? I don't know about bicycle repair main, but in general 'extract local variable' means to make a change like this: self.

ironpython exception line number

2007-06-26 Thread Troels Thomsen
Hello , When an exeption occurs in a IronPython executet script, and I print the sys.exc , i get something ugly like the example below. How can I get the fileName and line number? Thx in advance Troels 26-06-2007 13:19:04 : IronPython.Runtime.Exceptions.PythonIndentationError: unexpected tok

Re: problem mixing gettext and properties

2007-06-26 Thread Peter Otten
André wrote: > On Jun 26, 3:56 pm, Peter Otten <[EMAIL PROTECTED]> wrote: >> André wrote: >> > I've encountered a problem using gettext with properties while using a >> > Python interpreter. >> >> > Here's a simple program that illustrate the problem. >> > == >> > # i18n_test.py: test

Re: Python plain-text database or library that supports joins?

2007-06-26 Thread Joshua J. Kugler
On Friday 22 June 2007 09:18, felciano wrote: > Hello -- > > Is there a convention, library or Pythonic idiom for performing > lightweight relational operations on flatfiles? I frequently find > myself writing code to do simple SQL-like operations between flat > files, such as appending columns f

Re: popen and a long running process in a wx.python application

2007-06-26 Thread Ratko
On Jun 26, 10:16 am, Doru Moisa <[EMAIL PROTECTED]> wrote: > Hello, > > How can I capture the output of a long runnning process which I open > with popen() ? > I tried reading line by line, char by char, but the result always > comes when the process finishes. > (I am trying to make a wx.python pro

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-26 Thread Kjetil S. Matheussen
On Tue, 26 Jun 2007, Bjorn Borud wrote: > [Robert Uhl <[EMAIL PROTECTED]>] > | > | Agreed. Stallman got sidetracked by Scheme, which IMHO was a > | dead-end. > > too many people buying SICP and believing what they heard about it > being an important book. I too spent some time exploring Scheme

Re: problem mixing gettext and properties

2007-06-26 Thread André
On Jun 26, 3:56 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > André wrote: > > I've encountered a problem using gettext with properties while using a > > Python interpreter. > > > Here's a simple program that illustrate the problem. > > == > > # i18n_test.py: test of gettext & properties

Re: Internals and complexity of types, containers and algorithms

2007-06-26 Thread Paul Rubin
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: > Amortized O(1) for inserting into lists. I think you mean amortized O(1) for appending to lists. -- http://mail.python.org/mailman/listinfo/python-list

Re: problem mixing gettext and properties

2007-06-26 Thread Peter Otten
André wrote: > I've encountered a problem using gettext with properties while using a > Python interpreter. > > Here's a simple program that illustrate the problem. > == > # i18n_test.py: test of gettext & properties > > import gettext > > fr = gettext.translation('i18n_test', './tr

Re: problem mixing gettext and properties

2007-06-26 Thread Matimus
On Jun 26, 10:52 am, André <[EMAIL PROTECTED]> wrote: > I've encountered a problem using gettext with properties while using a > Python interpreter. > > Here's a simple program that illustrate the problem. > == > # i18n_test.py: test of gettext & properties > > import gettext > > fr = g

Re: Indenting in Emacs

2007-06-26 Thread Rustom Mody
Ive been struggling with this same question -- which python mode -- for a while but not getting anywhere! I understand (from the emacs list) that the new python mode has better support for debugging (pdbtrack in addition to pdb) but dont know much more. On 6/26/07, John J. Lee <[EMAIL PROTECTED]

problem mixing gettext and properties

2007-06-26 Thread André
I've encountered a problem using gettext with properties while using a Python interpreter. Here's a simple program that illustrate the problem. == # i18n_test.py: test of gettext & properties import gettext fr = gettext.translation('i18n_test', './translations', languages=['fr']) fr.

Re: Internals and complexity of types, containers and algorithms

2007-06-26 Thread Harald Luessen
On Mon, 25 Jun 2007 Martin v. Löwis wrote: >Sure, see below: > >- tuples are represented as arrays, with a single block for the > entire objects (object header, tuple size, and data) >- list are represented as arrays, with two memory blocks: > one for object header and sizes, and the other one f

Re: Internals and complexity of types, containers and algorithms

2007-06-26 Thread Harald Luessen
On Mon, 25 Jun 2007 James Stroud wrote: >Harald Luessen wrote: >> Hi, I am new to python and I miss some understanding of the internals >> of some types and containers. With my C/C++ background I hope to get >> some hints to chose the best data structure for my programs. Here are >> some questi

Re: Help needed with translating perl to python

2007-06-26 Thread attn . steven . kuo
On Jun 26, 8:59 am, [EMAIL PROTECTED] wrote: (snipped) > > >>> def bcdlen(*args): > > ... strlen = "%04s" % str(args[0]) > ... firstval = int(strlen[2:3]) * 16 + int(strlen[3:4]) > ... lastval = int(strlen[0:1]) * 16 + int(strlen[1:2]) > ... return "%s%s" % (chr(firstval), chr(la

Re: Return name of caller function?

2007-06-26 Thread Jay Loden
Matthew Peter wrote: > For example, how do I get this to work? > > def func(): > print "This is", __?__ > return __caller__ > > def echo(): > print "This is ", __?__ > return func() > > print echo() > This is echo > This is func > echo This may not be what you're looking

Re: Portable general timestamp format, not 2038-limited

2007-06-26 Thread Paul Rubin
Martin Gregorie <[EMAIL PROTECTED]> writes: > I don't recall the OP mentioning time interval computability - just a > requirement for sub second accuracy timestamps. That Y2038 is an issue suggests the OP wants a timestamp format that is future-proof and that means it should be good for all plausi

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-26 Thread Paul Rubin
Andy Freeman <[EMAIL PROTECTED]> writes: > Compare that with what a programmer using Python 2.4 has to do if > she'd like the functionality provided by 2.5's with statement. Yes, > with is "just syntax", but it's extremely useful syntax, syntax that > can be easily implemented with lisp-style macr

Re: Hi How to implement switch case statement.

2007-06-26 Thread Evan Klitzke
Read this thread, which was discussed on the list a few days ago: http://www.mail-archive.com/python-list@python.org/msg150704.html On 6/25/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Hi > > My requirement is to check a variable with a set of constant values and > call a particular

Re: popen and a long running process in a wx.python application

2007-06-26 Thread kyosohma
On Jun 26, 10:16 am, Doru Moisa <[EMAIL PROTECTED]> wrote: > Hello, > > How can I capture the output of a long runnning process which I open > with popen() ? > I tried reading line by line, char by char, but the result always > comes when the process finishes. > (I am trying to make a wx.python pro

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-26 Thread Paul Rubin
Andy Freeman <[EMAIL PROTECTED]> writes: > And he's wrong, at least as far as common lisp is concerned - map does > exactly that. > > http://www.lispworks.com/documentation/HyperSpec/Body/f_map.htm "sequence" there just means vectors and lists. > Map doesn't work on generators or iterators becau

Re: _hashlib portability issue

2007-06-26 Thread Robert Kern
Olivier Feys wrote: > Hi all, > > I build python 2.5 on linux-x86-64 (centos). > Why is lib-dynload/_hashlib.so dynamically linked with libssl.so.0.9.7 > and not with libssl.so that points on it (same thing for libcrypto.so)? > This causes problems when copying all the python distribution and >

Re: Installing python under the linux

2007-06-26 Thread Evan Klitzke
On 6/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello, > > >No. The only way to change the keywords would be to edit the > >Python source and re-compile it. > > This was very helpful information , I already know that but I don't > know how > to that.PLEASE HELP ME ABOUT THIS, I WILL BE

Re: Installing python under the linux

2007-06-26 Thread Grant Edwards
On 2007-06-26, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >>>No. The only way to change the keywords would be to edit the >>>Python source and re-compile it. >> >> This was very helpful information , I already know that but I >> don't know how to that.PLEASE HELP ME ABOUT THIS, I WILL BE >> VER

Re: eggs considered harmful

2007-06-26 Thread Robert Kern
Harry George wrote: > [EMAIL PROTECTED] (John J. Lee) writes: >> Not sure how this differs significantly "from running a repository", >> in the sense I use it above. >> >> >> John > > Significant differences: > > "depot": Place(s) where tarballs can be stored, and can then be > reached via http.

Re: logging anomaly

2007-06-26 Thread Vinay Sajip
On Jun 26, 3:48 pm, Jesse James <[EMAIL PROTECTED]> wrote: > > 2007-06-26 07:59:38,192 vor.uploader INFO - start uploading file: > 7_Canyons_Clip_1.flv > 2007-06-26 07:59:38,206 vor.uploader INFO - done uploading file: > 7_Canyons_Clip_1.flv > > I know this is wrong because this is a large

Re: Python changing keywords name

2007-06-26 Thread Sion Arrowsmith
Gabriel Genellina <[EMAIL PROTECTED]> wrote: >(I hope nobody will abuse this technique... Y perd=F3n a los >hispanoparlantes por lo horrible de la traducci=F3n). Ah, I only spotted this when I came to post a response. And the reason I was going to post a response was that these: >'assert': '

Re: Help needed with translating perl to python

2007-06-26 Thread Greg Armer
On Tue, Jun 26, 2007 at 08:17:06AM -0700, vj wrote: >I posted too soon: > >> Statement 1: >> my $today = sprintf("%4s%02s%02s", [localtime()]->[5]+1900, >> [localtime()]->[4]+1, [localtime()]->[3]) ; > >1. is localtime the same as time in python? You could use this instead - from time import loc

Re: Help needed with translating perl to python

2007-06-26 Thread attn . steven . kuo
On Jun 26, 8:04 am, vj <[EMAIL PROTECTED]> wrote: > I have a perl script which connect to network stream using sockets. > The scripts first logins in to the server and then parses the data > comming from the socket. > > Statement 1: > my $today = sprintf("%4s%02s%02s", [localtime()]->[5]+1900, >

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-26 Thread Andy Freeman
On Jun 26, 8:49 am, Andy Freeman <[EMAIL PROTECTED]> wrote: > Map doesn't work on generators or iterators because they're not part > of the common lisp spec, but if someone implemented them as a library, > said library could easily include a map that handled them as well. Note that this is is a co

Re: Return name of caller function?

2007-06-26 Thread Stephen R Laniel
On Mon, Jun 25, 2007 at 06:27:29PM -0700, Matthew Peter wrote: > For example, how do I get this to work? > > def func(): > print "This is", __?__ > return __caller__ > > def echo(): > print "This is ", __?__ > return func() inspect is your friend: http://docs.python.org/lib/inspe

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-26 Thread Chris Mellon
On 6/26/07, paul <[EMAIL PROTECTED]> wrote: > Bruno Desthuilliers schrieb: > > Stephen R Laniel a écrit : > >> On Wed, Jun 20, 2007 at 09:41:09PM +0100, Michael Hoffman wrote: > >>> If you asked Java programmers why you couldn't turn *off* Java's static > >>> type checking if you wanted to, you'd p

Hi How to implement switch case statement.

2007-06-26 Thread parasuram.nooranianand
Hi My requirement is to check a variable with a set of constant values and call a particular function depending on the value of the variable. A C-language implementation might look something like : switch (a) { case 1 : func1(); case 2 : func2() ; default : func3(); } How t

Return name of caller function?

2007-06-26 Thread Matthew Peter
For example, how do I get this to work? def func(): print "This is", __?__ return __caller__ def echo(): print "This is ", __?__ return func() >>> print echo() This is echo This is func echo _

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-26 Thread Andy Freeman
On Jun 26, 12:26 am, Paul Rubin wrote: > Precisely, I think that's what Alexander was trying to get across, Lisp > didn't have a uniform interface for traversing different types of sequence. And he's wrong, at least as far as common lisp is concerned - map does exactly t

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-26 Thread paul
Bruno Desthuilliers schrieb: > Stephen R Laniel a écrit : >> On Wed, Jun 20, 2007 at 09:41:09PM +0100, Michael Hoffman wrote: >>> If you asked Java programmers why you couldn't turn *off* Java's static >>> type checking if you wanted to, you'd probably get a similar response. >> Perhaps it would h

Re: Help needed with translating perl to python

2007-06-26 Thread Jay Loden
vj wrote: > I posted too soon: > >> Statement 1: >> my $today = sprintf("%4s%02s%02s", [localtime()]->[5]+1900, >> [localtime()]->[4]+1, [localtime()]->[3]) ; > > 1. is localtime the same as time in python? http://perldoc.perl.org/functions/localtime.html It's more like time.localtime() One

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-26 Thread David Kastrup
Bjorn Borud <[EMAIL PROTECTED]> writes: > [Twisted <[EMAIL PROTECTED]>] > | > | and you said that depended on the definition of "expert". Apparently > | you believe there is a type of "expert" for whom beginner-friendly > | software is intrinsically less usable than beginner-hostile > | software.

Re: Problem with wxPython

2007-06-26 Thread Chris Mellon
On 6/26/07, Ali <[EMAIL PROTECTED]> wrote: > Hi > > I'm not sure if this is the right place to post, pardon me if it's not. > I'm having a problem with an application written with wxpython. The frame > seems only to refresh when moving my mouse of it, though i frequently call: > frame.Refresh(True)

  1   2   >