Re: how to remove oldest files up to a limit efficiently

2008-07-08 Thread Dan Stromberg
On Tue, 08 Jul 2008 15:18:23 -0700, [EMAIL PROTECTED] wrote: > I need to mantain a filesystem where I'll keep only the most recently > used (MRU) files; least recently used ones (LRU) have to be removed to > leave space for newer ones. The filesystem in question is a clustered fs > (glusterfs) whi

Newbie question

2008-07-08 Thread |e0
Hi list, i'm running Ubuntu Hardy Desktop and i've installed Tim Golden WMI. However importing wmi module i have this error: >>> import wmi Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.5/site-packages/wmi.py", line 141, in from win32com.client import Get

Re: (silly?) speed comparisons

2008-07-08 Thread Peter Otten
mk wrote: > Now C++ version took over twice the time to execute in comparison to > Python time! > Am I comparing apples to oranges? Indeed. Where in Python you're passing references your C++ code produces copies of the vector. For starters you can change the function signature to void move_sli

Re: re.search much slower then grep on some regular expressions

2008-07-08 Thread Henning Thornblad
On Jul 8, 2:48 am, John Machin <[EMAIL PROTECTED]> wrote: > On Jul 8, 2:51 am, Henning Thornblad <[EMAIL PROTECTED]> > wrote: > > > > > When trying to find an alternative way of solving my problem i found > > that running this script: > > > #!/usr/bin/env python > > > import re > > > row="" > > for

Re: Returning the positions of a list that are non-zero

2008-07-08 Thread Ben Finney
Benjamin Goudey <[EMAIL PROTECTED]> writes: > For example, if my original list is [0,0,1,2,1,0,0] I would like to > produce the lists [1,2,1] (the non zero values) and [2,3,4] (indices > of where the non-zero values used to be). Removing non-zero values > is very easy but determining the indicies

Re: Returning the positions of a list that are non-zero

2008-07-08 Thread Rajanikanth Jammalamadaka
Try this: >>> li=[0,0,1,2,1,0,0] >>> li [0, 0, 1, 2, 1, 0, 0] >>> [i for i in range(len(li)) if li[i] != 0] [2, 3, 4] Cheers, Raj On Tue, Jul 8, 2008 at 10:26 PM, Benjamin Goudey <[EMAIL PROTECTED]> wrote: > I have a very large list of integers representing data needed for a > histogram that I'

Returning the positions of a list that are non-zero

2008-07-08 Thread Benjamin Goudey
I have a very large list of integers representing data needed for a histogram that I'm going to plot using pylab. However, most of these values (85%-95%) are zero and I would like to remove them to reduce the amount of memory I'm using and save time when it comes to plotting the data. To do this, I

Re: a simple 'for' question

2008-07-08 Thread Ben Keshet
oops, my mistake, actually it didn't work... when I tried: for x in folders: print x # print the current folder filename='Folder/%s/myfile.txt' %x f=open(filename,'r') it says: IOError: [Errno 2] No such file or directory: 'Folder/1/myfile.txt' I should mention that I am working in

Re: numeric emulation and __pos__

2008-07-08 Thread casevh
On Jul 7, 4:12 pm, Ethan Furman <[EMAIL PROTECTED]> wrote: > Greetings, List! > > I'm working on a numeric data type for measured values that will keep > track of and limit results to the number of significant digits > originally defined for the values in question. > > I am doing this primarily bec

Re: a simple 'for' question

2008-07-08 Thread Ben Keshet
thanks for the reply - it worked. I just want to make sure that I understand the general syntax - when can I use the iteration variable as x (e..g. print x), and when do I need to use the ...%s... %x syntax? is it only when I need to call x as a "string"? I am not sure I am asking the questio

Re: (silly?) speed comparisons

2008-07-08 Thread Terry Reedy
mk wrote: Out of curiosity I decided to make some speed comparisons of the same algorithm in Python and C++. Moving slices of lists of strings around seemed like a good test case. If you use Python to, in effect, call well-written C functions, and most of the computation time is spent in th

Re: "in"consistency?

2008-07-08 Thread Mel
David C. Ullrich wrote: > Oh, of course that's a good thing - changing "in" for lists > to give True there would be awful. I was wondering why it > _does_ work that way for strings. > > Maybe the answer is "because it can" - for strings the sort > of possible problem you point out can't come up.

Re: Dynamically Changing the Base Class

2008-07-08 Thread Adam C.
On Jul 7, 10:44 pm, Michele Simionato <[EMAIL PROTECTED]> wrote: > On Jul 7, 8:08 pm, "Adam C." <[EMAIL PROTECTED]> wrote: > > > Thanks. I think we would want new-style classes, and 6-year-old > > patches strike me as maybe a little out of the desired path... so this > > really just doesn't work in

Python HTTPS Bus Error

2008-07-08 Thread Alok Kumar
Hi, Can someone help me what to look for fixing Bus error. I must mention that I am working in embedded environment and it does have selective installation of python I am getting following error from client when it is trying to talk with server over *HTTPS*. HTTP works fine. *Alignment trap: py

Re: a simple 'for' question

2008-07-08 Thread John McMonagle
Ben Keshet wrote: > Hi fans, > > I want to use a 'for' iteration to manipulate files in a set of folders, > something like: > > folders= ['1A28','1A6W','56Y7'] > for x in folders: >print x # print the current folder >f = open('my/path/way/x/my_file.txt', 'r') >... > Use os.path.

Re: a simple 'for' question

2008-07-08 Thread Rajanikanth Jammalamadaka
Thanks for correcting my typo norseman. Ben: I forgot a slash after the first string as norseman pointed out. Raj On Tue, Jul 8, 2008 at 5:51 PM, norseman <[EMAIL PROTECTED]> wrote: > > Almost correct: There is a typo. Should read: > > for x in folders: >open('my/path/way/'+x+'/myfile.txt',

Re: a simple 'for' question

2008-07-08 Thread norseman
Almost correct: There is a typo. Should read: for x in folders: open('my/path/way/'+x+'/myfile.txt','r') Rajanikanth Jammalamadaka wrote: Hi! Try this for x in folders: open('my/path/way'+x+'myfile.txt','r') Cheers, Raj On Tue, Jul 8, 2008 at 5:08 PM, Ben Keshet <[EMAIL PROTECT

Re: a simple 'for' question

2008-07-08 Thread Brian Blais
On Jul 8, 2008, at Jul 8:8:08 PM, Ben Keshet wrote: I want to use a 'for' iteration to manipulate files in a set of folders, something like: folders= ['1A28','1A6W','56Y7'] for x in folders: print x # print the current folder f = open('my/path/way/x/my_file.txt', 'r') ... I t

Re: a simple 'for' question

2008-07-08 Thread Rajanikanth Jammalamadaka
Hi! Try this for x in folders: open('my/path/way'+x+'myfile.txt','r') Cheers, Raj On Tue, Jul 8, 2008 at 5:08 PM, Ben Keshet <[EMAIL PROTECTED]> wrote: > Hi fans, > > I want to use a 'for' iteration to manipulate files in a set of folders, > something like: > > folders= ['1A28','1A6W','56Y7

a simple 'for' question

2008-07-08 Thread Ben Keshet
Hi fans, I want to use a 'for' iteration to manipulate files in a set of folders, something like: folders= ['1A28','1A6W','56Y7'] for x in folders: print x # print the current folder f = open('my/path/way/x/my_file.txt', 'r') ... where 'x' in the pathway should iterate over '1A28

Re: plugins using cvs/distutils?

2008-07-08 Thread Larry Bates
Deacon wrote: Hi. I have an open-source application development environment that I would like to enable an automated package download system for (like downloadable plugins), using sourceforge as its repository. My software will have a menu-based popup window, that will list the packages (Applicat

find all ODBC databases ?

2008-07-08 Thread Stef Mientki
hello, I'm working on a general database manager, which will be open source and should preferable work under all OS. Now in windows I can find the ODBC databases by reading some reg key. I also know that ODBC is supported under Linux (I don't know anything of Linux), but how can I get all ODBC

how to remove oldest files up to a limit efficiently

2008-07-08 Thread [EMAIL PROTECTED]
I need to mantain a filesystem where I'll keep only the most recently used (MRU) files; least recently used ones (LRU) have to be removed to leave space for newer ones. The filesystem in question is a clustered fs (glusterfs) which is very slow on "find" operations. To add complexity there are more

Re: (silly?) speed comparisons

2008-07-08 Thread Rajanikanth Jammalamadaka
Try using a list instead of a vector for the C++ version. Raj On Tue, Jul 8, 2008 at 3:06 PM, mk <[EMAIL PROTECTED]> wrote: > Out of curiosity I decided to make some speed comparisons of the same > algorithm in Python and C++. Moving slices of lists of strings around seemed > like a good test cas

(silly?) speed comparisons

2008-07-08 Thread mk
Out of curiosity I decided to make some speed comparisons of the same algorithm in Python and C++. Moving slices of lists of strings around seemed like a good test case. Python code: def move_slice(list_arg, start, stop, dest): frag = list_arg[start:stop] if dest > stop:

Impossible to change methods with special names of instances of new-style classes?

2008-07-08 Thread Joseph Barillari
Hi python-list, I've just started using new-style classes and am a bit confused as to why I can't seem to alter methods with special names (__call__, etc.) of new-style class instances. In other words, I can do this: >>> class Z: ... pass ... >>> z = Z() >>> z.__call__ = lambda : 33 >>> z() 3

Re: Logging to zero or more destinations

2008-07-08 Thread Robert Kern
Rob Wolfe wrote: samwyse <[EMAIL PROTECTED]> writes: The only way that I can see for all three statements to be consistent is that the root logger starts with an empty list of handlers, and doesn't instantiate a default handler until either logging.basicConfig() is called, That is correct.

Re: numeric emulation and __pos__

2008-07-08 Thread Ethan Furman
Terry Reedy wrote: Ethan Furman wrote: Anybody have an example of when the unary + actually does something? Besides the below Decimal example. I'm curious under what circumstances it would be useful for more than just completeness (although completeness for it's own sake is important, IMO).

Re: Reportlab Image object opens filehandles

2008-07-08 Thread norseman
Daniel de Sousa Barros wrote: Hi Mr Robin, I saw your post: http://mail.python.org/pipermail/python-list/2003-September/224781.html I'm trying to append more than 1000 images into one PDF report, but i get the IOError: Too many... know you a solution for it? Sorry by my english i'm braz

Re: numeric emulation and __pos__

2008-07-08 Thread Terry Reedy
Ethan Furman wrote: Anybody have an example of when the unary + actually does something? Besides the below Decimal example. I'm curious under what circumstances it would be useful for more than just completeness (although completeness for it's own sake is important, IMO). All true operators

Re: Cross Compiler for Python?

2008-07-08 Thread norseman
Hendrik van Rooyen wrote: norseman wrote: == In case all else fails: This is not a cookbook answer, but: 1) gnu's gcc will compile to 16,32 or 64 bit intel architectures OK, the 32 bit version compiles to 16 or 32 & the 64 shoul

Re: sage vs enthought for sci computing

2008-07-08 Thread Matthieu Brucher
2008/7/8 three3q <[EMAIL PROTECTED]>: > Hi, > >>> If my goal >>> is to replace matlab (we do signal processing and stats on >>> physiological data, with a lot of visualization), would sage or >>> enthought get me going quicker? > Pylab. Not a good idea, as pylab will be replaced by pyplot which on

Re: sage vs enthought for sci computing

2008-07-08 Thread sturlamolden
On 7 Jul, 22:35, [EMAIL PROTECTED] wrote: > Hello, > I have recently become interested in using python for scientific > computing, and came across both sage and enthought. I am curious if > anyone can tell me what the differences are between the two, since > there seems to be a lot of overlap (from

Re: Logging to zero or more destinations

2008-07-08 Thread Robert Kern
samwyse wrote: In the Python 2.5 Library Reference, section 14.5.3 (Logging to multiple destinations), an example is given of logging to both a file and the console. This is done by using logging.basicConfig() to configure a log file, and then calling logging.getLogger('').addHandler(console) to

Re: GUI Programming by hand not code with Python Code

2008-07-08 Thread sturlamolden
On 7 Jul, 04:33, [EMAIL PROTECTED] wrote: > Is their a program that lets you design a GUI by hand (like gambas) > not by code (like wxpython) but the commands are in python? > > A program similar to gambas or vb > > Gambas with python code instead of gambas code would be perfect. > > Thanks in adv

Re: Logging to zero or more destinations

2008-07-08 Thread Rob Wolfe
samwyse <[EMAIL PROTECTED]> writes: > In the Python 2.5 Library Reference, section 14.5.3 (Logging to > multiple destinations), an example is given of logging to both a file > and the console. This is done by using logging.basicConfig() to > configure a log file, and then calling > logging.getLog

Re: Logger Configuration

2008-07-08 Thread Rob Wolfe
"Robert Rawlins" <[EMAIL PROTECTED]> writes: > Hello guys, > > > > I?ve attached an example of my logging configuration file for you to look at. > The problem I?m experiencing is that the log files are not rotating as I would > expect them to, they just keep growing and growing. > > > > Can yo

Python for Kids

2008-07-08 Thread Sean DiZazzo
Pretty cool!! Our base will be *much* bigger in about twenty years. I remember doing Basic on my dads Apple IIe. http://wiki.laptop.org/go/Pippy#Summary -- http://mail.python.org/mailman/listinfo/python-list

Re: "in"consistency?

2008-07-08 Thread Terry Reedy
castironpi wrote: Strings are not containers. Library Reference/Built-in Types/Sequence Types says "Strings contain Unicode characters." Perhaps you have a different notion of contain/container. I prefer 'collection' to 'container' since 'container' tends to imply an exclusiveness that is

Re: numeric emulation and __pos__

2008-07-08 Thread Ethan Furman
Mark Dickinson wrote: On Jul 8, 12:12 am, Ethan Furman <[EMAIL PROTECTED]> wrote: 1) Any reason to support the less common operators? i.e. <<, >>, &, ^, | No reason to support any of these for a nonintegral nonbinary type, as far as I can see. 2) What, exactly, does .__pos__() do? A

Re: Relative Package Import

2008-07-08 Thread Peter Otten
Robert Hancock wrote: > mypackage/ > __init__.py > push/ > __init__.py > dest.py > feed/ >__init__py > subject.py > > In subject.py I have > from ..push import dest > > But i receiv

Re: "in"consistency?

2008-07-08 Thread Terry Reedy
David C. Ullrich wrote: In article <[EMAIL PROTECTED]>, Terry Reedy <[EMAIL PROTECTED]> wrote: Is there a reason for the inconsistency? I would have thought "in" would check for elements of a sequence, regardless of what sort of sequence it was... It is not an inconsistency but an extension

Re: Relative Package Import

2008-07-08 Thread Remy Blank
Robert Hancock wrote: mypackage/ __init__.py push/ __init__.py dest.py feed/ __init__py ^ Missing dot here? ---| In subject.py I have from ..push import dest But

Re: How to make python scripts .py executable, not bring up editor

2008-07-08 Thread Matimus
On Jul 7, 2:56 pm, korean_dave <[EMAIL PROTECTED]> wrote: > From command Prompt, i type in a script,  "tryme.py". > > This, instead, brings up PythonWin editor and Interactive Window. > > Path variable is "C:\Python24". (I need Python 2.4 installed, not 2.5) > > How do I make it so that the script

Re: system tray for Tk

2008-07-08 Thread Kevin Walzer
Oguz Yarimtepe wrote: Hi, Is there any binding that i can use for my python-tk application that will show an icon at the system tray when the application runs which will be able to be change during the process? See http://wiki.tcl.tk/4090 for some ideas. This will require installing some Tcl

Re: How to make python scripts .py executable, not bring up editor

2008-07-08 Thread Chris Hulan
On Jul 7, 5:56 pm, korean_dave <[EMAIL PROTECTED]> wrote: > From command Prompt, i type in a script, "tryme.py". > > This, instead, brings up PythonWin editor and Interactive Window. > > Path variable is "C:\Python24". (I need Python 2.4 installed, not 2.5) > > How do I make it so that the script

Re: How to make python scripts .py executable, not bring up editor

2008-07-08 Thread norseman
OK- ; In Windows use the Window Explorer and go find a something.py. Right click on it and select Open With then Browse and go find your Python24\python.exe and select it. Then check the box that says "Always use this for..." and test it by closing/re-opening WinExplorer and left c

Re: extended setattr()

2008-07-08 Thread Diez B. Roggisch
Andre Adrian wrote: > Diez B. Roggisch nospam.web.de> writes: > >> > def ext_setattr(obj, attr, val): >> > for subattr in attr.split("."): >> > obj = getattr(obj, subattr) >> > obj = val >> > >> import test >> a = A() >> > Traceback (most recent call last): >> > File

Re: problem with Tkinter after installing Python 2.5.2 on UBUNTU

2008-07-08 Thread Jerry Hill
On Tue, Jul 8, 2008 at 12:44 PM, <[EMAIL PROTECTED]> wrote: > I just installed Python 2.5.2 on UBUNTU Linux. It seems to work, > however I don't seem to have access Tkinter. This is the result of > "import Tkinter": I think ubuntu and debian both split Tkinter out of their main python packages.

problem with Tkinter after installing Python 2.5.2 on UBUNTU

2008-07-08 Thread Dogzilla1000
I just installed Python 2.5.2 on UBUNTU Linux. It seems to work, however I don't seem to have access Tkinter. This is the result of "import Tkinter": Python 2.5.2 (r252:60911, Jul 7 2008, 12:39:49) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for

plugins using cvs/distutils?

2008-07-08 Thread Deacon
Hi. I have an open-source application development environment that I would like to enable an automated package download system for (like downloadable plugins), using sourceforge as its repository. My software will have a menu-based popup window, that will list the packages (Applications) available

Re: re.search much slower then grep on some regular expressions

2008-07-08 Thread Kris Kennaway
samwyse wrote: On Jul 4, 6:43 am, Henning_Thornblad <[EMAIL PROTECTED]> wrote: What can be the cause of the large difference between re.search and grep? While doing a simple grep: grep '[^ "=]*/' input (input contains 156.000 a in one row) doesn't even take a second. Is this

Re: "in"consistency?

2008-07-08 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Terry Reedy <[EMAIL PROTECTED]> wrote: > David C. Ullrich wrote: > > 'ab' in 'abc' > > True > > 'a' in 'abc' works according to the standard meaning of o in collection. > > 'ab' in 'abc' could not work by that standard meaning because strings, > as virtual

Re: "in"consistency?

2008-07-08 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Nick Dumas <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > [1,2] in [1,2,3] checks to see if the list [1,2] is an item in [1,2,3]. > Because the list [1,2,3] only contains the integers 1,2,3, the code > returns a False. Try "[1,2]

Re: "in"consistency?

2008-07-08 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Mel <[EMAIL PROTECTED]> wrote: > Ben Finney wrote: > > > "David C. Ullrich" <[EMAIL PROTECTED]> writes: > > > >> >>> 'ab' in 'abc' > >> True > >> >>> [1,2] in [1,2,3] > >> False > > > > http://www.python.org/doc/ref/comparisons.html> > > > >> Is there a reason f

Re: No Exceptions

2008-07-08 Thread Gary Herron
Robert Rawlins wrote: Morning Guys, This morning I’ve been having a strange issue where my application doesn’t appear to raise any exceptions. Even when manually placing code in the application which raises an exception explicitly like: Raise Exception, “This is a test exception” The appli

Re: "in"consistency?

2008-07-08 Thread castironpi
On Jul 7, 5:02 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > Nick Dumas wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA1 > > > [1,2] in [1,2,3] checks to see if the list [1,2] is an item in [1,2,3]. > > Because the list [1,2,3] only contains the integers 1,2,3, the code > > returns a Fal

Re: caseless dict - questions

2008-07-08 Thread oj
On Jul 5, 1:57 am, Phoe6 <[EMAIL PROTECTED]> wrote: > I have a requirement for using caseless dict. I searched the web for > many different implementations and found one snippet which was > implemented in minimal and useful way. > > # > import UserDict > > class CaseInsensitiveDict(dict

Tricky problem: loss of terminal control after python script running (depending on internal parameters)

2008-07-08 Thread Mathieu Prevot
Hi there, I have a python script that runs subprocesses (task = ffmpeg for convertion of videos to images) from threads [1]. I want to run at most 4 (default) tasks at the same time, and I usually ask the python script to process 10 files for testing. I'll run it on thousands of files for primeti

Relative Package Import

2008-07-08 Thread Robert Hancock
mypackage/ __init__.py push/ __init__.py dest.py feed/ __init__py subject.py In subject.py I have from ..push import dest But i receive the error: Caught exception importing module

Re: Dynamically Changing the Base Class

2008-07-08 Thread Adam C.
On Jul 7, 4:04 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Jul 7, 9:31 am, "Adam C." <[EMAIL PROTECTED]> wrote: > > > > > We have a situation where we want a Swig-generated Python class to > > have a different base (not object). It doesn't appear that we can > > coerce Swig into generating the c

Reportlab Image object opens filehandles

2008-07-08 Thread Daniel de Sousa Barros
Hi Mr Robin, I saw your post: http://mail.python.org/pipermail/python-list/2003-September/224781.html I'm trying to append more than 1000 images into one PDF report, but i get the IOError: Too many... know you a solution for it? Sorry by my english i'm brazilian and i'm learning english ye

Re: How to make python scripts .py executable, not bring up editor

2008-07-08 Thread Mike Driscoll
On Jul 7, 4:56 pm, korean_dave <[EMAIL PROTECTED]> wrote: > From command Prompt, i type in a script,  "tryme.py". > > This, instead, brings up PythonWin editor and Interactive Window. > > Path variable is "C:\Python24". (I need Python 2.4 installed, not 2.5) > > How do I make it so that the script

Re: numeric emulation and __pos__

2008-07-08 Thread Mark Dickinson
On Jul 8, 12:12 am, Ethan Furman <[EMAIL PROTECTED]> wrote: > 1) Any reason to support the less common operators? >         i.e. <<, >>, &, ^, | No reason to support any of these for a nonintegral nonbinary type, as far as I can see. > 2) What, exactly, does .__pos__() do?  An example would help,

Re: re.search much slower then grep on some regular expressions

2008-07-08 Thread Kris Kennaway
samwyse wrote: On Jul 4, 6:43 am, Henning_Thornblad <[EMAIL PROTECTED]> wrote: What can be the cause of the large difference between re.search and grep? While doing a simple grep: grep '[^ "=]*/' input (input contains 156.000 a in one row) doesn't even take a second. Is this

Re: How to make python scripts .py executable, not bring up editor

2008-07-08 Thread Iain King
On Jul 7, 10:56 pm, korean_dave <[EMAIL PROTECTED]> wrote: > From command Prompt, i type in a script,  "tryme.py". > > This, instead, brings up PythonWin editor and Interactive Window. > > Path variable is "C:\Python24". (I need Python 2.4 installed, not 2.5) > > How do I make it so that the script

Re: How to make python scripts .py executable, not bring up editor

2008-07-08 Thread Paul McGuire
On Jul 7, 4:56 pm, korean_dave <[EMAIL PROTECTED]> wrote: > From command Prompt, i type in a script,  "tryme.py". > > This, instead, brings up PythonWin editor and Interactive Window. > > Path variable is "C:\Python24". (I need Python 2.4 installed, not 2.5) > > How do I make it so that the script

Re: numeric emulation and __pos__

2008-07-08 Thread samwyse
On Jul 7, 6:12 pm, Ethan Furman <[EMAIL PROTECTED]> wrote: > Greetings, List! > > I'm working on a numeric data type for measured values that will keep > track of and limit results to the number of significant digits > originally defined for the values in question. > > I am doing this primarily bec

RE: Logger Configuration

2008-07-08 Thread Robert Rawlins
Ok, I've managed to resolve this issue, it seems it was because I had the file size and number of archives to keep in "" and was thus setting them as strings instead of numerical values. Robert From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Rawlins Sent: 08 July 2

Re: re.search much slower then grep on some regular expressions

2008-07-08 Thread samwyse
On Jul 4, 6:43 am, Henning_Thornblad <[EMAIL PROTECTED]> wrote: > What can be the cause of the large difference between re.search and > grep? > While doing a simple grep: > grep '[^ "=]*/' input                  (input contains 156.000 a in > one row) > doesn't even take a second. > > Is this a bu

Re: py2exe, PyQT, QtWebKit and jpeg problem

2008-07-08 Thread Carbonimax
On Jun 29, 4:14 pm, [EMAIL PROTECTED] wrote: > On 6月20日, 下午11时04分, Carbonimax <[EMAIL PROTECTED]> wrote: > > > hello > > > I have a problem with py2exe and QtWebKit : > > I make a program with a QtWebKit view. > > If I launch the .py directly, all images (jpg, png) are displayed but > > if I compil

Re: py2exe, PyQT, QtWebKit and jpeg problem

2008-07-08 Thread Carbonimax
On Jun 29, 4:14 pm, [EMAIL PROTECTED] wrote: > On 6月20日, 下午11时04分, Carbonimax <[EMAIL PROTECTED]> wrote: > > > hello > > > I have a problem with py2exe and QtWebKit : > > I make a program with a QtWebKit view. > > If I launch the .py directly, all images (jpg, png) are displayed but > > if I compil

Logging to zero or more destinations

2008-07-08 Thread samwyse
In the Python 2.5 Library Reference, section 14.5.3 (Logging to multiple destinations), an example is given of logging to both a file and the console. This is done by using logging.basicConfig() to configure a log file, and then calling logging.getLogger('').addHandler(console) to add the console.

No Exceptions

2008-07-08 Thread Robert Rawlins
Morning Guys, This morning I've been having a strange issue where my application doesn't appear to raise any exceptions. Even when manually placing code in the application which raises an exception explicitly like: Raise Exception, "This is a test exception" The applicat

Logger Configuration

2008-07-08 Thread Robert Rawlins
Hello guys, I've attached an example of my logging configuration file for you to look at. The problem I'm experiencing is that the log files are not rotating as I would expect them to, they just keep growing and growing. Can you see any reason for this to happen? This is the first time I've

Re: caseless dict - questions

2008-07-08 Thread Jeff
Use the __str__ and __unicode__ methods to control the printed representation of a class. -- http://mail.python.org/mailman/listinfo/python-list

Re: Emacs/Python Essentials?

2008-07-08 Thread Jeff
I just use Python mode. For Django work, there is a Django mode as well. Cedet is helpful, too. -- http://mail.python.org/mailman/listinfo/python-list

Re: extended setattr()

2008-07-08 Thread Andre Adrian
Diez B. Roggisch nospam.web.de> writes: > > def ext_setattr(obj, attr, val): > > for subattr in attr.split("."): > > obj = getattr(obj, subattr) > > obj = val > > > import test > a = A() > > Traceback (most recent call last): > > File "", line 1, in > > NameError: na

Re: how are strings immutable in python?

2008-07-08 Thread Lie
On Jul 7, 1:45 am, ssecorp <[EMAIL PROTECTED]> wrote: > >>> h = "aja baja" # 'aja baja' is created and assigned to the name h > >>> h += 'e' # Is the equivalent of: # h = h + 'e' # # In there, a h and 'e' is concatenated and assigned to # a new string object which is bound to h. The # original str

Does omniORBpy 3.2 supports DII?

2008-07-08 Thread Ilan
Hello, My apologies if this is not the correct forum for thses quiestions, by I'm rather new to python+CORBA Has anyone used omniORBpy as CORBA implementation? are there any drawbacks? Does omniORBpy 3.2 supports the Dynamic Invocation Interface? Thanks. Ilan -- http://mail.python.org/mailman/l

Re: Confused yet again: Very Newbie Question

2008-07-08 Thread Lie
On Jul 7, 7:09 pm, Jeff <[EMAIL PROTECTED]> wrote: > When you call c3.createJoe(c1.fred), you are passing a copy of the > value stored in c1.fred to your function.  Python passes function > parameters by value. No, python doesn't pass variable either by value or by reference. The behavior in pytho

Re: windows active directory ldap output encoding

2008-07-08 Thread Michael Ströder
Michael Ströder wrote: jo3c wrote: Im trying to get some information out of a windows sever 2003 chinese active directory system so let's say encoding is probably big5 or utf-8 The Unicode encoding of LDAP attributes with syntax Directory String is always UTF-8 (e.g. attributes 'cn', 'sn', 'g

Re: windows active directory ldap output encoding

2008-07-08 Thread Michael Ströder
jo3c wrote: Im trying to get some information out of a windows sever 2003 chinese active directory system so let's say encoding is probably big5 or utf-8 The Unicode encoding of LDAP attributes with syntax Directory String is always UTF-8 (e.g. attributes 'cn', 'sn', 'givenName' or 'displayNam

Re: Cross Compiler for Python?

2008-07-08 Thread Hendrik van Rooyen
norseman wrote: >== >In case all else fails: > >This is not a cookbook answer, but: >1) gnu's gcc will compile to 16,32 or 64 bit intel architectures > OK, the 32 bit version compiles to 16 or 32 & the 64 should. >The 64

Re: Cross Compiler for Python?

2008-07-08 Thread Hendrik van Rooyen
Jorgen Grahn wrote: >This is a special case of a more general, non-Python problem which you >will have to address if you want to build an industrial controller. > >If your target has no C compiler[1], you have to set up a cross-compiling >environment. I'd be surprised if the eBox doesn't come wit

Re: Very weird bug!

2008-07-08 Thread Jorgen Bodde
Maybe the interpreter remembered the values of some objects you used? If you type in the interpreter, the objects you create have a lifetime as long as the interpreter is active, which means it can get a state behaviour that otherwise is not present if you start a new interpreter instance. To be sa

Re: Emacs/Python Essentials?

2008-07-08 Thread Bruno Desthuilliers
Ben Finney a écrit : xkenneth <[EMAIL PROTECTED]> writes: What does everyone consider essential for emacs python dev? GNU Emacs 22. The 'whitespace-mode' and 'python-mode' are good improvements in that version of Emacs. I've heard good things also about: 'ropemacs' http://rope.sourceforge.

windows active directory ldap output encoding

2008-07-08 Thread jo3c
Hi.. Im trying to get some information out of a windows sever 2003 chinese active directory system so let's say encoding is probably big5 or utf-8 what im doing is simliar to ldapsearch in shell with my python script using python ldap module the result is not the correct encoding.. i've look man