Re: Python on imac

2007-10-14 Thread Tommy Nordgren
On 14 okt 2007, at 01.21, John Velman wrote: > I'm considering moving from Linux to imac. I've recently returned to > Python (was never very expert) to develop a small gui application. At > present I plan to use PyGTK with Pango and Cairo. > > What surprises may I be in for :-) > > (Currently

Entering username & password automatically using urllib.urlopen

2007-10-14 Thread rodrigo
I am trying to retrieve a password protected page using: get = urllib.urlopen('http://password.protected.url";').read() While doing this interactively, I'm asked for the username, then the password at the terminal. Is there any way to do this non-interactively? To hardcode the user/ pass into th

Safely dealing with arbitrary file objects

2007-10-14 Thread Steven D'Aprano
I have found myself writing functions rather like these: def openfile(filename): if filename == '-': # convention for shell scripts in Unix-land is to use # '-' for stdin/stdout for reading/writing. outfile = sys.stdout if filename == '2-': outfile = sys.std

Re: Memory Problems in Windows 2003 Server

2007-10-14 Thread Tim Roberts
AMD <[EMAIL PROTECTED]> wrote: > >I do the reading one line at a time, the problem seems to be with the >dictionary I am creating. I don't know whether Python dictionaries must live in a contiguous piece of memory, but if so, that could be the issue. The system DLLs in Server 2003 have been "reb

Re: Error on base64.b64decode() ?!

2007-10-14 Thread Tim Roberts
Christoph Krammer <[EMAIL PROTECTED]> wrote: >On 12 Okt., 17:09, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> If you get an incorrect padding error, try appending a "=" and decoding >> again. If you get the error again, try appending one more "=". If it >> still doesn't work, then you might

Re: Safely dealing with arbitrary file objects

2007-10-14 Thread Scott David Daniels
Steven D'Aprano wrote: > I have found myself writing functions rather like these: > > def openfile(filename): > if filename == '-': > # convention for shell scripts in Unix-land is to use > # '-' for stdin/stdout for reading/writing. > outfile = sys.stdout > if file

Re: Python on imac

2007-10-14 Thread James Stroud
John Velman wrote: > I'm considering moving from Linux to imac. I've recently returned to > Python (was never very expert) to develop a small gui application. At > present I plan to use PyGTK with Pango and Cairo. > > What surprises may I be in for :-) > > (Currently using slackware 11.0 on an

First class lexical closures

2007-10-14 Thread Jon Harrop
Just debating somewhere else whether or not Python might be considered a functional programming language. Lua, Ruby and Perl all seem to provide first class lexical closures. What is the current state of affairs in Python? Last time I looked they were just removing (?!) closures... -- Dr Jon D

Re: First class lexical closures

2007-10-14 Thread Kay Schluehr
On Oct 14, 7:54 am, Jon Harrop <[EMAIL PROTECTED]> wrote: > Just debating somewhere else whether or not Python might be considered a > functional programming language. Lua, Ruby and Perl all seem to provide > first class lexical closures. > > What is the current state of affairs in Python? Last tim

Re: Last iteration?

2007-10-14 Thread Paul McGuire
On Oct 12, 5:58 am, Florian Lindner <[EMAIL PROTECTED]> wrote: > Hello, > can I determine somehow if the iteration on a list of values is the last > iteration? > > Example: > > for i in [1, 2, 3]: >if last_iteration: > print i*i >else: > print i > > that would print > > 1 > 2 >

Pymedia audio analyzer

2007-10-14 Thread Carlos Leite
Is there any other option to analyze audio frequencies? Or Any here try to use pymedia to a simple audio FingerPrint. A cant understand what the information the asBands() really giveme. The Docs, say that asBands() return a List of tupples grouped by frquenciy, and the first two values are frq

Re: Foreign Character Problems In Python 2.5 and Tkinter

2007-10-14 Thread Juha S.
[EMAIL PROTECTED] wrote: > As a noob I've struggled a bit, but basically what I've come up with > is => if the information is strings and especially strings stored in > any style of list/dict, it takes a loop to write the lines to file > myfile[ i ] + '\n' to keep each line for Python I/O purposes.

Re: unicodedata implementation - categories

2007-10-14 Thread Martin v. Löwis
> 1) Why doesn't the category method raise an Exception, like the name method > does? As Chris explains, the result category means "Other, Not Assigned". Python returns this category because it's the truth: for those characters, the value of the "category" property really *is* Cn; it means that th

Paste and WSGI 2.0 [WAS: Yet another comparison of Python Web Frameworks]

2007-10-14 Thread Michele Simionato
On Oct 14, 2:52 am, Ian Bicking <[EMAIL PROTECTED]> wrote: > That said, going without a framework (which at least in his article is > what Michele seems to be comparing Pylons against) isn't always so > bad. I started writing an Atompub server in Pylons, but felt like I > was spending too much tim

Re: Paste and WSGI 2.0 [WAS: Yet another comparison of Python Web Frameworks]

2007-10-14 Thread Graham Dumpleton
On Oct 14, 6:46 pm, Michele Simionato <[EMAIL PROTECTED]> wrote: > Now, since you are here, there is an unrelated question that I want to > ask you, concerning the future of Paste with respect to WSGI 2.0. > I do realize that at this stage WSGI 2.0, is only a draft Hmmm, not sure where people keep

Re: Entering username & password automatically using urllib.urlopen

2007-10-14 Thread Diez B. Roggisch
rodrigo schrieb: > I am trying to retrieve a password protected page using: > > get = urllib.urlopen('http://password.protected.url";').read() > > While doing this interactively, I'm asked for the username, then the > password at the terminal. > Is there any way to do this non-interactively? To

Re: Last iteration?

2007-10-14 Thread Paul Hankin
On Oct 14, 8:00 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Oct 12, 5:58 am, Florian Lindner <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > can I determine somehow if the iteration on a list of values is the last > > iteration? > > > Example: > > > for i in [1, 2, 3]: > >if last_iteration

Re: Last iteration?

2007-10-14 Thread Diez B. Roggisch
Peter Otten schrieb: > Diez B. Roggisch wrote: > >> Florian Lindner wrote: > >>> can I determine somehow if the iteration on a list of values is the >>> last iteration? > >> def last_iter(iterable): >> it = iter(iterable) >> buffer = [it.next()] >> for i in it: >> buffer.app

Re: Safely dealing with arbitrary file objects

2007-10-14 Thread Paul Hankin
On Oct 14, 5:01 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > I have found myself writing functions rather like these: > > def openfile(filename): > if filename == '-': > # convention for shell scripts in Unix-land is to use > # '-' for stdin/stdout for rea

Simple Text Processing Help

2007-10-14 Thread patrick . waldo
Hi all, I started Python just a little while ago and I am stuck on something that is really simple, but I just can't figure out. Essentially I need to take a text document with some chemical information in Czech and organize it into another text file. The information is always EINECS number, CAS

Re: Simple Text Processing Help

2007-10-14 Thread Marc 'BlackJack' Rintsch
On Sun, 14 Oct 2007 13:48:51 +, patrick.waldo wrote: > Essentially I need to take a text document with some chemical > information in Czech and organize it into another text file. The > information is always EINECS number, CAS, chemical name, and formula > in tables. I need to organize them

[no subject]

2007-10-14 Thread 353851029352
01smil;Name=01smil Description: application/smil -- http://mail.python.org/mailman/listinfo/python-list

a good website for softwares,sports,movies and music ,sex etc.

2007-10-14 Thread panguohua
www.space666.com good! -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Text Processing Help

2007-10-14 Thread Paul Hankin
On Oct 14, 2:48 pm, [EMAIL PROTECTED] wrote: > Hi all, > > I started Python just a little while ago and I am stuck on something > that is really simple, but I just can't figure out. > > Essentially I need to take a text document with some chemical > information in Czech and organize it into another

Order of tuples in dict.items()

2007-10-14 Thread Will McGugan
Hi, If I have two dictionaries containing identical values, can I be sure that the items() method will return tuples in the same order? I tried an experiment with CPython and it does appear to be the case. >>> a=dict(a=1, b=1, c=2) >>> b=dict(c=2, a=1, b=1) >>> a {'a': 1, 'c': 2, 'b': 1} >>

Re: Order of tuples in dict.items()

2007-10-14 Thread Paul Hankin
On Oct 14, 3:28 pm, Will McGugan <[EMAIL PROTECTED]> wrote: > If I have two dictionaries containing identical values, can I be sure > that the items() method will return tuples in the same order? > ... > Can I rely on this behavior? No. To quote the python documentation: > Keys and values are lis

Re: Entering username & password automatically using urllib.urlopen

2007-10-14 Thread byte8bits
On Oct 13, 11:41 pm, rodrigo <[EMAIL PROTECTED]> wrote: > I am trying to retrieve a password protected page using: > > get = urllib.urlopen('http://password.protected.url";').read() > > While doing this interactively, I'm asked for the username, then the > password at the terminal. > Is there any

Re: Python on imac

2007-10-14 Thread byte8bits
On Oct 14, 1:27 am, James Stroud <[EMAIL PROTECTED]> wrote: > For OS X 10.4, wx has come as part of the stock python install. You may > want to consider going that route if you develop exclusively for OS > X--it will keep the size of your distribution down. > > James wx works well on Macs... Linu

GLE-like python package

2007-10-14 Thread Wildemar Wildenburger
Hello there, I'm exploring possibilities of using python as an alternative to Matlab. The obvious way to go seems to be matplotlib for plotting, but I do like GLE http://glx.sourceforge.net/> a lot. One reason is that with GLE you can also do diagrams, that is, descriptive pictures (like http:

Re: Python on imac

2007-10-14 Thread Alex Martelli
James Stroud <[EMAIL PROTECTED]> wrote: ... > For OS X 10.4, wx has come as part of the stock python install. You may I use Mac OSX 10.4 and this assertion seems unfounded -- I can't see any wx as part of the stock Python (2.3.5). Maybe you mean something else? Alex -- http://mail.python.or

Re: GLE-like python package

2007-10-14 Thread Cesar G. Miguel
On Oct 14, 12:54 pm, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > Hello there, > > I'm exploring possibilities of using python as an alternative to Matlab. > The obvious way to go seems to be matplotlib for plotting, but I do like > GLE http://glx.sourceforge.net/> a lot. One reason is that w

Re: Python on imac

2007-10-14 Thread Kevin Walzer
Alex Martelli wrote: > James Stroud <[EMAIL PROTECTED]> wrote: >... >> For OS X 10.4, wx has come as part of the stock python install. You may > > I use Mac OSX 10.4 and this assertion seems unfounded -- I can't see any > wx as part of the stock Python (2.3.5). Maybe you mean something else?

Re: GLE-like python package

2007-10-14 Thread Wildemar Wildenburger
Cesar G. Miguel wrote: > I think this is what you're looking for: > > http://pyx.sourceforge.net/ > It damn sure is (a straight ripoff of GLE ;))! The syntax seems a bit messier than GLE (naturally) but since it is python I'm willing to bite that bullet. Thanks :) /W -- http://mail.python.org

Re: Simple Text Processing Help

2007-10-14 Thread patrick . waldo
Thank you both for helping me out. I am still rather new to Python and so I'm probably trying to reinvent the wheel here. When I try to do Paul's response, I get >>>tokens = line.strip().split() [] So I am not quite sure how to read line by line. tokens = input.read().split() gets me all the in

Re: Python on imac

2007-10-14 Thread Raffaele Salmaso
Alex Martelli wrote: > I use Mac OSX 10.4 and this assertion seems unfounded -- I can't see any > wx as part of the stock Python (2.3.5). Maybe you mean something else? Very old version, see /System/Library/Frameworks/Python.framework/Versions/2.3/Extras/lib/python/wx-2.5.3-mac-unicode -- http://

Re: Last iteration?

2007-10-14 Thread Paul McGuire
On Oct 14, 5:58 am, Paul Hankin <[EMAIL PROTECTED]> wrote: > On Oct 14, 8:00 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > > def signal_last(lst): > > last2 = None > > it = iter(lst) > > try: > > last = it.next() > > except StopIteration: > > last = None > > for

Re: Simple Text Processing Help

2007-10-14 Thread Marc 'BlackJack' Rintsch
On Sun, 14 Oct 2007 16:57:06 +, patrick.waldo wrote: > Thank you both for helping me out. I am still rather new to Python > and so I'm probably trying to reinvent the wheel here. > > When I try to do Paul's response, I get tokens = line.strip().split() > [] What is in `line`? Paul wrot

int to str in list elements..

2007-10-14 Thread Abandoned
Hi.. I have a list as a=[1, 2, 3 ] (4 million elements) and b=",".join(a) than TypeError: sequence item 0: expected string, int found I want to change list to a=['1','2','3'] but i don't want to use FOR because my list very very big. I'm sorry my bad english. King regards -- http://mail.pyt

Re: Python on imac

2007-10-14 Thread Alex Martelli
Raffaele Salmaso <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > I use Mac OSX 10.4 and this assertion seems unfounded -- I can't see any > > wx as part of the stock Python (2.3.5). Maybe you mean something else? > Very old version, see > /System/Library/Frameworks/Python.framework/Versions

Re: Python on imac

2007-10-14 Thread John Velman
Thanks to all. I'll look into wx before I get too much further. John V. -- http://mail.python.org/mailman/listinfo/python-list

Re: int to str in list elements..

2007-10-14 Thread Tobias K.
1. Use a generator expression: b = ",".join(str(i) for i in a) or 2. Use imap from itertools import imap b = ",".join(imap(str, a)) -- http://mail.python.org/mailman/listinfo/python-list

pydev code completion problem

2007-10-14 Thread Lukasz Mierzejewski
Hi, I need help with pydev code completion... Let's assume that we have something like this: class One: def fun(self): return 1 class Two: li = [] li.append(One()) one = li[0] print one.fun() one2 = li.pop() print one2.fun()

Re: Order of tuples in dict.items()

2007-10-14 Thread Erik Max Francis
Will McGugan wrote: > If I have two dictionaries containing identical values, can I be sure > that the items() method will return tuples in the same order? > > I tried an experiment with CPython and it does appear to be the case. > > >>> a=dict(a=1, b=1, c=2) > >>> b=dict(c=2, a=1, b=1) > >>

Re: Cross-platform GUI development

2007-10-14 Thread David Tremouilles
"crappy", "waaay better" I will not feed the troll... Pygtk on mac just do the work for me on a more than satisfying way. David 2007/10/13, Diez B. Roggisch <[EMAIL PROTECTED]>: > David Tremouilles schrieb: > > No issue with pygtk on mac! > > Actually I develop on this platform everyday. Macport

Re: pydev code completion problem

2007-10-14 Thread Marc 'BlackJack' Rintsch
On Sun, 14 Oct 2007 19:45:07 +, Lukasz Mierzejewski wrote: > Let's assume that we have something like this: > > class One: > def fun(self): > return 1 > > class Two: > li = [] > li.append(One()) > > one = li[0] > print one.fun() > > one2 = li.pop()

Re: Python on imac

2007-10-14 Thread Erik Jones
On Oct 13, 2007, at 8:23 PM, Adam Atlas wrote: > On Oct 13, 7:21 pm, John Velman <[EMAIL PROTECTED]> wrote: >> I'm considering moving from Linux to imac. I've recently >> returned to >> Python (was never very expert) to develop a small gui >> application. At >> present I plan to use PyGTK

Re: pydev code completion problem

2007-10-14 Thread cyberco
Confirmed (with exactly the same software). Please discuss this issue at the PyDev discussion forum: http://sourceforge.net/forum/forum.php?forum_id=293649 2B -- http://mail.python.org/mailman/listinfo/python-list

Newbi Q: Recursively reverse lists but NOT strings?

2007-10-14 Thread Dmitri O.Kondratiev
The function I wrote (below) reverses lists all right: def reverse(xs): if xs == []: return [] else: return (reverse (xs[1:])) + [xs[0]] >>> reverse ([1,2,3]) [3, 2, 1] >>> Yet when I try to reverse a string I get: >>> reverse ("abc") ... ... ... File "C:\wks\pyth

Re: Simple Text Processing Help

2007-10-14 Thread John Machin
On Oct 14, 11:48 pm, [EMAIL PROTECTED] wrote: > Hi all, > > I started Python just a little while ago and I am stuck on something > that is really simple, but I just can't figure out. > > Essentially I need to take a text document with some chemical > information in Czech and organize it into anothe

Re: int to str in list elements..

2007-10-14 Thread John Machin
On Oct 15, 4:02 am, Abandoned <[EMAIL PROTECTED]> wrote: > Hi.. > I have a list as a=[1, 2, 3 ] (4 million elements) > and > b=",".join(a) > than > TypeError: sequence item 0: expected string, int found > I want to change list to a=['1','2','3'] but i don't want to use FOR > because my list v

Re: pydev code completion problem

2007-10-14 Thread Lukasz Mierzejewski
> I can confirm and it's something I would expect. It is obvious to *you* > that there is a `One` object in that list, but it would get very Thank you for confirmation and your time! > quickly very complicated for an IDE to keep track of objects if not > even impossible. I guess that you are ri

Re: pydev code completion problem

2007-10-14 Thread Lukasz Mierzejewski
On Sun, 14 Oct 2007 20:36:07 +, cyberco wrote: > Confirmed (with exactly the same software). > > Please discuss this issue at the PyDev discussion forum: > http://sourceforge.net/forum/forum.php?forum_id=293649 Thank you for replay, but I'm still not sure what to think about it... Marc 'Bla

Re: pydev code completion problem

2007-10-14 Thread Diez B. Roggisch
Lukasz Mierzejewski schrieb: > On Sun, 14 Oct 2007 20:36:07 +, cyberco wrote: > >> Confirmed (with exactly the same software). >> >> Please discuss this issue at the PyDev discussion forum: >> http://sourceforge.net/forum/forum.php?forum_id=293649 > > > Thank you for replay, but I'm still no

hi hi hi

2007-10-14 Thread Tagrislam
Hi Hi Hi my name is tagreed , I am from Syria I've seen many places of the world on TV screen and few that I've visited either for fun or/ and business as you know when we travel we meet a lot different cultures and people. I found in many places I've been to ; that people stereotyped Islam (that'

Re: compile for ARM

2007-10-14 Thread mickeyl
Rafael Marin Perez <[EMAIL PROTECTED]> wrote: > Hello > > I'm Rafael Marin, and work as reseacher in University of Murcia (Spain). > > I want to install and compile modules of python2.4 in a ARMv5b > architecture. > > Any idea? Use OpenEmbedded [http://openembedded.org], I've already done every

Re: pydev code completion problem

2007-10-14 Thread Steven D'Aprano
On Sun, 14 Oct 2007 21:57:12 +, Lukasz Mierzejewski wrote: > On Sun, 14 Oct 2007 20:36:07 +, cyberco wrote: > >> Confirmed (with exactly the same software). >> >> Please discuss this issue at the PyDev discussion forum: >> http://sourceforge.net/forum/forum.php?forum_id=293649 > > > Th

Re: pydev code completion problem

2007-10-14 Thread Lukasz Mierzejewski
> But maybe someone use Komodo IDE or Wing IDE and can tell how they handle > situations like this? How works code completion in those IDE's? I've downloaded and checked both of them (both have Linux version which is nice thing). Both did worse job with code completion then PyDev with my simple ex

Re: Order of tuples in dict.items()

2007-10-14 Thread Steven D'Aprano
On Sun, 14 Oct 2007 13:26:27 -0700, Erik Max Francis wrote: > Will McGugan wrote: > >> If I have two dictionaries containing identical values, can I be sure >> that the items() method will return tuples in the same order? [...] >> Can I rely on this behavior? > > Probably not. Definitely not. S

Re: pydev code completion problem

2007-10-14 Thread Lukasz Mierzejewski
> He is right. What would you expect from this piece of code: > > > foo = random.choose([A(), B(), C(), ..., Z()]) Thank you all for dispelling my stupid doubts! > What PyDev does is to implement some heuristics that can guess easy > cases - as you saw for yourself. But there is a limit to wha

Re: The fundamental concept of continuations

2007-10-14 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Barb Knox wrote: > Instead of function A returning to its caller, the > caller provides an additional argument (the "continuation") which is a > function B to be called by A with A's result(s). That's just a callback. I've been doing that in C code (and other simil

Re: Order of tuples in dict.items()

2007-10-14 Thread John Machin
On Oct 15, 8:27 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > I've never seen the point of a sorted dictionary, it's easy to just say: > > for key, value in sorted(D.items()) There are several applications that involve finding i such that key[i] <= query < key[i+1] where the

Re: Order of tuples in dict.items()

2007-10-14 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > I've never seen the point of a sorted dictionary, it's easy to just say: > for key, value in sorted(D.items()) You might want just a subrange of the dictionary (say the 100th through 150th items in sorted order) without having to sort the entire dictio

Re: Python on imac

2007-10-14 Thread w . greg . phillips
On Oct 13, 7:21 pm, John Velman <[EMAIL PROTECTED]> wrote: > I'm considering moving from Linux to imac. I've recently returned to > Python (was never very expert) to develop a small gui application. At > present I plan to use PyGTK with Pango and Cairo. You should be aware that unless something

Re: GLE-like python package

2007-10-14 Thread rasmus
On Oct 14, 12:34 pm, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > Cesar G. Miguel wrote: > > I think this is what you're looking for: > > >http://pyx.sourceforge.net/ > > It damn sure is (a straight ripoff of GLE ;))! > > The syntax seems a bit messier than GLE (naturally) but since it is > p

Re: Entering username & password automatically using urllib.urlopen

2007-10-14 Thread Daniel Larsson
You form the URL thus: http://:@:/ This is defined in RFC 1738 On 10/14/07, rodrigo <[EMAIL PROTECTED]> wrote: > > I am trying to retrieve a password protected page using: > > get = urllib.urlopen('http://password.protected.url";').read() > > While doing t

Re: int to str in list elements..

2007-10-14 Thread Alex Martelli
Abandoned <[EMAIL PROTECTED]> wrote: > Hi.. > I have a list as a=[1, 2, 3 ] (4 million elements) > and > b=",".join(a) > than > TypeError: sequence item 0: expected string, int found > I want to change list to a=['1','2','3'] but i don't want to use FOR > because my list very very big. > I'm

RE: Entering username & password automatically using urllib.urlopen

2007-10-14 Thread Ryan Ginstrom
> On Behalf Of rodrigo > I am trying to retrieve a password protected page using: > > get = urllib.urlopen('http://password.protected.url";').read() I would suggest looking at mechanize. http://wwwsearch.sourceforge.net/mechanize/ from mechanize import Browser USERNAME = "user" PASSWORD = "secr

Simple HTML template engine?

2007-10-14 Thread allen.fowler
Hello, Can anyone recommend a simple python template engine for generating HTML that relies only on the Pyhon Core modules? No need for caching, template compilation, etc. Speed is not a major issue. I just need looping and conditionals. Template inheritance would be a bonus. I've seen Genshi

use lines as argument to a command

2007-10-14 Thread Shoryuken
I'm new to Python, so my question may sounds naive. Here is it. I have a text file like this: www.a.com www.b.com www.c.com ... I want to read one line from this file at a time, which I know how to do. And use it as an argument to a command, for example, telnet www.a.com and so on. However I hav

Re: Entering username & password automatically using urllib.urlopen

2007-10-14 Thread James Matthews
if you want to hardcode the password in the url. What you need to do is http:username:[EMAIL PROTECTED] On 10/14/07, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > rodrigo schrieb: > > I am trying to retrieve a password protected page using: > > > > get = urllib.urlopen('http://password.protected

Re: The fundamental concept of continuations

2007-10-14 Thread George Neuner
On Mon, 15 Oct 2007 11:56:39 +1300, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: >In message <[EMAIL PROTECTED]>, Barb Knox wrote: > >> Instead of function A returning to its caller, the >> caller provides an additional argument (the "continuation") which is a >> function B to be called by A wit

Re: Simple HTML template engine?

2007-10-14 Thread John Nagle
allen.fowler wrote: > Hello, > > Can anyone recommend a simple python template engine for generating > HTML that relies only on the Pyhon Core modules? > > No need for caching, template compilation, etc. > > Speed is not a major issue. > > I just need looping and conditionals. Template inherita

Re: Newbi Q: Recursively reverse lists but NOT strings?

2007-10-14 Thread Victor B. Gonzalez
On Sunday 14 October 2007 5:06:19 pm Dmitri O.Kondratiev wrote: > The function I wrote (below) reverses lists all right: > > def reverse(xs): > if xs == []: > return [] > else: > return (reverse (xs[1:])) + [xs[0]] > > >>> reverse ([1,2,3]) > > [3, 2, 1] > > Yet when I try t

Re: Newbi Q: Recursively reverse lists but NOT strings?

2007-10-14 Thread Marc 'BlackJack' Rintsch
On Mon, 15 Oct 2007 02:11:27 -0400, Victor B. Gonzalez wrote: > On Sunday 14 October 2007 5:06:19 pm Dmitri O.Kondratiev wrote: >> The function I wrote (below) reverses lists all right: >> >> def reverse(xs): >> if xs == []: >> return [] >> else: >> return (reverse (xs[1:])

Re: Newbi Q: Recursively reverse lists but NOT strings?

2007-10-14 Thread George Sakkis
On Oct 15, 2:30 am, Gary Herron <[EMAIL PROTECTED]> wrote: > Dmitri O.Kondratiev wrote: > > > The function I wrote (below) reverses lists all right: > > > def reverse(xs): > > if xs == []: > > return [] > > else: > > return (reverse (xs[1:])) + [xs[0]] > > > >>> reverse ([1,

Re: Newbi Q: Recursively reverse lists but NOT strings?

2007-10-14 Thread Gary Herron
Dmitri O.Kondratiev wrote: > > The function I wrote (below) reverses lists all right: > > def reverse(xs): > if xs == []: > return [] > else: > return (reverse (xs[1:])) + [xs[0]] > > > >>> reverse ([1,2,3]) > [3, 2, 1] > >>> > > > Yet when I try to reverse a string I g