Re: how to list files with extension .txt in windows?

2004-12-02 Thread Aaron Bingham
ed wrote: I have used batch script to do it but it has a lot of issues with access denied... errors I pretty much given up using batch to do this. If you do not have permission to access the files, switching to a different language will not help you. You need to determine the cause of your ac

how to list files with extension .txt in windows?

2004-12-02 Thread ed
hi I ahve a simple question and is new to python. I have a folder in windows that contains some .txt files. the fucntion that i want to do is whenever there is new directory created (say 249, thos enew directorys are always in numbers in 3 digit), i want to grap that 249 and the previous created on

Re: efficient intersection of lists with rounding

2004-12-02 Thread Steven Bethard
Michael Hoffman wrote: Steven Bethard wrote: Well, in Python 2.3, I believe sets are implemented in Python while they're implemented in C in Python 2.4. I think the Python 2.3 Sets implementation is likely to be quicker than whatever list-manipulation answer you come up with instead. But there's

Re: installing wxPython on Linux and Windows

2004-12-02 Thread Simon John
I have used the Fedora2 RPM's of wxPython 2.5.3.1 successfully on SUSE 9.1 Pro, 9.2 Pro and SLES 9 (and Fedora 3 for that matter) so you don't need to get a specific RPM for SUSE. I even built wxPython 2.5.3.1 with Python 2.4 on Fedora 2 today, it was not that hard - just followed http://wxpython.

Re: Python 2.4 and Tkinter

2004-12-02 Thread Jeffrey Barish
Jean Brouwers wrote: > > It is hard to tell what is wrong, exactly. Two suggestions: > > If this is a 32-bit build, why is there a "-L/usr/X11R6/lib64" and > *before* the regular "-L/usr/X11R6/lib"? Try to rerun just that line > "gcc -pthread _tkinter.so" but without the "-L/usr/X11R6/l

Re: PySQLLite Speed

2004-12-02 Thread Adam DePrince
On Thu, 2004-12-02 at 23:39, Kevin wrote: > Hello All, > > I wanted to thank Roger Binn for his email. He had > the answer to my issue with writing speed. It's > actual made an incredible change in the preformace. I > didn't have to go all the way to implementing the > synchronous mode(for my a

PySQLLite Speed

2004-12-02 Thread Kevin
Hello All, I wanted to thank Roger Binn for his email. He had the answer to my issue with writing speed. It's actual made an incredible change in the preformace. I didn't have to go all the way to implementing the synchronous mode(for my app). Previously, I was insert one record at a time. Th

Re: Python Design Patterns

2004-12-02 Thread Dave Cook
"Tony Ha" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Hello Dave, > > Thanks for pointing me to the Cookbook website. > > On 2004-11-29, Tony Ha <[EMAIL PROTECTED]> wrote: > > > > > I wonder, can any Python guru out there translate the Java examples in For anyone tran

Re: efficient intersection of lists with rounding

2004-12-02 Thread Adam DePrince
On Thu, 2004-12-02 at 22:16, Greg Ewing wrote: > Gordon Williams wrote: > a= [(123,1.3),(123,2.4),(123,7.8),(123,10.2)] > b= [(123, 0.9), (123, 1.9), (123, 8.0)] > [ (i,round(j)) for i,j in a for l,m in b if (i,round(j)) == > > (l,round(m))] > > d = {} > for (l, m) in b: >d[l, roun

Re: inheritance problem with 2 cooperative methods

2004-12-02 Thread Dan Perl
Thank you very much, Greg, that does the job! Somehow I couldn't see it and I needed someone to point out to me. Dan "Greg Ewing" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dan Perl wrote: >> So far, so good! But let's assume that I want to change the __init__ >> methods s

Re: why python is slower than java?

2004-12-02 Thread developerchina
hehe Asun Friere wrote: > [EMAIL PROTECTED] (Alex Martelli) wrote in message news:<[EMAIL PROTECTED]>... > > > [A]sking for tolerance and patience > > against _rude_ newbies which barge in with shrill, mostly unjustified, > > repetitious complaints, is, I think, a rather far-fetched request. > > Th

Re: efficient intersection of lists with rounding

2004-12-02 Thread Greg Ewing
Gordon Williams wrote: a= [(123,1.3),(123,2.4),(123,7.8),(123,10.2)] b= [(123, 0.9), (123, 1.9), (123, 8.0)] [ (i,round(j)) for i,j in a for l,m in b if (i,round(j)) == (l,round(m))] d = {} for (l, m) in b: d[l, round(m)] = 1 result = [] for (i, j) in a: t = (i, round(j)) if t in d: resul

Re: installing 2.4

2004-12-02 Thread Jive
"Jeff Shannon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Jive wrote: > > >As for checking the "application path", I don't know what that means. > > > > > > Go to a command prompt, and type 'echo %path%'. You'll see a list of > all the directories that Windows looks in to find

Re: installing 2.4

2004-12-02 Thread Jive
"David Bolen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Jive" <[EMAIL PROTECTED]> writes: > > > It's only getting worse. I went to Add/remove programs and removed 2.4. > > Now Python 2.4 numarray and Python 2.4 pywin extensions are still listed as > > installed, but I cannot

Re: installing 2.4

2004-12-02 Thread David Bolen
"Jive" <[EMAIL PROTECTED]> writes: > It's only getting worse. I went to Add/remove programs and removed 2.4. > Now Python 2.4 numarray and Python 2.4 pywin extensions are still listed as > installed, but I cannot remove them. You mentioned in your first post about "copying your site package" ...

Re: inheritance problem with 2 cooperative methods

2004-12-02 Thread Greg Ewing
Dan Perl wrote: So far, so good! But let's assume that I want to change the __init__ methods so that they take a configuration as an argument so the objects are created and configured in one step, like this: alpha = A(config) One way would be to make the setConfig call only in the root class, an

Re: installing 2.4

2004-12-02 Thread Jeff Shannon
Jive wrote: As for checking the "application path", I don't know what that means. Go to a command prompt, and type 'echo %path%'. You'll see a list of all the directories that Windows looks in to find an executable -- i.e., if you type 'python', Windows will work through this list of directo

pythonwin broke

2004-12-02 Thread Jive
I've un-installed Python 2.4, re-installed Python 2.3 and PythonWin for 2.3, but it's still broke. When I start PythonWin, sometimes it looks like it is going to be okay. But as soon as I open a .py file, the interactive window grabs the focus and will not let go. I am stumped. Is there somethi

Re: Versioning Libraries

2004-12-02 Thread Bryan
Peter Hansen wrote: Randall Smith wrote: As Python changes and old code still needs to work properly, I wonder if there is a standard way to note which version of the Python interpreter code is intended to work with. I know that an executable may begin with #!/usr/bin/python2.3 or something sim

Re: efficient intersection of lists with rounding

2004-12-02 Thread Michael Hoffman
Steven Bethard wrote: Well, in Python 2.3, I believe sets are implemented in Python while they're implemented in C in Python 2.4. I think the Python 2.3 Sets implementation is likely to be quicker than whatever list-manipulation answer you come up with instead. But there's only one way to find o

Re: decorators ?

2004-12-02 Thread Jp Calderone
On Thu, 02 Dec 2004 18:30:15 -0800, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > [snip] > > Technically, everything can be performed in assembly. The point of > syntactic sugar (or ammonia) is to make things less painful. While > everything was possible before, adding the decorators /after/ def

Re: decorators ?

2004-12-02 Thread Josiah Carlson
Jacek Generowicz <[EMAIL PROTECTED]> wrote: > > BJörn Lindqvist <[EMAIL PROTECTED]> writes: > > > I think the essence of decorators is that it makes it possible to do > > in Python what you in other languages do with method qualifiers. > > I find it fascinating that the addition of a bit of syn

Re: installing 2.4

2004-12-02 Thread Jive
It's only getting worse. I went to Add/remove programs and removed 2.4. Now Python 2.4 numarray and Python 2.4 pywin extensions are still listed as installed, but I cannot remove them. -- http://mail.python.org/mailman/listinfo/python-list

Re: installing 2.4

2004-12-02 Thread Jive
I am befuddled. I've re-installed everything I can think of, but I still get this behavior: I start up Pythonwin. Sometimes the interactive window shows the copyright stuff; sometimes it doesn't; In any case, I can't close it by clicking on the X button at the top right of the main window. The

Re: PySQLLite Speed

2004-12-02 Thread Roger Binns
"Kevin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Then when it starts to > write the Database, the PC Util drops to 1-2% and it > takes forever. I'm not PC related preformance > barriers that I'm aware of. Your hard disk. See the synchronous information in the pragmas: http

Re: A way to wait Python event

2004-12-02 Thread Josiah Carlson
[EMAIL PROTECTED] (Chang LI) wrote: > > I tried to launch "python.exe test.py" in another program. After the > launch the console was showed and exited on Windows. I want the > console stay there. Is there a Python statement to wait an event loop > like Tcl's "after forever"? I'm a fan of... _

Re: non blocking read()

2004-12-02 Thread Greg Ewing
Donn Cave wrote: Yes, this looks right to me, but I think we're talking about os.read(), not fileobject.read(). Indeed, you shouldn't be mixing select() with buffered io, or all kinds of bad things can happen. Everything I said applies to OS-level reads and writes, not stdio-level ones. -- Greg Ewi

Re: installing 2.4

2004-12-02 Thread Jeff Shannon
Jive wrote: Well ain't that a kick in the pants? Version 2.3 is broke now, so I'm kind of stuck. I haven't found a 2.4 version of Numeric. Do you know where to find one? Since 2.4 has only been released for a few days, it'll probably be a short while yet before all the various third-party pac

Re: PyQt on a Server

2004-12-02 Thread Bob Parnes
On 29 Nov 2004 11:07:48 -0500, Jerry Sievers <[EMAIL PROTECTED]> wrote: > Bob Parnes <[EMAIL PROTECTED]> writes: > >> I have an application importing qt on a linux server and am missing >> something in trying to run it from a workstation via nfs. The >> workstation has the server /usr directory

Re: installing 2.4

2004-12-02 Thread Jive
Well ain't that a kick in the pants? Version 2.3 is broke now, so I'm kind of stuck. I haven't found a 2.4 version of Numeric. Do you know where to find one? "Peter Hansen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Jive wrote: > > I just now installed 2.4. I naively copied

Re: installing 2.4

2004-12-02 Thread Peter Hansen
Jive wrote: I just now installed 2.4. I naively copied my site-package from 2.3. The first program I tried to run, which uses the gnuplot package, got this error, complaining about module Numeric: ImportError: Module use of python23.dll conflicts with this version of Python. Grumble: Why does Num

Re: Versioning Libraries

2004-12-02 Thread Peter Hansen
Randall Smith wrote: As Python changes and old code still needs to work properly, I wonder if there is a standard way to note which version of the Python interpreter code is intended to work with. I know that an executable may begin with #!/usr/bin/python2.3 or something similar, but what about

Re: installing 2.4

2004-12-02 Thread Jive
Correction. It still runs under 2.3. However, Pythonwin now doesn't work right under 2.3. The interactive window grabs the cursor and won't let it go. I have to go to the task manager to kill Pythonwin. "Jive" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I just now installed

Re: installing 2.4

2004-12-02 Thread Jive
Gack! I can't run it under 2.3 anymore either! Dag nab it! "Jive" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I just now installed 2.4. I naively copied my site-package from 2.3. The > first program I tried to run, which uses the gnuplot package, got this > error, complainin

Re: Python 2.4 and Tkinter

2004-12-02 Thread Jean Brouwers
It is hard to tell what is wrong, exactly. Two suggestions: If this is a 32-bit build, why is there a "-L/usr/X11R6/lib64" and *before* the regular "-L/usr/X11R6/lib"? Try to rerun just that line "gcc -pthread _tkinter.so" but without the "-L/usr/X11R6/lib64" option. If that still fails

Re: pre-PEP generic objects

2004-12-02 Thread Paul Rubin
Steven Bethard <[EMAIL PROTECTED]> writes: > > IMHO this too easy to accomplish right now to warrant > > an "official" implementation: > > class Bunch: > > pass > > b = Bunch() > > b.one, b.two, b.three = 1,2,3 > > works just fine, depending on the problem I might add a few special > > operator

installing 2.4

2004-12-02 Thread Jive
I just now installed 2.4. I naively copied my site-package from 2.3. The first program I tried to run, which uses the gnuplot package, got this error, complaining about module Numeric: ImportError: Module use of python23.dll conflicts with this version of Python. Grumble: Why does Numeric refer

Re: PySQLLite Speed

2004-12-02 Thread Robert Kern
Kevin wrote: Hello All, I wondering if anyone has encountered the same issue with using PySQL. This is my first time using this DB so this preformance may be typical. I'm reading an ASCII file through PyParse that contains about 1.3Meg of Float data. 8000 Triangles (3 Vertexes and 1 Normal). Th

Re: disk based dictionaries

2004-12-02 Thread Larry Bates
You may also want to take a look at ZODB (Zope database). It handles the pickling, storage and retrieval of all Python objects (including dictionaries) very well. And yes you can use ZODB without using Zope proper. http://www.zope.org/Products/StandaloneZODB http://zope.org/Members/adytumsolutions

RE: How is Python designed?

2004-12-02 Thread Delaney, Timothy C (Timothy)
Roy Smith wrote: > As far as I can tell, the process works like this: > > Guido has an idea for something he wants to do and announces it. > > Everybody beats him up about it. > > He goes ahead and does it anyway. > > It's a strange process, but it seems to work. It's not quite that straightf

Re: pre-PEP generic objects

2004-12-02 Thread Steven Bethard
Istvan Albert wrote: Steven Bethard wrote: I promised I'd put together a PEP for a 'generic object' data type for Python 2.5 that allows one to replace __getitem__ style access with dotted-attribute style access (without declaring another class). Any comments would be appreciated! IMHO this to

Re: How is Python designed?

2004-12-02 Thread Roy Smith
As far as I can tell, the process works like this: Guido has an idea for something he wants to do and announces it. Everybody beats him up about it. He goes ahead and does it anyway. It's a strange process, but it seems to work. -- http://mail.python.org/mailman/listinfo/python-list

Re: efficient intersection of lists with rounding

2004-12-02 Thread Steven Bethard
Gordon Williams wrote: I have to lists that I need to find the common numbers (2nd rounded to nearest integral) and I am wondering if there is a more efficient way of doing it. a= [(123,1.3),(123,2.4),(123,7.8),(123,10.2)] b= [(123, 0.9), (123, 1.9), (123, 8.0)] [ (i,round(j)) for i,j in a for l,m

File locking and logging

2004-12-02 Thread Kamus of Kadizhar
Thanks to Robert Brewer, I got enough insight into logging to make it work Now I have another issue: file locking. Sorry if this is a very basic question, but I can't find a handy reference anywhere that mentions this. When a logger opens a log file for append, is it automatically locked so

Writing apps without using relative imports

2004-12-02 Thread Randall Smith
I've noticed the push by Guido and others to use absolute imports instead of relative imports. I've always enjoyed the ease of relative imports, but am starting to understand that "explicit is better than implicitly" as the Python philosophy goes. I'm trying to develop a strategy for writing

Re: How is Python designed?

2004-12-02 Thread Terry Reedy
"Limin Fu" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Is there any technical description on internet of how > python is designed? Or can somebody give a short > description about this? I'm just curious. One answer is that Python is currently designed by a group of voluntary d

Versioning Libraries

2004-12-02 Thread Randall Smith
As Python changes and old code still needs to work properly, I wonder if there is a standard way to note which version of the Python interpreter code is intended to work with. I know that an executable may begin with #!/usr/bin/python2.3 or something similar, but what about libraries and such?

Re: Galois field

2004-12-02 Thread Terry Reedy
"Roie Kerstein" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I am looking for a python package that deals with galois fields. > > Does anybody know where can I find it? Googling python 'galois fields' gives over 500 hits, the most recent being your identical question on catalog-

PySQLLite Speed

2004-12-02 Thread Kevin
Hello All, I wondering if anyone has encountered the same issue with using PySQL. This is my first time using this DB so this preformance may be typical. I'm reading an ASCII file through PyParse that contains about 1.3Meg of Float data. 8000 Triangles (3 Vertexes and 1 Normal). This file read

Re: efficient intersection of lists with rounding

2004-12-02 Thread Diez B. Roggisch
> A couple of other bits of info. > - a and b are ordered smallest to largest (could bisect module be used?) > - in the future I will want to round the second number of closest 0.25 > rather than whole number. > > Would the sets module be more efficient? > > I'm using python 2.3. I'd go for some

Re: PySQLite Table indexing inside a functions

2004-12-02 Thread Kevin
Hello Again, It may be cleaner if I reduce the code: def PARSE2DB(data,tablename): i = 0 cadu = GETdb().cursor() FacetNum = len(data [1]) while i < FacetNum: cadu.execute(""" insert into table = 'tablename' ( V1_x, V1_y, V1_z) values(%f, %f, %f)

Re: Pythonic use of CSV module to skip headers?

2004-12-02 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Ramon Felciano wrote: > Hi -- > > I'm using the csv module to parse a tab-delimited file and wondered > whether there was a more elegant way to skip an possible header line. > I'm doing > > line = 0 > reader = csv.reader(file(filename)) > for row in read

Python2.4: building '_socket' extension fails with `INET_ADDRSTRLEN' undeclared

2004-12-02 Thread Michael Ströder
HI! I'm trying to build Python2.4 on a rather old Debian machine. I only have a shell account there. That's why I'm very limited in my actions. Building _socket fails (see below) although I tried to use configure --disable-ipv6 Any clue? Ciao, Michael. -- snip

Re: Pythonic list to bitflag mapping

2004-12-02 Thread Ramon Felciano
> Or can be used directly as an integer index to get a character > > >>> ['01'[x in a] for x in xrange(10)] > ['0', '0', '0', '1', '1', '0', '1', '0', '0', '0'] > Very cool -- this does the trick nicely and seems quite extensible, now that I get the basic idiom. Belated thanks for the quick re

Re: pre-PEP generic objects

2004-12-02 Thread Istvan Albert
Steven Bethard wrote: I promised I'd put together a PEP for a 'generic object' data type for Python 2.5 that allows one to replace __getitem__ style access with dotted-attribute style access (without declaring another class). Any comments would be appreciated! IMHO this too easy to accomplish r

Re: Pythonic use of CSV module to skip headers?

2004-12-02 Thread Steve Holden
Ramon Felciano wrote: Hi -- I'm using the csv module to parse a tab-delimited file and wondered whether there was a more elegant way to skip an possible header line. I'm doing line = 0 reader = csv.reader(file(filename)) for row in reader: if (ignoreFirstLine

Pythonic use of CSV module to skip headers?

2004-12-02 Thread Ramon Felciano
Hi -- I'm using the csv module to parse a tab-delimited file and wondered whether there was a more elegant way to skip an possible header line. I'm doing line = 0 reader = csv.reader(file(filename)) for row in reader: if (ignoreFirstLine & line == 0):

Re: What to use for installation?

2004-12-02 Thread Roger Binns
"Eugene Morozov" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > But I want to know other opinions before going with scons. What is the best > tool for installing python applications? The tools you mention are actually more applicable to Python packages in that they install the code

Re: Python 2.4 and Tkinter

2004-12-02 Thread Jeffrey Barish
Jean Brouwers wrote: > > Here is how we understand this (which may be incomplete and/or > incorrect). > > The _tkinter module is a shared library _tkinter.o and that is built > from C source file _tkinter.c. That C file and a few other tk related > C files are included in the Python distributio

Re: How is Python designed?

2004-12-02 Thread Timo Virkkala
Limin Fu wrote: Hello, Is there any technical description on internet of how python is designed? Or can somebody give a short description about this? I'm just curious. Do you mean the structure and design of the language, or the process of designing the language? Well, in either case, you'll prob

Re: pickle and py2exe

2004-12-02 Thread Justin Straube
On 1 Dec 2004 11:45:59 -0800, [EMAIL PROTECTED] (Johan Lindberg) wrote: >Have you included string-escape encoding in your setup.py? >My guess is that you can fix the problem with something similar to: > > from distutils.core import setup > import py2exe > opts = { "py2exe": { "packages": ["encodi

PySQLite Table indexing inside a functions

2004-12-02 Thread Kevin
Hello Everyone, I'm using PySQLite and would like to index this insert statement with the 'tablename'. Can anyone offer a suggestion? Also, this is a shot in the dark. Has anyone done anything with nested fields. I would like each vertex to have 3 points. currently, I'm just making 3 fields.

efficient intersection of lists with rounding

2004-12-02 Thread Gordon Williams
Hi, I have to lists that I need to find the common numbers (2nd rounded to nearest integral) and I am wondering if there is a more efficient way of doing it. >>> a= [(123,1.3),(123,2.4),(123,7.8),(123,10.2)] >>> b= [(123, 0.9), (123, 1.9), (123, 8.0)] >>> [ (i,round(j)) for i,j in a for l,m in b

RE: decorators ?

2004-12-02 Thread Delaney, Timothy C (Timothy)
Michael Hudson wrote: > Skip Montanaro <[EMAIL PROTECTED]> writes: > >> Jacek> Anything you can do with decorators, you could do before >> (with Jacek> the exception of rebinding the __name__ of >> functions). >> >> And while that feature was added because we realized it would be >> nic

What to use for installation?

2004-12-02 Thread Eugene Morozov
Hello! I wrote a crossplatform Glade/GTK+ application for learning foreign languages (it is called Snakememory but doesn't have site in English yet). Currently it works from the directory where it was unpacked. But I need installation script that will compile and install translations, install a

RE: RotatingFileHandler

2004-12-02 Thread Robert Brewer
Kamus of Kadizhar wrote: > I'm having a problem with logging. I have an older app that used the > RotatingFileHandler before it became part of the main distribution (I > guess in 2.3). > > It worked fine then. Now I get: > > [EMAIL PROTECTED] bin]# ./mplayer.py file://test.avi > //test.avi > Tr

Re: pickle and py2exe

2004-12-02 Thread Justin Straube
On Tue, 30 Nov 2004 22:48:39 -0600, "Catfish" <[EMAIL PROTECTED]> wrote: >I did this a while back, and I can't remember exactly. Therefore, I may only >be able to give you a push in the right direction until someone else can >answer it fully. > >However, I think you have to force the db into the

Re: "encoding specified in XML declaration is incorrect"

2004-12-02 Thread "Martin v. Löwis"
Gustaf Liljegren wrote: f.write(header + self.all + footer) UnicodeEncodeError: 'ascii' codec can't encode characters in position 745-751: ordinal not in range(128) The XML declaration should be enough to tell the encoding. Sure, but that does not help at all. self.all is a Unicode string; i

inheritance problem with 2 cooperative methods

2004-12-02 Thread Dan Perl
Here is a problem I am having trouble with and I hope someone in this group will suggest a solution. First, some code that works. 3 classes that are derived from each other (A->B->C), each one implementing only 2 methods, __init__ and setConfig.

Any affordable Python-based CRM & ERP solutions?

2004-12-02 Thread Will
Hi all, Please excuse the longish post. I'm new to Python (and programming), but love what I see and believe it to be an important language. I have (at least) one retail client (with single outlet at present) that requires a total business solution for their operation, preferably open source. The

Re: pre-PEP generic objects

2004-12-02 Thread Jp Calderone
On Thu, 02 Dec 2004 12:26:31 -0800, Scott David Daniels <[EMAIL PROTECTED]> wrote: >Nick Craig-Wood wrote: > > Scott David Daniels <[EMAIL PROTECTED]> wrote: > >> You can simplify this: > >> class Hash(object): > >> def __init__(self, **kwargs): > >> for key,value in kwargs.items():

How is Python designed?

2004-12-02 Thread Limin Fu
Hello, Is there any technical description on internet of how python is designed? Or can somebody give a short description about this? I'm just curious. Thanks in advance, Limin __ Do you Yahoo!? Yahoo! Mail - You care about security. So

help running python in a limited interpreted environment

2004-12-02 Thread Mike
We have a large c++ program that runs under Windows NT Embedded to control an instrument. That program has been written to run external python scripts. The computer where this code runs does not and cannot have a full python installation. It ONLY has the pythonNN.dll file that comes with a full

Re: pre-PEP generic objects

2004-12-02 Thread Scott David Daniels
Nick Craig-Wood wrote: Scott David Daniels <[EMAIL PROTECTED]> wrote: You can simplify this: class Hash(object): def __init__(self, **kwargs): for key,value in kwargs.items(): setattr(self, key, value) __getitem__ = getattr __setitem__ = setattr That doesn't wor

Re: non blocking read()

2004-12-02 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Greg Ewing <[EMAIL PROTECTED]> wrote: > Donn Cave wrote: > > If we are indeed talking about a pipe or something that > > really can block, and you call fileobject.read(1024), > > it will block until it gets 1024 bytes. > > No, it won't, it will block until *some*

Re: Why I can NOT use Python but PHP

2004-12-02 Thread Roie Kerstein
Lad wrote: > Why is there not any(?) framework or complete e-commerce solution > written in Python? There is a framework written in python. It is called zope. www.zope.org If you will search well, I am quite sure you will also find a complete e-commerce solution. -- Best regards Roie Kerstein

Re: recombination variations

2004-12-02 Thread Scott David Daniels
Hung Jung Lu wrote: ... expand = lambda t: reduce(lambda r, s: [x+y for x in r >for y in alphabet[s]], t, ['']) print expand('ATSGS') Or, for a more verbose version: multis = dict(W='AT', M='AC', R='AG', Y='TC', K='TG', S='CG', H='ATC', D='ATG'

RotatingFileHandler

2004-12-02 Thread Kamus of Kadizhar
I'm having a problem with logging. I have an older app that used the RotatingFileHandler before it became part of the main distribution (I guess in 2.3). It worked fine then. Now I get: [EMAIL PROTECTED] bin]# ./mplayer.py file://test.avi //test.avi Traceback (most recent call last): File "./

Re: access to generator state

2004-12-02 Thread Tim Peters
[Neal D. Becker] > ... > Only one problem. Is there any way to access the state of a > generator externally? In other words, the generator saves all it's > local variables. Can an unrelated object then query the values of > those variables? (In this case, to get at intermediate results) It's

Re: debian python2.4

2004-12-02 Thread Jonas Galvez
km wrote: > is there a debian binary of python2.4 ? Not yet, I guess, but I could easily compile it from the source (I'm no Linux expert, I simply followed the instructions: ./configure, make, make install, and voilà). No error messages, no nothing. Only downside is that /usr/bin/python still poin

Re: access to generator state

2004-12-02 Thread Sean Ross
"Neal D. Becker" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I am converting optimization code from legacy C to python. Generators are a > HUGE convenience, because the original code structures have the optimizer > as the main code calling your function, while I want to invert t

Re: access to generator state

2004-12-02 Thread Peter Otten
Neal D. Becker wrote: > Only one problem. Is there any way to access the state of a generator > externally? In other words, the generator saves all it's local variables. > Can an unrelated object then query the values of those variables? (In You get read access with generator.gi_frame.f_locals

Re: debian python2.4

2004-12-02 Thread Jordi Romero (qiz/jrom)
Just remove /usr/bin/python and make a new soft link to the /usr/bin/python2.4 (ln -s /usr/bin/python2.4 /usr/bin/python) Jonas Galvez wrote: km wrote: Only downside is that /usr/bin/python still points to 2.3.4. Haven't figured out how to change that, but I am also afraid it would break mod_p

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2)

2004-12-02 Thread Thomas Heller
Gerrit <[EMAIL PROTECTED]> writes: > Cameron Laird wrote: >> Subject: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2) > > What is the frequency of the weekly Python-URL? (-; According to the name, about 1.6 µHz. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Galois field

2004-12-02 Thread Roie Kerstein
I am looking for a python package that deals with galois fields. Does anybody know where can I find it? Thank in advance -- Best regards Roie Kerstein -- http://mail.python.org/mailman/listinfo/python-list

Re: access to generator state

2004-12-02 Thread Kent Johnson
Neal D. Becker wrote: Only one problem. Is there any way to access the state of a generator externally? In other words, the generator saves all it's local variables. Can an unrelated object then query the values of those variables? (In this case, to get at intermediate results) You could make

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2)

2004-12-02 Thread Gerrit
Cameron Laird wrote: > Subject: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2) What is the frequency of the weekly Python-URL? (-; regards, Gerrit Holl. -- Weather in Lulea / Kallax, Sweden 02/12 19:20: -8.0ÂC Scattered clouds mostly cloudy wind 0.9 m/s None (34 m above

Re: Why I can NOT use Python but PHP

2004-12-02 Thread Steve Holden
Lad wrote: I would like to set up my website and allow customers to choose products there, including shopping carts. I would like to use Python but it would be very complicated to start from nothing. Why is there not any(?) framework or complete e-commerce solution written in Python? There are lots

Why I can NOT use Python but PHP

2004-12-02 Thread Lad
I would like to set up my website and allow customers to choose products there, including shopping carts. I would like to use Python but it would be very complicated to start from nothing. Why is there not any(?) framework or complete e-commerce solution written in Python? There are lots in PHP.One

access to generator state

2004-12-02 Thread Neal D. Becker
I am converting optimization code from legacy C to python. Generators are a HUGE convenience, because the original code structures have the optimizer as the main code calling your function, while I want to invert these roles. I want to call the optimizer to perform just one step at a time. So, t

Re: disk based dictionaries

2004-12-02 Thread Steve
Hi Shivam, If storing and retrieving is all that you are interested in, you should consider 'pickling' your dicts, using python's pickle module. It's part of the standard library. Learn more about it here: http://docs.python.org/lib/module-pickle.html Here's an example usage: [EMAIL PROTECTE

app with support for multiple Python versions

2004-12-02 Thread Steven Bethard
I have a friend developing an app that has bindings for a variety of languages (e.g. Python, Perl, Tcl, Java, etc.). In order to provide the Python support, he uses tclpython (http://jfontain.free.fr/tclpython.htm). If he builds tclpython with, say, Python 2.3, I have to download a source version

Re: decorators ?

2004-12-02 Thread Michael Hudson
Skip Montanaro <[EMAIL PROTECTED]> writes: > Jacek> Anything you can do with decorators, you could do before (with > Jacek> the exception of rebinding the __name__ of functions). > > And while that feature was added because we realized it would be nice if the > decorated function could ha

Re: debian python2.4

2004-12-02 Thread Nick Vargish
km <[EMAIL PROTECTED]> writes: > is there a debian binary of python2.4 ? root# apt-get update root# apt-cache search python2.4 idle-python2.4 - An IDE for Python (v2.4) using Tkinter python2.4 - An interactive high-level object-oriented language (version 2.4) python2.4-dev - Header files and a

Re: installing wxPython on Linux and Windows

2004-12-02 Thread Colin J. Williams
Jp Calderone wrote: On Thu, 02 Dec 2004 15:29:53 +0100, Peter Maas <[EMAIL PROTECTED]> wrote: Diez B. Roggisch schrieb: Same task on Win2k: download wxPython-setup.exe, double-click, done. Took me approx. 1 minute. This strikes me. Why are some tasks so hard on Linux and so easy on Windows? After a

Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2)

2004-12-02 Thread Cameron Laird
QOTW: "... why does Microsoft try so hard to protect its sources?" "To avoid embarrassment." -- Peter Maas and Grant Edwards http://groups.google.com/groups?frame=left&th=9a599152d8b23b54 "Sufficiently advanced cluelessness is indistinguishable from malice." -- Alex Martelli 2.4 is fina

Re: non blocking read()

2004-12-02 Thread Steve Holden
Gustavo Córdova Avila wrote: Steve Holden wrote: Gustavo Córdova Avila wrote: Actually the op did mention that he wanted to monitor files. As was pointed out to me when I made the same assertion, he actually said "file object which is stdin" or something like that, which means the object could b

Re: non blocking read()

2004-12-02 Thread Gustavo Córdova Avila
Steve Holden wrote: Gustavo Córdova Avila wrote: Actually the op did mention that he wanted to monitor files. As was pointed out to me when I made the same assertion, he actually said "file object which is stdin" or something like that, which means the object could be a socket, a pipe, a file, a

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2)

2004-12-02 Thread Rocco Moretti
For some reason I can't seem to make use of the google links. When I use the above eg http://groups.google.com/groups?frame=right&th=e562a771d1c827c9 I get a not found google page with url http://groups-beta.google.com/groups?frame=right&th=e562a771d1c827c9 really wanted to spell file in a sickl

Re: non blocking read()

2004-12-02 Thread Steve Holden
Gustavo Córdova Avila wrote: Donn Cave wrote: Depends. I don't believe the original post mentioned that the file is a pipe, socket or similar, but it's kind of implied by the use of select() also mentioned. It's also kind of implied by use of the term "block" - disk files don't block. If we are in

  1   2   >