Re: Nested dictionaries trouble

2007-04-18 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, IamIan wrote: > years = ["199%s" % x for x in range(0,10)] > years += ["200%s" % x for x in range(0,10)] > > I haven't had any luck doing this in one line though. Is it possible? In [48]: years = map(str, xrange(1999, 2011)) In [49]: years Out[49]: ['1999', '2000', '20

Re: Compiling python from soruce vs RPM ?

2007-04-18 Thread hlubenow
howa wrote: > I have compiled python 2.5 from source > > i.e. > > ./configure > make > make install > > > but when i try to install another package require python, seems it > can't regonize python... > > e.g.. > > > /usr/bin/python is needed by xyz Does "/usr/bin/python" exist ? Why haven

Re: Future Python Gui?

2007-04-18 Thread hlubenow
[EMAIL PROTECTED] wrote: > If this were just a tool for me, it wouldn't matter. My concern is > distribution. If anybody who wants to run my software then they also > have to go through all the trouble to install these extensions, none > of which seem to have decent instructions. I'm an old-tim

Re: Help Understanding mx.ODBC Error

2007-04-18 Thread Greg Corradini
Steve, As always, thanks for your consistent help on matters big and small. I've managed to solve the problem, although I'm scared b/c the bug is still elusive. I dumped and deleted my seperate Access DBs, created new ones and tried running the scripts on old data (that these scripts were able to

PY shutil on win xp home version

2007-04-18 Thread jim-on-linux
python help, A client is using win xp home. my program contains; shutil.copyfile(n, 'prn') This runs fine on win xp pro but they are getting the following traceback. File "LOP_PRT_10.pyc", line 170, in __init__   File "LOP_PRT_10.pyc", line 188, in Fprint1   File "shutil.pyc", line 47, in

python-list@python.org

2007-04-18 Thread attn . steven . kuo
On Apr 18, 12:23 pm, Anton Vredegoor <[EMAIL PROTECTED]> wrote: (snipped) > But still, the 'while True:' loop and the 'try-except' clause and the > explicit StopIteration are not necessary ... > > from collections import deque > > def xsplitter(seq, pred): > Q = deque(),deque() > it = i

Re: unicode data - accessing codepoints > FFFF on narrow python builts

2007-04-18 Thread vbr
Hi, thanks for the answer, > From: Gabriel Genellina <[EMAIL PROTECTED]> > Subj: Re: unicode data - accessing codepoints > on narrow python builts > Datum: 18.4.2007 21:33:11 > > > py> x=u"\N{GOTHIC LETTER AHSA}" > py> ord(x) > Traceback (most recent

Re: Future Python Gui?

2007-04-18 Thread Jarek Zgoda
[EMAIL PROTECTED] napisał(a): > If this were just a tool for me, it wouldn't matter. My concern is > distribution. If anybody who wants to run my software then they also > have to go through all the trouble to install these extensions, none > of which seem to have decent instructions. I'm an ol

Re: converting currency using locals

2007-04-18 Thread Grzegorz Ślusarek
Dnia Wed, 18 Apr 2007 19:38:26 +0100, Michael Hoffman napisał(a): > Grzegorz Ślusarek wrote: >> Hi all. I have situation that I have value that holds price and I must show >> this price using national specification(e.g. thousands_sep). Any idea how >> this can be done under python 2.4.4? I saw tha

Re: Python crash after using weave inline

2007-04-18 Thread Peter Wang
Soren, For future reference, you might want to direct weave-related questions to the [EMAIL PROTECTED] mailing list. > def cartPolFast(xlen, ylen, x_c, y_c): > > res = zeros((xlen,ylen)) > > code = """ > { > int xlen, ylen, x_c, y_c; This line is unnecessary, because weave expose

Re: Future Python Gui?

2007-04-18 Thread Stef Mientki
> The rumours on "problems installing GUI toolkits" are greatly exagerated Not at all !! As an experienced computer user, I yesterday installed a well known Python package on a clean winXP machine, and it costed me be about 1.5 .. 2 hours !! There are always unexpected situations, I think softwa

Re: Future Python Gui?

2007-04-18 Thread Kevin Walzer
[EMAIL PROTECTED] wrote: >> Tile is available right now in Tk as an extension package, and a Tkinter >> wrapper for it can be found here: >> >> http://tkinter.unpythonic.net/wiki/TileWrapper > > That site seems to be down (500 Internal Server Error). > > >> Tile will be integrated into Tk's core

Re: Python crash after using weave inline

2007-04-18 Thread Soren
On Apr 18, 10:07 pm, Peter Wang <[EMAIL PROTECTED]> wrote: > Soren, > > For future reference, you might want to direct weave-related questions > to the [EMAIL PROTECTED] mailing list. > > > def cartPolFast(xlen, ylen, x_c, y_c): > > > res = zeros((xlen,ylen)) > > > code = """ > > { > >

Re: Help Understanding mx.ODBC Error

2007-04-18 Thread Steve Holden
Greg Corradini wrote: [actually, her wrote it here but I moved it to the bottom] > Steve Holden wrote: >> Greg Corradini wrote: >>> Hello All, >>> A few weeks ago, I wrote two scripts using mx.ODBC on an Access DB. Among >>> other things, both scripts create new tables, perform a query and then >>>

Re: image sequence to Quicktime movie

2007-04-18 Thread half . italian
I haven't experimented with it myself, but you'll probably find what you need here. (Only works on original mac python distribution) [sean:~] sean% python Python 2.3.5 (#1, Aug 12 2006, 00:08:11) [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin Type "help", "copyright", "credits" or "licens

Re: Martel Package from Biopython

2007-04-18 Thread Paul McGuire
On Apr 18, 12:28 pm, elventear <[EMAIL PROTECTED]> wrote: > Hello, > > I know this is not the best place to ask this but I haven't had luck > in the Biopython forums with my questions, so I'll just try here. > > I want to use the Martel package to do some parsing. I've found it to > be very powerfu

tkinter canvas

2007-04-18 Thread Gigs_
how to write text on canvas. i know that i need to use canvas.create_text, but how to write text than when i create_text? or how to access object ID in canvas and change some options? thanks in advance! -- http://mail.python.org/mailman/listinfo/python-list

Re: Future Python Gui?

2007-04-18 Thread kirkjobsluder
On Apr 18, 11:24 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > I'd say that the best bet is to learn swig and similar > > bridging, expanding, and embedding mechanisms. > > Python GUI programming is likely to involve either > > python hooking into frameworks like Cocoa, Qt, or > > wxWidget

Re: unicode data - accessing codepoints > FFFF on narrow python builts

2007-04-18 Thread vbr
Hi, thanks for your answer, I'll try to check the source of unicodedata; Using the wide Unicode build seems to be a kind of overkill for now, as for the vast majority of my uses, the BMP is enough. I was rather looking for some "lower-cost" alternatives for those rare cases, when I need higher mu

Re: PY shutil on win xp home version

2007-04-18 Thread Tim Golden
jim-on-linux wrote: > python help, > > A client is using win xp home. > > my program contains; >shutil.copyfile(n, 'prn') > > This runs fine on win xp pro but they are getting > the following traceback. > > File "LOP_PRT_10.pyc", line 170, in __init__ > File "LOP_PRT_10.pyc", line 188,

Re: Future Python Gui?

2007-04-18 Thread Kevin Walzer
>> I wouldn't mind using just Tkinter, despite it's primative look, >> except that it doesn't support more advanced widgets like "notebook". When Tile becomes part of the core Tk library, it should be accessible from Tkinter as well. Tile has a nice notebook widget. See http://tktable.sourcefor

Re: Future Python Gui?

2007-04-18 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: . . . >I wouldn't mind using just Tkinter, despite it's primative look, >except that it doesn't support more advanced widgets like "notebook".

Installing Python on NT

2007-04-18 Thread Schwartz, Hillary
___ Hillary Schwartz Applications Specialist, IT - Development Lerner, Sampson & Rothfuss, LPA Phone: (513) 241-3100 x3138 [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Python Threads -

2007-04-18 Thread S.Mohideen
Hi All, Can you please suggest a technique in Python where we can spawn few number of worker threads and later map them to a function/s to execute individual Jobs. Any references would be helpful.. Thanks Moin -- http://mail.python.org/mailman/listinfo/python-list

Antigen Notification: Antigen found a message matching a filter

2007-04-18 Thread Antigen_VITORIA
Microsoft Antigen for Exchange found a message matching a filter. The message is currently Detected. Message: "Python_list Digest_ Vol 43_ Issue 299" Filter name: "KEYWORD= spam: xxx " Sent from: "[EMAIL PROTECTED]" Folder: "SMTP Messages\Inbound And Outbound" Location: "ITURAN/First Administrativ

Re: tkinter canvas

2007-04-18 Thread kyosohma
On Apr 18, 3:43 pm, Gigs_ <[EMAIL PROTECTED]> wrote: > how to write text on canvas. i know that i need to use canvas.create_text, but > how to write text than when i create_text? > or how to access object ID in canvas and change some options? > > thanks in advance! All you need to do is canvas.cre

Do other Python GUI toolkits require this?

2007-04-18 Thread Kevin Walzer
From the introduction to PyObjC, the Python-Objective-C bridge on Mac OS X: "As described in Objective-C for PyObjC users the creation of Objective-C objects is a two-stage process. To initialize objects, first call a class method to allocate the memory (typically alloc), and then call an init

Re: ??? POLICE AND CITY/UNIVERSITY OFFICIALS INCOMPETENCE LEADS TO 33 KILLED BY KOREAN-ALQAEDA TERRORIST ???

2007-04-18 Thread mathedman
On 17 Apr 2007 06:56:05 -0700, [EMAIL PROTECTED] wrote: So many of the talking-head rants about VPI are idiotic. 1) bomb scares should have ak\lerted officials --blah blah blah The fact is that on a large university campus bomb threats are almost as common as exams! (there is a

Re: Do other Python GUI toolkits require this?

2007-04-18 Thread James Stroud
Kevin Walzer wrote: > From the introduction to PyObjC, the Python-Objective-C bridge on Mac > OS X: > > "As described in Objective-C for PyObjC users the creation of > Objective-C objects is a two-stage process. To initialize objects, first > call a class method to allocate the memory (typical

comparison with None

2007-04-18 Thread Alan G Isaac
>>> None >= 0 False >>> None <= 0 True Explanation appreciated. Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Compiling python from soruce vs RPM ?

2007-04-18 Thread Paul Boddie
howa wrote: > I have compiled python 2.5 from source > > i.e. > > ./configure > make > make install By default, configure uses /usr/local as the "prefix", not /usr... > but when i try to install another package require python, seems it > can't regonize python... > > e.g.. > > > /usr/bin/python is

Re: Python Threads -

2007-04-18 Thread Aahz
In article <[EMAIL PROTECTED]>, S.Mohideen <[EMAIL PROTECTED]> wrote: > >Can you please suggest a technique in Python where we can spawn few number >of worker threads and later map them to a function/s to execute individual >Jobs. You can see an example for a web spider on my Python website. --

Re: Do other Python GUI toolkits require this?

2007-04-18 Thread Kevin Walzer
James Stroud wrote: > This appears more or less unique to Objective C. It looks that with > PyObjC, you have to interact with the Objective C runtime to manage > memory. This is not required, thankfully, with any other GUI tookits > I've seen. > > I think the main difference is that PyObjC is

Re: comparison with None

2007-04-18 Thread Terry Reedy
"Alan G Isaac" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | >>> None >= 0 | False | >>> None <= 0 | True | | Explanation appreciated. Should be in the reference manual section on comparisons. -- http://mail.python.org/mailman/listinfo/python-list

Re: comparison with None

2007-04-18 Thread Steven Howe
Alan G Isaac wrote: > >>> None >= 0 > False > >>> None <= 0 > True > > Explanation appreciated. > > Thanks, > Alan Isaac > I've read and found that 'None' comparisons is not always a good idea. Better to: from types import NoneType x = None if type( x ) == NoneType: # true < code > el

Re: pycurl problem

2007-04-18 Thread Gabriel Genellina
En Wed, 18 Apr 2007 11:48:06 -0300, pabloski <[EMAIL PROTECTED]> escribió: > I noted that if I define c.proxy and c.url as costants e.g. c.url = > "http://www.google.com/search?blah blah" and c.proxy = > "127.0.0.1:8080" it works > > However if I define them as described before pycurl raises t

Re: comparison with None

2007-04-18 Thread Paul McGuire
On Apr 18, 5:19 pm, Steven Howe <[EMAIL PROTECTED]> wrote: > Alan G Isaac wrote: > > >>> None >= 0 > > False > > >>> None <= 0 > > True > > > Explanation appreciated. > > > Thanks, > > Alan Isaac > > I've read and found that 'None' comparisons is not always a good idea. > Better to: > from types

Re: comparison with None

2007-04-18 Thread brzrkr0
On Apr 18, 3:19 pm, Steven Howe <[EMAIL PROTECTED]> wrote: > I've read and found that 'None' comparisons is not always a good idea. > Better to: > from types import NoneType > > x = None > if type( x ) == NoneType: > # true > < code > > else: > # false; do something else. > < more c

Re: Future Python Gui?

2007-04-18 Thread Paul Boddie
[EMAIL PROTECTED] wrote: > > If Python doesn't declare an official Gui system, then it'll be > fragmented, inconsistent, and unsupportable. I don't agree. GUI frameworks are somewhat like Web frameworks, object- relational mappers, and all the other things that work in different ways, work better

using the sysloghandler class

2007-04-18 Thread Nicholas Milkovits
Hello all, I have a small script which attempts to write to the user.log syslog import logging, logging.handlers logger = logging.getLogger('bender') handler = logging.handlers.SysLogHandler(('localhost', logging.handlers.SYSLOG_UDP_PORT), logging.handlers.SysLogHandler.LOG_USER) formatter = log

Re: What makes an iterator an iterator?

2007-04-18 Thread 7stud
On Apr 18, 8:50 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > The special methods need to be on the type -- having attributes of those > names on the instance doesn't help (applies to all special methods in > the normal, aka newstyle, object model; legacy, aka classic, classes, > work by slightly

Re: comparison with None

2007-04-18 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: > On Apr 18, 3:19 pm, Steven Howe <[EMAIL PROTECTED]> wrote: >> I've read and found that 'None' comparisons is not always a good idea. >> Better to: >> from types import NoneType >> >> x = None >> if type( x ) == NoneType: >> # true >> < code > >> else: >> # fal

Re: comparison with None

2007-04-18 Thread Gary Herron
Alan G Isaac wrote: > >>> None >= 0 > False > >>> None <= 0 > True > > Explanation appreciated. > > Thanks, > Alan Isaac > So that we can sort lists of objects, even when the objects of are different types, Python guarantees to supply a unique and consistent ordering of any two objects. The

Re: comparison with None

2007-04-18 Thread Gary Herron
[EMAIL PROTECTED] wrote: > On Apr 18, 3:19 pm, Steven Howe <[EMAIL PROTECTED]> wrote: > >> I've read and found that 'None' comparisons is not always a good idea. >> Better to: >> from types import NoneType >> >> x = None >> if type( x ) == NoneType: >> # true >> < code > >> else: >>

python-list@python.org

2007-04-18 Thread Anton Vredegoor
[EMAIL PROTECTED] wrote: > Try it with > > def test(): > L = 'a', 1, 2, 'a' > it1, it2 = xsplitter(L, lambda x: x == 'a') > print it1.next() > print it2.next() > print it1.next() > print it2.next() > > > The last print statement raises StopIteration... > We, however, exp

Re: comparison with None

2007-04-18 Thread Robert Kern
Steven Howe wrote: > Alan G Isaac wrote: >> >>> None >= 0 >> False >> >>> None <= 0 >> True >> >> Explanation appreciated. >> >> Thanks, >> Alan Isaac >> > I've read and found that 'None' comparisons is not always a good idea. > Better to: > from types import NoneType > > x = None > if type(

Re: Newbie: import

2007-04-18 Thread 7stud
On Apr 18, 10:34 am, [EMAIL PROTECTED] wrote: > I thought import used relative paths from either the python executable > or the script being executed. I have a script pulling in code from an > arbitrary directory. How is this happening? > > It's a RHEL 4 environment by the way. I couldn't find a

Third party script debugging on remote server ...

2007-04-18 Thread dbee
Right. I've got a really, really annoying/difficult/time consuming problem with my development environment. I'm using django to build a web app with paypal integration. My server is hosted remotely, and it is receiving IPN (payment notifications) POST requests from Paypal. I've checked on google an

Beginner: Formatting text output (PyQt4)

2007-04-18 Thread Glen
Hello again, I don't blame anyone for not answering my last post, since I obviously hadn't spent much time researching, but I've come a little ways and have another question. How can I better format text output to a QTextEdit object? I'm inserting 5 columns into each row. When I write the info

Re: Installing Python on NT

2007-04-18 Thread Gabriel Genellina
En Wed, 18 Apr 2007 18:09:03 -0300, Schwartz, Hillary <[EMAIL PROTECTED]> escribió: ? -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Third party script debugging on remote server ...

2007-04-18 Thread Graham Dumpleton
After calling whatever it is that is writing to standard output/error, do: import sys sys.stdout.flush() sys.stderr.flush() This should cause any buffered data to be immediately flushed to the main Apache error log, ie., don't look in any virtual host logs, check the main one. Graham On A

Re: Newbie: import

2007-04-18 Thread 7stud
Here's an example where you are trying to import a function in one of your .py files--when that .py file is not in the current directory: import sys sys.path.append("/Users/me/2testing/dir1/") #directory that contains the file import test1 #name of file without .py extension test1.greet() --

Re: Python COM iterator

2007-04-18 Thread Larry Bates
Carsten Haese wrote: > On Tue, 2007-04-17 at 16:54 -0500, Larry Bates wrote: >> Does anyone know if there is a way to make a Python COM object >> act like a proper iterator in VB/Delphi? > > I don't use COM, VB, or Delphi, but Google turned up these two > references: > http://msdn.microsoft.com/li

Re: converting currency using locals

2007-04-18 Thread Gabriel Genellina
En Wed, 18 Apr 2007 15:08:24 -0300, Grzegorz Ślusarek <[EMAIL PROTECTED]> escribió: > Hi all. I have situation that I have value that holds price and I must > show > this price using national specification(e.g. thousands_sep). Any idea how > this can be done under python 2.4.4? I saw that func

Re: Future Python Gui?

2007-04-18 Thread [EMAIL PROTECTED]
> On Windows, the easiest way to install Tile is to grab it from > ActiveState's Tcl distribution > (http://www.activestate.com/products/activetcl/) and then place it with > the Tcl/Tk bits that come with Python. The Tcl/Tk build for Windows that > python.org provides doesn't ship with Tile. You'l

Re: Future Python Gui?

2007-04-18 Thread [EMAIL PROTECTED]
> "Tile" has already been mentioned in this thread, and I know > there'll be at least one more follow-up on the subject. Tile > includes a ("native"!) notebook, as well as a combobox, tree- > view, ... http://wiki.tcl.tk/11075>. It seems that Tile does include a "notebook" widget but it's pure Tc

Re: Future Python Gui?

2007-04-18 Thread [EMAIL PROTECTED]
> As I've said often enough on the topic of Web frameworks, picking > winners gives only a temporary victory to those who want to avoid > making decisions. It's better to provide people with a means of making > an informed choice, and it should be realised that people will > approach this choice fr

Re: Future Python Gui?

2007-04-18 Thread Kevin Walzer
[EMAIL PROTECTED] wrote: >> "Tile" has already been mentioned in this thread, and I know >> there'll be at least one more follow-up on the subject. Tile >> includes a ("native"!) notebook, as well as a combobox, tree- >> view, ... http://wiki.tcl.tk/11075>. > > It seems that Tile does include a "

Re: Future Python Gui?

2007-04-18 Thread Kevin Walzer
[EMAIL PROTECTED] wrote: >> On Windows, the easiest way to install Tile is to grab it from >> ActiveState's Tcl distribution >> (http://www.activestate.com/products/activetcl/) and then place it with >> the Tcl/Tk bits that come with Python. The Tcl/Tk build for Windows that >> python.org provides

Re: Future Python Gui?

2007-04-18 Thread Kevin Walzer
Since the Tkinter wiki is still down, here is the Tile wrapper I maintain: ### November 2006: Posted by Kevin Walzer, [EMAIL PROTECTED] Based on Tile wrapper by Martin Franklin. This version updates the wrapper to reflect changes in Tile commands, and adds support for Tile-based frames

Spawn/Exec with asterisk in argument

2007-04-18 Thread jeremyfee
The spawn* and exec* functions appear to escape asterisks, I'm guessing all shell characters too, before the spawn/exec'ed process sees them. Is there a way around this? Not sure if this is a bug or a "feature". user$ touch test.txt user$ ls -l * -rw-r--r-- 1 user user 0 Apr 18 18:30 test.tx

Re: Future Python Gui?

2007-04-18 Thread Kevin Walzer
This should be saved as "Tile.py." Sorry. ### November 2006: Posted by Kevin Walzer, [EMAIL PROTECTED] Based on Tile wrapper by Martin Franklin. This version updates the wrapper to reflect changes in Tile commands, and adds support for Tile-based frames (ttk::frame). Freely reusable.

Using the Python interpreter

2007-04-18 Thread tkpmep
Instead of starting IDLE as I normally do, I started the Python interpreter and tried to run a program. I got a Python prompt (>>>), and then tried unsuccessfully to run a Python script named Script1.py that runs perfectly well in IDLE. Here's what I did: >>>Script1.py Traceback (most recent call

Re: Third party script debugging on remote server ...

2007-04-18 Thread dbee
On Apr 19, 12:31 am, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > After calling whatever it is that is writing to standard output/error, > do: > > import sys > sys.stdout.flush() > sys.stderr.flush() > > This should cause any buffered data to be immediately flushed to the > main Apache error

Re: Using the Python interpreter

2007-04-18 Thread Stevie
On Thu, 19 Apr 2007 01:32:36 +0100, [EMAIL PROTECTED] wrote (in article <[EMAIL PROTECTED]>): > Instead of starting IDLE as I normally do, I started the Python > interpreter and tried to run a program. I got a Python prompt (>>>), > and then tried unsuccessfully to run a Python script named Script

indexing web pages - in python?

2007-04-18 Thread Dan Stromberg
Are there any open source search engines written in python for indexing a given collection of (internal only) html pages? Right now I'm talking about dozens, but hopefully it'll be hundreds or thousands at some point. I'm thinking some sort of CGI script, with perhaps a cron job that updates the

Re: comparison with None

2007-04-18 Thread Alan Isaac
"Terry Reedy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Should be in the reference manual section on comparisons. Only to this extent: http://www.python.org/doc/2.4/ref/comparisons.html objects of different types always compare unequal, and are ordered consiste

Re: Spawn/Exec with asterisk in argument

2007-04-18 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: > The spawn* and exec* functions appear to escape asterisks, I'm > guessing all shell characters too, before the spawn/exec'ed process > sees them. No. It is the shell that ordinarily processes these characters and gives them a special meaning. On most systems, ls does no

Re: Using the Python interpreter

2007-04-18 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: > Instead of starting IDLE as I normally do, I started the Python > interpreter and tried to run a program. I got a Python prompt (>>>), > and then tried unsuccessfully to run a Python script named Script1.py > that runs perfectly well in IDLE. Here's what I did: > Sc

Re: Third party script debugging on remote server ...

2007-04-18 Thread dbee
On Apr 19, 1:52 am, dbee <[EMAIL PROTECTED]> wrote: > On Apr 19, 12:31 am, Graham Dumpleton <[EMAIL PROTECTED]> > wrote: > > > > > After calling whatever it is that is writing to standard output/error, > > do: > > > import sys > > sys.stdout.flush() > > sys.stderr.flush() > > > This should ca

Re: indexing web pages - in python?

2007-04-18 Thread Kevin T. Ryan
On Apr 18, 8:55 pm, Dan Stromberg <[EMAIL PROTECTED]> wrote: > Are there any open source search engines written in python for indexing a > given collection of (internal only) html pages? Right now I'm talking > about dozens, but hopefully it'll be hundreds or thousands at some point. > > I'm think

Re: What makes an iterator an iterator?

2007-04-18 Thread Terry Reedy
An iterator is an object with a .__iter__ method that returns self and a .next method that either returns an object or raises StopIteration. One very good way to get an iterator from an iterable is for .__iter__ to be a generator function. When called, it returns an generator with .__iter__ a

Re: Compiling python from soruce vs RPM ?

2007-04-18 Thread howa
On Apr 19, 6:10 am, Paul Boddie <[EMAIL PROTECTED]> wrote: > > Since /usr/bin/python isn't found, it doesn't look like there's an > existing version of Python that you might overwrite, but it's > important to verify such things when installing software. That's where > your distribution's packages h

Re: Strange terminal behavior after quitting Tkinter application

2007-04-18 Thread Charles Sanders
Chris wrote: > > But does anyone know why the Tkinter program is doing this to the > terminal in the first place? I don't want to have to tell users of my > program that they must recover their terminal's sanity each time after > running my program. > I don't know about Tkinter, but my g

Re: python - dll access (ctypes or swig)

2007-04-18 Thread Alex Martelli
Thomas Heller <[EMAIL PROTECTED]> wrote: ... > > and some technical issues such as threading (if COM client and server ... > I think that the latter problem (incompatible threading models in the same > process) are solved by COM apartments - aren't they? "apartment" is one threading model, b

Re: What makes an iterator an iterator?

2007-04-18 Thread Alex Martelli
7stud <[EMAIL PROTECTED]> wrote: ... > Can you explain some of the details of why this code fails: ... > def next(self): > for word in "Norwegian Blue's have beautiful > plumage!".split(): > yield word Sure, easily: a loop like "for x in y:" binds an unnamed temporary

Re: comparison with None

2007-04-18 Thread Alan Isaac
"Terry Reedy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Should be in the reference manual section on comparisons. Only to this extent: http://www.python.org/doc/2.4/ref/comparisons.html objects of different types always compare unequal, and are ordered consiste

Re: Future Python Gui?

2007-04-18 Thread [EMAIL PROTECTED]
> The wrapper I maintain works differently, and includes the notebook widget. I've seen the page. You can get to it via Google's cache; just put the url in the box and the one search result returned usually has a "cached" link. However, that file is completely useless without instructions on how

Re: Python COM iterator

2007-04-18 Thread Carsten Haese
>[...] > > On Tue, 2007-04-17 at 16:54 -0500, Larry Bates wrote: > >> Does anyone know if there is a way to make a Python COM object > >> act like a proper iterator in VB/Delphi? >[...] After more googling, staring at win32com's code, and a fair bit of trial and error, I've come up with the follow

Re: Python Threads -

2007-04-18 Thread Alex Martelli
S.Mohideen <[EMAIL PROTECTED]> wrote: > Hi All, > > Can you please suggest a technique in Python where we can spawn few number > of worker threads and later map them to a function/s to execute individual > Jobs. > > Any references would be helpful.. I believe I give some examples in the Nutshel

Question about Tkinter MenuOption variable

2007-04-18 Thread Chad
Is there anyway to set the individual options in Tkinter to a particular variable. For example, I have a menu option(code is below) which has January, February, March and so on, which I would like to have corresponding values of 01, 02, 03 and so on. Can someone please tell me how to do that with

Re: Beginner: Formatting text output (PyQt4)

2007-04-18 Thread Glen
On Wed, 18 Apr 2007 22:50:14 +, Glen wrote: Ok, obviously, my post didn't come out the way I wanted it to. In the first example from my text file below, the dictionary pairs, constructed from sorted tuples were in straight columns. When I write them to my QTextEdit, however, the columns are

Weekly Python Patch/Bug Summary

2007-04-18 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 357 open ( +8) / 3745 closed ( +8) / 4102 total (+16) Bugs: 958 open (+19) / 6657 closed ( +9) / 7615 total (+28) RFE : 251 open ( +2) / 280 closed ( +2) / 531 total ( +4) New / Reopened Patches __ Help with

Text Suffix to Prefix Conversion

2007-04-18 Thread EMC ROY
Dear all, I'm a postgraduate student in Hong Kong, studying english language. I wanna seek help from all of you about some plain text manipulation. I have already add part-of-speech (POS) tags with angle bracket by software tagger, right after every word in my file, as attribute. How could I chan

Re: Text Suffix to Prefix Conversion

2007-04-18 Thread Steven Bethard
EMC ROY wrote: > Original Sentence: An apple for you. > Present: An apple for you .<.> > Desire:An apple for you <.>. >>> text = 'An apple for you .<.>' >>> import re >>> re.sub(r'(\S+)(<[^>]+>)(\s*)', r'\2\1\3', text) 'An apple for you <.>.' -- http://mail.python.org/mailma

Re: What makes an iterator an iterator?

2007-04-18 Thread 7stud
Hi, Thanks for the responses. > 7stud <[EMAIL PROTECTED]> wrote: > > Can you explain some of the details of why this code fails: > --- > class Parrot(object): > def __iter__(self): > return self > def __init__(self): > self.next = self.next().next > def next(self): >

Re: Third party script debugging on remote server ...

2007-04-18 Thread Graham Dumpleton
> Hi Graeme, > > Thanks for the suggestion. Unluckily for me, it doesn't seem to be > working though ... > > I've tried it a number of different ways. I guess if I put the code > after an exception, then the code won't be called. > So I ran an error in the python script and then I called the > sys

unicode and __repr__()

2007-04-18 Thread Martin Drautzburg
I am using repr() to pass arrays, dicts and combinations therof to javascript as it already returns a valid javascript expression (a string) right away. But for some reason it does not handle Umlaute correctly and those characters finally appear as two strange characters on the browser. I am using

Re: Beginner: Formatting text output (PyQt4)

2007-04-18 Thread Tina I
Glen wrote: >> Hello again, I don't blame anyone for not answering my last post, > since >> I obviously hadn't spent much time researching, but I've come a little >> ways and have another question. >> >> How can I better format text output to a QTextEdit object? I'm >> inserting 5 columns into

Re: comparison with None

2007-04-18 Thread Steven Howe
Alan Isaac wrote: "Terry Reedy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Should be in the reference manual section on comparisons. Only to this extent: http://www.python.org/doc/2.4/ref/comparisons.html objects of different types always compare unequal, and

Re: How to communicate via USB "port"

2007-04-18 Thread Tim Roberts
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > >Can someone explain how I would read the data from the USB "port"? I >don't know if it matters, but I am trying to read the data from a GPS >plugged in to the USB port. USB is a "protocol" bus. It isn't like a serial port, where you can just start

Re: Text Suffix to Prefix Conversion

2007-04-18 Thread 7stud
On Apr 18, 11:08 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > EMC ROY wrote: > > Original Sentence: An apple for you. > > Present: An apple for you .<.> > > Desire:An apple for you <.>. > >>> text = 'An apple for you .<.>' > >>> import re > >>> re.sub(r'(\S+)(<[^>]+>)(\s*)'

Re: Nested dictionaries trouble

2007-04-18 Thread Steven D'Aprano
On Wed, 18 Apr 2007 12:16:12 -0700, IamIan wrote: > I am using the suggested approach to make a years list: > > years = ["199%s" % x for x in range(0,10)] > years += ["200%s" % x for x in range(0,10)] > > I haven't had any luck doing this in one line though. Is it possible? years = ["199%s" % x

Re: What makes an iterator an iterator?

2007-04-18 Thread Ben Finney
Steven D'Aprano <[EMAIL PROTECTED]> writes: > class Parrot(object): > def __iter__(self): > return self > def __init__(self): > self.next = self._next() > def _next(self): > for word in "Norwegian Blue's have beautiful plumage!".split(): > yield word

Strange terminal behavior after quitting Tkinter application

2007-04-18 Thread Chris
Hi, I'm puzzled by some strange behavior when my Python/Tkinter application quits (on linux): the terminal from which I started Python is messed up. If start up python, then import the code below, then start the program with Application(), then click the Quit button, my terminal never prints anyt

Re: Strange terminal behavior after quitting Tkinter application

2007-04-18 Thread Chris
(I'm not sure what happened to the formatting in my post: the "Tkinter.Button" line should be at the same level of indentation as the "Tkinter.Tk.__init__" line.) -- http://mail.python.org/mailman/listinfo/python-list

Win32com, and Excel issues.

2007-04-18 Thread Ant
Hi all, I'm doing some Excel automation work for a friend, and am developing on a machine running Office 2000. My friends machine is running Excel 2003. The code I've written works like a charm on my machine (in fact all three of my machines), but falls over early on on Excel 2003. The code snipp

Re: ??? POLICE AND CITY/UNIVERSITY OFFICIALS INCOMPETENCE LEADS TO 33 KILLED BY KOREAN-ALQAEDA TERRORIST ???

2007-04-18 Thread Muhammad
On Apr 17, 12:18 pm, utabintarbo <[EMAIL PROTECTED]> wrote: > On Apr 17, 10:32 am, Muhammad <[EMAIL PROTECTED]> wrote: > > > On Apr 17, 7:56 am, [EMAIL PROTECTED] wrote: > >> - > > You mentioned "Korean Al-Qaeda Terrorist" in the title! Honesty > > demands that you establish it as a fact that the

Signals

2007-04-18 Thread Robert Rawlins - Think Blue
Hello Chaps, I posted about this the other day but I'm still struggling to get any form of result from it. Basically I have the following piece of code, and according to its API is produces singals when particular events occur, but i have no idea how to list for events, I've tried all sorts of

Re: Queue enhancement suggestion

2007-04-18 Thread Antoon Pardon
On 2007-04-17, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On 17 Apr 2007 14:32:01 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: >>On 2007-04-17, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >>> On 17 Apr 2007 13:32:52 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: On 2007-04-17, Hendrik

  1   2   3   >