Re: use lines as argument to a command

2007-10-15 Thread Amit Khemka
On 10/15/07, Shoryuken <[EMAIL PROTECTED]> wrote: > 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

Re: Simple HTML template engine?

2007-10-15 Thread Adrian Cherry
"allen.fowler" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > 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 jus

Twisted (or for loops ?) madness

2007-10-15 Thread looping
Hi, Probably not the best group to post my question but I'm sure there is some people here that use Twisted. First here is the beginning of my source code: from twisted.internet import reactor, defer, threads import time class CompilerThread(object): def __init__(self, task, delay): s

Re: Cross-platform GUI development

2007-10-15 Thread Eric Brunel
On Sat, 13 Oct 2007 06:34:14 +0200, Michael L Torrie <[EMAIL PROTECTED]> wrote: [snip] > You do have > to take pains to make the app "feel" native, though. Like follow the UI > guidelines of the platform, etc. You're absolutely right; I just wanted to add a precision: it's true for every too

Re: Simple HTML template engine?

2007-10-15 Thread Ciprian Dorin Craciun
Have you tried CherryPy? http://www.cherrypy.org/ It's not a template engine, but a simple web server engine, and you could code your conditionals and loops directly in Python... When I have tried it, it looked very nice and easy. Ciprian. On 10/15/07, allen.fowler <[EMAIL PROTECTED

Re: pydev code completion problem

2007-10-15 Thread Alexandre Badez
On Oct 14, 9:45 pm, Lukasz Mierzejewski <[EMAIL PROTECTED]> wrote: > 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()) > > on

ACM SIGAPL / APL2007 Conference / Montreal / one week away

2007-10-15 Thread Mike Kent
Conference page // with links to program details // (updated Friday 10/12) http://www.sigapl.org/apl2007.html Co-located with OOPSLA 2007 http://www.oopsla.org/oopsla2007 On-line registration (through Wednesday 10/17) http://www.regmaster.com/c

Re: Memory Problems in Windows 2003 Server

2007-10-15 Thread amdescombes
Yes, I think that might be the issue, perhaps I could implement the solution using several dictionaries instead of just one. Are there any classes that implement disk based dictionaries? Thanks, Andre > > I don't know whether Python dictionaries must live in a contiguous piece of > memory, but

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

2007-10-15 Thread Dmitri O.Kondratiev
Gary, thanks for lots of info! Python strings are not lists! I got it now. That's a pity, I need two different functions: one to reverse a list and one to reverse a string: def reverseList(xs): if xs == []: return xs else: return (reverseList (xs[1:])) + [xs[0]] def revers

Re: Memory Problems in Windows 2003 Server

2007-10-15 Thread Marc 'BlackJack' Rintsch
On Mon, 15 Oct 2007 11:31:59 +0200, amdescombes wrote: > Are there any classes that implement disk based dictionaries? Take a look at the `shelve` module from the standard library. Or object databases like ZODB or Durus. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/

Re: Twisted (or for loops ?) madness

2007-10-15 Thread looping
On Oct 15, 9:46 am, looping <[EMAIL PROTECTED]> wrote: > l = [ct1, ct2, ct3] > for c in l: > d.addCallback(lambda result: c.compile()) > > reactor.callLater(20, reactor.stop) > reactor.run() > > Output: > > Compile : *OBJECT 1* > <__main__.CompilerThread object at 0x00BAD030> > Start : *OBJECT

Re: Simple HTML template engine?

2007-10-15 Thread Will McGugan
allen.fowler wrote: > Hello, > > Can anyone recommend a simple python template engine for generating > HTML that relies only on the Pyhon Core modules? > Mako (http://www.makotemplates.org/) sounds like what you want.. Will McGugan http://www.willmcgugan.com -- http://mail.python.org/mailman/lis

Re: Simple HTML template engine?

2007-10-15 Thread Will McGugan
allen.fowler wrote: > Hello, > > Can anyone recommend a simple python template engine for generating > HTML that relies only on the Pyhon Core modules? > Mako (http://www.makotemplates.org/) sounds like what you want.. Will McGugan http://www.willmcgugan.com -- http://mail.python.org/mailman/lis

Re: Twisted (or for loops ?) madness

2007-10-15 Thread Diez B. Roggisch
looping wrote: > On Oct 15, 9:46 am, looping <[EMAIL PROTECTED]> wrote: >> l = [ct1, ct2, ct3] >> for c in l: >> d.addCallback(lambda result: c.compile()) >> >> reactor.callLater(20, reactor.stop) >> reactor.run() >> >> Output: >> >> Compile : *OBJECT 1* >> <__main__.CompilerThread object at 0

Re: Twisted (or for loops ?) madness

2007-10-15 Thread Michele Simionato
On Oct 15, 12:10 pm, looping <[EMAIL PROTECTED]> wrote: > > Why lambda doesn't work ? (variable scope problem ?) This is a well known issue of for loops. Some believe it to be a bug but Guido says it is a design decision, in the sense that Python always do late binding. If you browse this list you

Re: Simple Text Processing Help

2007-10-15 Thread patrick . waldo
> lines = open('your_file.txt').readlines()[:4] > print lines > print map(len, lines) gave me: ['\xef\xbb\xbf200-720-769-93-2\n', 'kyselina mo\xc4\x8dov \xc3\xa1 C5H4N4O3\n', '\n', '200-001-8\t50-00-0\n'] [28, 32, 1, 18] I think it means that I'm still at option 3. I got

Re: Simple Text Processing Help

2007-10-15 Thread patrick . waldo
> lines = open('your_file.txt').readlines()[:4] > print lines > print map(len, lines) gave me: ['\xef\xbb\xbf200-720-769-93-2\n', 'kyselina mo\xc4\x8dov \xc3\xa1 C5H4N4O3\n', '\n', '200-001-8\t50-00-0\n'] [28, 32, 1, 18] I think it means that I'm still at option 3. I got

Re: Twisted (or for loops ?) madness

2007-10-15 Thread looping
On Oct 15, 12:33 pm, Michele Simionato <[EMAIL PROTECTED]> wrote: > is a design decision, in the sense that Python always do late binding. > If you > you will get funclist[0]() == funclist[1]() == funclist[2]() == 3 (you > get the latest > binding of "i"). As you see, it has nothing to do with lam

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

2007-10-15 Thread paul
Dmitri O.Kondratiev schrieb: > Gary, thanks for lots of info! > Python strings are not lists! I got it now. That's a pity, I need two > different functions: one to reverse a list and one to reverse a string: Not necessarily, you can handle both cases in one function: def reverse(xs): if xs in [

Re: Simple Text Processing Help

2007-10-15 Thread Marc 'BlackJack' Rintsch
On Mon, 15 Oct 2007 10:47:16 +, patrick.waldo wrote: > my sample input file looks like this( not organized,as you see it): > 200-720-769-93-2 > kyselina mocová C5H4N4O3 > > 200-001-8 50-00-0 > formaldehyd CH2O > > 200-002-3 > 50-01-1 > guanidínium-chlorid CH5N3.C

Re: Last iteration?

2007-10-15 Thread Peter Otten
Diez B. Roggisch wrote: > out:) But I wanted a general purpose based solution to be available that > doesn't count on len() working on an arbitrary iterable. You show signs of a severe case of morbus itertools. I, too, am affected and have not yet fully recovered... Peter -- http://mail.python

Re: Twisted (or for loops ?) madness

2007-10-15 Thread Michele Simionato
On Oct 15, 1:01 pm, looping <[EMAIL PROTECTED]> wrote: > So if I understand what Michele wrote (thanks too), when a function is > defined (with def), no scope is saved and every variable value not > passed in parameter is lost ? It means that variable value come from > the outer scope when the fu

Re: Simple Text Processing Help

2007-10-15 Thread Paul Hankin
On Oct 15, 12:20 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Mon, 15 Oct 2007 10:47:16 +, patrick.waldo wrote: > > my sample input file looks like this( not organized,as you see it): > > 200-720-769-93-2 > > kyselina mocová C5H4N4O3 > > > 200-001-8 50-00-0 >

Re: Twisted (or for loops ?) madness

2007-10-15 Thread looping
On Oct 15, 1:51 pm, Michele Simionato <[EMAIL PROTECTED]> wrote: > On Oct 15, 1:01 pm, looping <[EMAIL PROTECTED]> wrote: > > > So if I understand what Michele wrote (thanks too), when a function is > > defined (with def), no scope is saved and every variable value not > > passed in parameter is lo

Re: Simple Text Processing Help

2007-10-15 Thread Peter Otten
patrick.waldo wrote: > my sample input file looks like this( not organized,as you see it): > 200-720-769-93-2 > kyselina mocová C5H4N4O3 > > 200-001-8 50-00-0 > formaldehyd CH2O > > 200-002-3 > 50-01-1 > guanidínium-chlorid CH5N3.ClH Assuming that the records are al

PyQt ProgressBar

2007-10-15 Thread luca72
Hello i have made anly one test like this: from time import sleep barra = QtGui.QProgressBar() barra.setMinimum(0) barra.setMaximum(10) for a in range(10): sleep(1) barra.setValue(a) app.processEvents() But the bar remain fix to 0% don't increase. can you tell me how t

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

2007-10-15 Thread Steven D'Aprano
On Mon, 15 Oct 2007 13:13:48 +0200, paul wrote: > Dmitri O.Kondratiev schrieb: >> Gary, thanks for lots of info! >> Python strings are not lists! I got it now. That's a pity, I need two >> different functions: one to reverse a list and one to reverse a string: > Not necessarily, you can handle bot

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

2007-10-15 Thread Francesco Guerrieri
On 10/15/07, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >>> ''.join(reversed("abc")) > 'cba' > >>> list(reversed(range(3))) > [2, 1, 0] > > It doesn't take much to make a more user-friendly version: > > > def myreversed(sequence): > if isinstance(sequence, basestring): > return type(s

Re: Simple HTML template engine?

2007-10-15 Thread Ivo
Ciprian Dorin Craciun wrote: > Have you tried CherryPy? http://www.cherrypy.org/ > > It's not a template engine, but a simple web server engine, and > you could code your conditionals and loops directly in Python... When > I have tried it, it looked very nice and easy. > > Ciprian. >

Re: Python module for making Quicktime or mpeg movies from images

2007-10-15 Thread Hyuga
On Oct 12, 3:53 pm, jeremito <[EMAIL PROTECTED]> wrote: > > NodeBox; nodebox.org > > > GUI application that creates either PDFs or Quicktime vids from python > > code. Unix/Linux/MacOS. > > I actually found NodeBox in my googling. This seems to be a stand > alone application. I need to be able to

[ANN] IronPython Community Edition r7

2007-10-15 Thread Sanghyeon Seo
This is the seventh release of IronPython Community Edition (IPCE). Download from SourceForge: http://sourceforge.net/projects/fepy FePy project aims to provide enhancements and add-ons for IronPython. http://fepy.sourceforge.net/ This work was in part supported by Mozilla Corporation. FePy pro

Re: Python on imac

2007-10-15 Thread has
On 14 Oct, 19:19, John Velman <[EMAIL PROTECTED]> wrote: > Thanks to all. I'll look into wx before I get too much further. - For prebuilt binaries of the Python framework and various third- party packages, including wxPython, see: http://www.pythonmac.org/packages/py25-fat/index.html (Note that

Online Jobs.Earn Rs.50000 every month.

2007-10-15 Thread praba
Online Jobs.Earn Rs.5 every month. http://readymademoney.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Cross-platform GUI development

2007-10-15 Thread Kevin Walzer
David Tremouilles wrote: > "crappy", "waaay better" > I will not feed the troll... > Pygtk on mac just do the work for me on a more than satisfying way. > If that's the case, good for you. If your application is open-source, then perhaps it's not unreasonable to expect your users to adapt to t

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

2007-10-15 Thread Steven D'Aprano
On Mon, 15 Oct 2007 14:47:30 +0200, Francesco Guerrieri wrote: >> def myreversed(sequence): >> if isinstance(sequence, basestring): >> return type(sequence)().join(reversed(sequence)) >> else: >> return type(sequence)(reversed(sequence)) >> >> (in fact, that's so simple I w

Re: EasyMock for python ?

2007-10-15 Thread Andrew Durdin
On 10/12/07, Ben Finney <[EMAIL PROTECTED]> wrote: > > I've had good results with Ian Bicking's 'minimock.py' > http://blog.ianbicking.org/minimock.html>. It uses the existing > 'doctest' functionality for its output, and a minimock.Mock will mock > *everything* (using further Mock instances for at

Re: Cross-platform GUI development

2007-10-15 Thread Diez B. Roggisch
David Tremouilles wrote: > "crappy", "waaay better" > I will not feed the troll... > Pygtk on mac just do the work for me on a more than satisfying way. I should have worded more carefully, it wasn't intended as trolling. Sorry for that. But the point I wanted to make still stands - the native

python logging module and custom handler specified in config file

2007-10-15 Thread Frank Aune
Hello, I've been playing with the python logging module lately, and I manage to log to both stderr and MySQL database. What I'm wondering, is if its possible to specify the database handler in a config file like: [handler_database] class=DBHandler level=DEBUG formatter=database args=('localho

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

2007-10-15 Thread Gary Herron
Dmitri O.Kondratiev wrote: > Gary, thanks for lots of info! > Python strings are not lists! I got it now. That's a pity, I need two > different functions: one to reverse a list and one to reverse a string: True, they are not both lists, but they *are* both sequences, with some things in common. In

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

2007-10-15 Thread Francesco Guerrieri
On 10/15/07, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Mon, 15 Oct 2007 14:47:30 +0200, Francesco Guerrieri wrote: > > >> def myreversed(sequence): > >> if isinstance(sequence, basestring): > >> return type(sequence)().join(reversed(sequence)) > >> else: > >> return ty

Re: Order of tuples in dict.items()

2007-10-15 Thread Erik Jones
On Oct 14, 2007, at 5:27 PM, Steven D'Aprano wrote: > 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? > [...] >>

Newbi Q: What is a rational for strings not being lists in Python?

2007-10-15 Thread Dmitri O.Kondratiev
To clarify my point: reverse() is a lucky one - Python has variants of *this particular* function both for lists and strings. Yet what about other list functions? How in general, can I write a function that works both on list and string types? Both are sequences, right? Why string is not a subt

View XMLRPC Requests/Responses?

2007-10-15 Thread xkenneth
Hi, I'm working on developing an XML-RPC interface from LabVIEW to python and I would really like to see how python is forming it's XML- RPC requests/responses. Is there any way I can force these to a log or print them to the screen? Thanks. Regards, Ken -- http://mail.python.org/mailman/li

Re: Newbi Q: What is a rational for strings not being lists in Python?

2007-10-15 Thread Simon Brunning
On 10/15/07, Dmitri O.Kondratiev <[EMAIL PROTECTED]> wrote: > To clarify my point: > reverse() is a lucky one - Python has variants of *this particular* > function both for lists and strings. Yet what about other list functions? > How in general, can I write a function that works both on list a

class fails if imported

2007-10-15 Thread witichis
Hi, I wrote a class to read in a binary file: see the code of readWLdata.py below --8<--- test.py from readWLdata import block if __name__ == "__main__": print "read WL data" b = block('WL100/AAPL.wl') for i in range(b.cnt): print i

Re: View XMLRPC Requests/Responses?

2007-10-15 Thread Diez B. Roggisch
xkenneth wrote: > Hi, > > I'm working on developing an XML-RPC interface from LabVIEW to > python and I would really like to see how python is forming it's XML- > RPC requests/responses. Is there any way I can force these to a log or > print them to the screen? Thanks. I've utilized the apac

A Python way to get MS Access table column information?

2007-10-15 Thread goldtech
Using Python and OBDC in MS-Access DBs. So, I'm able to run SQL statements from Python on an Access DB. Is there an SQL statement that will give me column information? For a table I want to know the data type and of course colum/Attribute name for each column. So far the answer has been "no". VB

Setting a timeout for a cookie

2007-10-15 Thread sophie_newbie
Hi, I'm wondering how do you set a 'timeout' or expiry date/time for a cookie set using a python cgi script. I can set a cookie ok but I dunno how to set the expiry time so it always expires at the end of the session. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: A Python way to get MS Access table column information?

2007-10-15 Thread Diez B. Roggisch
goldtech wrote: > Using Python and OBDC in MS-Access DBs. So, I'm able to run SQL > statements from Python on an Access DB. > > Is there an SQL statement that will give me column information? For a > table I want to know the data type and of course colum/Attribute name > for each column. > > So

Re: Fwd: NUCULAR fielded text searchable indexing

2007-10-15 Thread aaron . watters
On Oct 12, 2:01 am, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > That's reasonable speed, but is that just to do the set intersections > and return the size of the result set, or does it retrieve the actual > result set? It only showed 20 results on a page. I notice

Re: Don't use __slots__ (was Re: Problem of Readability of Python)

2007-10-15 Thread Aahz
In article <[EMAIL PROTECTED]>, Steven Bethard <[EMAIL PROTECTED]> wrote: >Aahz wrote: >> In article <[EMAIL PROTECTED]>, >> Steven Bethard <[EMAIL PROTECTED]> wrote: >>> >>> You can use __slots__ [...] >> >> Aaaugh! Don't use __slots__! >> >> Seriously, __slots__ are for wizards writing appl

Re: Convert obejct string repr to actual object

2007-10-15 Thread English, Mark
X-Replace-Address: [EMAIL PROTECTED] On 12 Oct, 18:14, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Fri, 2007-10-12 at 17:41 +0100, English, Mark wrote: > > > From: Tor Erik Sønvisen > > > Date: October 8th 2007 > > > I've tried locating some code that can recreate an object from > > > it's string

Re: View XMLRPC Requests/Responses?

2007-10-15 Thread vasudevram
On Oct 15, 8:10 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > xkenneth wrote: > > Hi, > > > I'm working on developing an XML-RPC interface from LabVIEW to > > python and I would really like to see how python is forming it's XML- > > RPC requests/responses. Is there any way I can force the

Re: View XMLRPC Requests/Responses?

2007-10-15 Thread vasudevram
On Oct 15, 8:49 pm, vasudevram <[EMAIL PROTECTED]> wrote: > On Oct 15, 8:10 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > xkenneth wrote: > > > Hi, > > > > I'm working on developing an XML-RPC interface from LabVIEW to > > > python and I would really like to see how python is forming

Re: A Python way to get MS Access table column information?

2007-10-15 Thread M.-A. Lemburg
On 2007-10-15 17:16, goldtech wrote: > Using Python and OBDC in MS-Access DBs. So, I'm able to run SQL > statements from Python on an Access DB. > > Is there an SQL statement that will give me column information? For a > table I want to know the data type and of course colum/Attribute name > for e

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

2007-10-15 Thread Ian Bicking
On Oct 14, 3:46 am, Michele Simionato <[EMAIL PROTECTED]> wrote: > I think we do agree entirely, it is just that the application we have > in > mind is more a collection of web services than a traditional Web > application. > Now, since you are here, there is an unrelated question that I want to >

Re: View XMLRPC Requests/Responses?

2007-10-15 Thread [EMAIL PROTECTED]
On Oct 15, 11:07 am, xkenneth <[EMAIL PROTECTED]> wrote: > Hi, > > I'm working on developing an XML-RPC interface from LabVIEW to > python and I would really like to see how python is forming it's XML- > RPC requests/responses. Is there any way I can force these to a log or > print them to the

Re: Setting a timeout for a cookie

2007-10-15 Thread Peter Bengtsson
On Oct 15, 4:09 pm, sophie_newbie <[EMAIL PROTECTED]> wrote: > Hi, > > I'm wondering how do you set a 'timeout' or expiry date/time for a > cookie set using a python cgi script. I can set a cookie ok but I > dunno how to set the expiry time so it always expires at the end of > the session. > Easy,

Re: View XMLRPC Requests/Responses?

2007-10-15 Thread [EMAIL PROTECTED]
On Oct 15, 12:31 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Oct 15, 11:07 am, xkenneth <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I'm working on developing an XML-RPC interface from LabVIEW to > > python and I would really like to see how python is forming it's XML- > > RPC request

Normalize a polish L

2007-10-15 Thread Peter Bengtsson
In UTF8, \u0141 is a capital L with a little dash through it as can be seen in this image: http://static.peterbe.com/lukasz.png I tried this: >>> import unicodedata >>> unicodedata.normalize('NFKD', u'\u0141').encode('ascii','ignore') '' I was hoping it would convert it it 'L' because that's what

Re: Newbi Q: What is a rational for strings not being lists in Python?

2007-10-15 Thread Neil Cerutti
On 2007-10-15, Simon Brunning <[EMAIL PROTECTED]> wrote: > On 10/15/07, Dmitri O.Kondratiev <[EMAIL PROTECTED]> wrote: >> To clarify my point: >> reverse() is a lucky one - Python has variants of *this particular* >> function both for lists and strings. Yet what about other list functions? >> Ho

Hardware components

2007-10-15 Thread draganw
Hardware components http://comp-components.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

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

2007-10-15 Thread Chris Mellon
On 10/15/07, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Mon, 15 Oct 2007 13:13:48 +0200, paul wrote: > > > Dmitri O.Kondratiev schrieb: > >> Gary, thanks for lots of info! > >> Python strings are not lists! I got it now. That's a pity, I need two > >> different functions: one to reverse a list

Desperately need help for html to LaTeX conversion

2007-10-15 Thread vasan999
Because my previous thread had no reply that could help me, I start it again. I am very depressed now with the following problem. I have a set of html files, must be human readable (as some of the output tools produce human readable LaTeX) that I want to convert to human readable latex. The pro

Re: Normalize a polish L

2007-10-15 Thread Thorsten Kampe
* Peter Bengtsson (Mon, 15 Oct 2007 16:33:26 -) > In UTF8, \u0141 is a capital L with a little dash through it as can be > seen in this image: > http://static.peterbe.com/lukasz.png > I tried this: > >>> import unicodedata > >>> unicodedata.normalize('NFKD', u'\u0141').encode('ascii','ignore')

Re: Desperately need help for html to LaTeX conversion

2007-10-15 Thread ynotssor
In news:[EMAIL PROTECTED], [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > The perl one does not run due to path problems. Nothing could be easier to fix than that. -- http://mail.python.org/mailman/listinfo/python-list

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

2007-10-15 Thread Kurt Smith
On 10/15/07, Gary Herron <[EMAIL PROTECTED]> wrote: > Dmitri O.Kondratiev wrote: > > Gary, thanks for lots of info! > > Python strings are not lists! I got it now. That's a pity, I need two > > different functions: one to reverse a list and one to reverse a string: > True, they are not both lists,

Automatically organize module imports

2007-10-15 Thread Thomas Wittek
Hi! Is there any possibility/tool to automatically organize the imports at the beginning of a module? I don't mean automatic imports like autoimp does as I like seeing where my objects/functions really come from. For the same reason I don't like "from foo import *". The downside is that you have

Re: Automatically organize module imports

2007-10-15 Thread Jean-Paul Calderone
On Mon, 15 Oct 2007 20:52:11 +0200, Thomas Wittek <[EMAIL PROTECTED]> wrote: >Hi! > >Is there any possibility/tool to automatically organize the imports at >the beginning of a module? > >I don't mean automatic imports like autoimp does as I like seeing where >my objects/functions really come from.

Re: Normalize a polish L

2007-10-15 Thread Bjoern Schliessmann
Thorsten Kampe wrote: > The 'L' is actually pronounced like the English "w"... '?' originally comes from "L" () and is AFAIK transcribed so. Also, a friend of mine writes himself "Lukas" (pronounced L-) even though in Polish his name is ?ukas (short Wh-). Regard

Re: Normalize a polish L

2007-10-15 Thread Rob Wolfe
Peter Bengtsson <[EMAIL PROTECTED]> writes: > In UTF8, \u0141 is a capital L with a little dash through it as can be > seen in this image: > http://static.peterbe.com/lukasz.png > > I tried this: import unicodedata unicodedata.normalize('NFKD', u'\u0141').encode('ascii','ignore') > '' >

Re: Newbi Q: What is a rational for strings not being lists in Python?

2007-10-15 Thread Matt McCredie
On 10/15/07, Dmitri O.Kondratiev <[EMAIL PROTECTED]> wrote: > To clarify my point: > reverse() is a lucky one - Python has variants of *this particular* > function both for lists and strings. Yet what about other list functions? > How in general, can I write a function that works both on list a

Re: Normalize a polish L

2007-10-15 Thread Thorsten Kampe
* Bjoern Schliessmann (Mon, 15 Oct 2007 21:51:54 +0200) > Thorsten Kampe wrote: > > The 'L' is actually pronounced like the English "w"... > > '?' originally comes from "L" () and > is AFAIK transcribed so. There are lots of possible transcriptions for "LATIN CAPI

sqlite and TemporaryFile under Windows

2007-10-15 Thread Matthieu Brucher
Hi, I want to create a temporary database that is downloaded for the net. So I want to use a temporary file that will be deleted at the end of my program. For this, I wanted to use tempfile.TemporaryFile. The problem with Windows is that I can't give to sqlite3.connect() the file neither can I giv

Re: sqlite and TemporaryFile under Windows

2007-10-15 Thread Paul McNett
Matthieu Brucher wrote: > I want to create a temporary database that is downloaded for the net. So > I want to use a temporary file that will be deleted at the end of my > program. For this, I wanted to use tempfile.TemporaryFile. The problem > with Windows is that I can't give to sqlite3.connec

Re: sqlite and TemporaryFile under Windows

2007-10-15 Thread Matthieu Brucher
> > Are you aware that you can do an in-memory database (IOW no file at all)? > > cur = sqlite.connect(":memory:") > Yes, but in this case, how can I use the DB that I downloaded from the net ? If this is the way of using sqlite, it is still cumbersome as a lot of other classes that work on files

Re: Simple Text Processing Help

2007-10-15 Thread patrick . waldo
Wow, thank you all. All three work. To output correctly I needed to add: output.write("\r\n") This is really a great help!! Because of my limited Python knowledge, I will need to try to figure out exactly how they work for future text manipulation and for my own knowledge. Could you recommend

Re: Order of tuples in dict.items()

2007-10-15 Thread John Machin
On Oct 16, 12:47 am, Erik Jones <[EMAIL PROTECTED]> wrote: > Not between two consecutive reads, no. However, after any resizing > of a dict the result of Python's hash function for any given newly > inserted key is extremely likely to be different than it would have > been before the resizing, i.

Re: First class lexical closures

2007-10-15 Thread Bruno Desthuilliers
Jon Harrop a écrit : > 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. def makeadder(x): def add(y): return x+y return add If that's what you mean, then

py2app help

2007-10-15 Thread Massimo Di Pierro
Hello, Two users have reported this error when used the OSX version of Gluon (http://mdp.cti.depaul.edu/examples) Traceback (most recent call last): File "/Users/jacek/src/gluon/runme.app/Contents/Resources/ __boot__.py", line 157, in rograms/gluon/runme.py')) File "/Users/jacek/

Re: sqlite and TemporaryFile under Windows

2007-10-15 Thread Paul McNett
Matthieu Brucher wrote: > Are you aware that you can do an in-memory database (IOW no file at > all)? > > cur = sqlite.connect (":memory:") > > > Yes, but in this case, how can I use the DB that I downloaded from the net ? Ah, sorry, I guess I missed that part. > If this is the way

Re: Normalize a polish L

2007-10-15 Thread John Machin
On Oct 16, 2:33 am, Peter Bengtsson <[EMAIL PROTECTED]> wrote: > In UTF8, \u0141 is a capital L with a little dash through it as can be > seen in this image:http://static.peterbe.com/lukasz.png > > I tried this:>>> import unicodedata > >>> unicodedata.normalize('NFKD', u'\u0141').encode('ascii','ig

Re: Normalize a polish L

2007-10-15 Thread Bjoern Schliessmann
Thorsten Kampe wrote: > Why do you try to use characters in a character set that does not > contain these characters? That doesn't make any sense. I thought KNode was smart enough to switch to UTF-8; obviously, it isn't. Regards, Björn -- BOFH excuse #121: halon system went off and killed t

Re: Normalize a polish L

2007-10-15 Thread Bjoern Schliessmann
Thorsten Kampe wrote: > The 'L' is actually pronounced like the English "w"... '?' originally comes from "L" () and is AFAIK transcribed so. Also, a friend of mine writes himself "Lukas" (pronounced L-) even though in Polish his name is Łukas (short Wh-). Regard

Re: Simple Text Processing Help

2007-10-15 Thread Paul Hankin
On Oct 15, 10:08 pm, [EMAIL PROTECTED] wrote: > Because of my limited Python knowledge, I will need to try to figure > out exactly how they work for future text manipulation and for my own > knowledge. Could you recommend some resources for this kind of text > manipulation? Also, I conceptually g

Re: py2app help

2007-10-15 Thread has
On 15 Oct, 22:21, Massimo Di Pierro <[EMAIL PROTECTED]> wrote: > Hello, > > Two users have reported this error when used the OSX version of Gluon > (http://mdp.cti.depaul.edu/examples) > > Traceback (most recent call last): > File "/Users/jacek/src/gluon/runme.app/Contents/Resources/ > __boot

Re: Fwd: NUCULAR fielded text searchable indexing

2007-10-15 Thread Terry Reedy
| > | > http://www.tomshardware.com/2006/09/20/conventional_hard_drive_obsole... Unclipped link is http://www.tomshardware.com/2006/09/20/conventional_hard_drive_obsoletism/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Order of tuples in dict.items()

2007-10-15 Thread Steven D'Aprano
On Mon, 15 Oct 2007 14:11:27 -0700, John Machin wrote: > On Oct 16, 12:47 am, Erik Jones <[EMAIL PROTECTED]> wrote: > >> Not between two consecutive reads, no. However, after any resizing of >> a dict the result of Python's hash function for any given newly >> inserted key is extremely likely to

Re: CGI and external JavaScript nightmare

2007-10-15 Thread File Grok
What's your URL for an example page that is having this error? Trying to figure out Google's JS is usually an example of self abuse. > My website is built from a Python CGI and works great. I'm now > including Google Ads, which requires two pieces of JavaScript; the > first contains the display se

Re: EasyMock for python ?

2007-10-15 Thread Ben Finney
Ben Finney <[EMAIL PROTECTED]> writes: > I've had good results with Ian Bicking's 'minimock.py' > http://blog.ianbicking.org/minimock.html>. It uses the existing > 'doctest' functionality for its output [...] That doesn't make much sense, and it's wrong; it uses 'print' for its output. That shoul

Re: Order of tuples in dict.items()

2007-10-15 Thread Erik Jones
On Oct 15, 2007, at 6:07 PM, Steven D'Aprano wrote: > On Mon, 15 Oct 2007 14:11:27 -0700, John Machin wrote: > >> On Oct 16, 12:47 am, Erik Jones <[EMAIL PROTECTED]> wrote: >> >>> Not between two consecutive reads, no. However, after any >>> resizing of >>> a dict the result of Python's hash f

Re: Python module for making Quicktime or mpeg movies from images

2007-10-15 Thread jeremito
On Oct 13, 5:30 am, has <[EMAIL PROTECTED]> wrote: > On 12 Oct, 20:53, jeremito <[EMAIL PROTECTED]> wrote: > > > I actually found NodeBox in my googling. This seems to be a stand > > alone application. I need to be able to convert my images to a movie > > from my code I wrote myself. > > Some Mac

Re: Simple HTML template engine?

2007-10-15 Thread allen.fowler
CherryPy looks nice... though I am just looking to generate static reports. Thanks anyway... I'll keep it in mind for the future. On Oct 15, 4:38 am, "Ciprian Dorin Craciun" <[EMAIL PROTECTED]> wrote: > Have you tried CherryPy?http://www.cherrypy.org/ > > It's not a template engine, but a

Re: Simple HTML template engine?

2007-10-15 Thread Nikita the Spider
In article <[EMAIL PROTECTED]>, "allen.fowler" <[EMAIL PROTECTED]> 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. > >

Re: Simple HTML template engine?

2007-10-15 Thread allen.fowler
On Oct 15, 1:26 am, John Nagle <[EMAIL PROTECTED]> wrote: > 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

PyCon 2008: Call for Talk & Tutorial Proposals

2007-10-15 Thread David Goodger
Proposals for PyCon 2008 talks & tutorials are now being accepted. The deadline for proposals is November 16. PyCon 2008 will be held in Chicago, Illinois, USA, from March 13-20. http://us.pycon.org/2008/ Tutorial Day: Half-Day Tutorials Do you enjoy teaching c

Re: Python module for making Quicktime or mpeg movies from images

2007-10-15 Thread has
On 16 Oct, 00:55, jeremito <[EMAIL PROTECTED]> wrote: > > > -QuickTimePlayer is standard on OS X and its scripting interface > > (which you can access from Python via appscript, and is fully usable > > even in unpaid mode) includes an 'open image sequence' command. > > I have used this, but I want

Re: Newbi Q: What is a rational for strings not being lists in Python?

2007-10-15 Thread Benjamin
On Oct 15, 3:03 pm, "Matt McCredie" <[EMAIL PROTECTED]> wrote: > On 10/15/07, Dmitri O.Kondratiev <[EMAIL PROTECTED]> wrote: > > > > > To clarify my point: > > reverse() is a lucky one - Python has variants of *this particular* > > function both for lists and strings. Yet what about other list f

groupby() seems slow

2007-10-15 Thread 7stud
I'm applying groupby() in a very simplistic way to split up some data, but when I timeit against another method, it takes twice as long. The following groupby() code groups the data between the "" strings: data = [ "1.5","","2.5","3.5","4.5","","","5.5","6.5","", "1.5","","2.5","3.5","4.5","","",

logging module - restricted mode error

2007-10-15 Thread Paul Rudin
I'm occasionally seeing tracebacks like this: Traceback (most recent call last): File "logging/__init__.py", line 744, in emit File "logging/__init__.py", line 630, in format File "logging/__init__.py", line 421, in format RuntimeError: instance.__dict__ not accessible in restricted mode I

  1   2   >