Re: Automatically organize module imports

2007-10-15 Thread Thomas Wittek
Jean-Paul Calderone: > On Mon, 15 Oct 2007 20:52:11 +0200, Thomas Wittek > <[EMAIL PROTECTED]> wrote: >> Is there a tool that can organize my import section? > > Pyflakes will tell you which imports aren't being used (among other > things). I don't know if an existing tool which will automaticall

re.sub

2007-10-15 Thread Massimo Di Pierro
Shouldn't this >>> print re.sub('a','\\n','bab') b b output b\nb instead? Massimo On Oct 16, 2007, at 1:34 AM, George Sakkis wrote: > On Oct 15, 11:02 pm, 7stud <[EMAIL PROTECTED]> wrote: >> I'm applying groupby() in a very simplistic way to split up some >> data, >> but when I timeit aga

Re: groupby() seems slow

2007-10-15 Thread George Sakkis
On Oct 15, 11:02 pm, 7stud <[EMAIL PROTECTED]> wrote: > 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

Re: int to str in list elements..

2007-10-15 Thread Tim Roberts
John Machin <[EMAIL PROTECTED]> wrote: >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']

Re: use lines as argument to a command

2007-10-15 Thread Amit Khemka
On 10/16/07, Shoryuken <[EMAIL PROTECTED]> wrote: > > I guess that you want to loop over a file and for each line in the > > file you want to call some > > external program with the line as the argument. > > > > Have a look at subprocess module > > http://docs.python.org/lib/module-subprocess.html

Re: PyQt ProgressBar

2007-10-15 Thread luca72
No one can help pls Regards Luca -- http://mail.python.org/mailman/listinfo/python-list

IDLE and opening with Python 2.5

2007-10-15 Thread Tony Mullen
Hello, I have several problems. I have installed 2.5.1 on Windows XP. I had a previous installation of Python 2.4 which, in trying to solve the first problem I uninstalled. At present, as far as I know, I only have 2.5.1 installed. Python itself seems to work. If I click python.exe it runs. H

Re: sqlite and TemporaryFile under Windows

2007-10-15 Thread Matthieu Brucher
> > > If this is the way of using sqlite, it is still cumbersome as a lot of > > other classes that work on files can work on file-like (and isn't it the > > whole point of Python ;) ? > > I don't think that sqlite can work on streams, or on file-like objects. Obviously it cannot, but what are t

i need to get orkut (google) data without gdata, pls help!!!!

2007-10-15 Thread coolman_suk
hi,i am making a plugin for my app ( insert.clappings() ) and right now i am in some serious problem. i need a way to authenticate myself into orkut.com, get a session cookie , open a bunch of files, and make rss out of them! i can handle the make rss part. some of u might know about gdata for py

Re: View XMLRPC Requests/Responses?

2007-10-15 Thread Mark T
"xkenneth" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 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 > pri

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 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

Re: Simple Text Processing Help

2007-10-15 Thread Paul McGuire
On Oct 14, 8:48 am, [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

how to print a traceback?

2007-10-15 Thread sndive
i'm struggling to get some proxy code working with liburl[2] and want to print some tracebacks in my class ProxyHTTPConnection::request(). do i have to force an exception and print a backtrace in catch or can i just print the current stack? print_tb takes an argument and short of forcing an excepti

Re: use lines as argument to a command

2007-10-15 Thread Shoryuken
> I guess that you want to loop over a file and for each line in the > file you want to call some > external program with the line as the argument. > > Have a look at subprocess module > http://docs.python.org/lib/module-subprocess.html > > If there is some else that you meant, please specify . >

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

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","","",

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

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

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: 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

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
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: 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: 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: 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: 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: 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: 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: 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: 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: 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 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 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: 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

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: 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

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: 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: 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: 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

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: 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

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 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: 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: 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.

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: 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,

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: 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')

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: 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

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: 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

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

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,

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: 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: 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: 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: 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: 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: 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: 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: 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: 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

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

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

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

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

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

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

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: 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: 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? > [...] >>

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: 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

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: 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: 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

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: 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

[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 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

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: 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: 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

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: 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

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 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 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: 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: 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: 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: 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: 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

  1   2   >