Re: Getting some element from sets.Set

2007-05-03 Thread Raymond Hettinger
> I do not want to remove the element, but get some element > from the Set. . . . > Is there a way to do this. I am doing it like this: > > for x in s: break > > Now x is /some_element/ from s. That is one way to do it. Another is to write: x = iter(s).next() One more approach: x = s.po

Re: Getting some element from sets.Set

2007-05-03 Thread Steven D'Aprano
On Thu, 03 May 2007 23:08:33 -0700, [EMAIL PROTECTED] wrote: > It is not possible to index set objects. That is OK. > But, what if I want to find some element from the Set. > > from sets import Set > s = Set( range(12 ) > > if I do pop, that particular element gets removed. > I do not want to re

Re: Why are functions atomic?

2007-05-03 Thread Michael
On May 2, 6:08 am, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Tue, 2007-05-01 at 22:21 -0700, Michael wrote: > > Is there a reason for using the closure here? Using function defaults > > seems to give better performance:[...] > > It does? Not as far as I can measure it to any significant degree

Re: Getting some element from sets.Set

2007-05-03 Thread Peter Otten
[EMAIL PROTECTED] wrote: > It is not possible to index set objects. That is OK. > But, what if I want to find some element from the Set. > > from sets import Set > s = Set( range(12 ) > > if I do pop, that particular element gets removed. > I do not want to remove the element, but get some eleme

enable-shared

2007-05-03 Thread SamG
How we do if find that python that we are using is compiled with the -- enable-shared option. There is can actually be done using distutils.sysconfig module but this modules is ported only with python- devel but not with standard python install. Is there another way apart from checking the

Re: Replacement for HTMLGen?

2007-05-03 Thread Tim Roberts
"Joshua J. Kugler" <[EMAIL PROTECTED]> wrote: > >I realize that in today's MVC-everything world, the mere mention of >generating HTML in the script is near heresy, but for now, it's what I ened >to do. :) > >That said, can someone recommend a good replacement for HTMLGen? I used to be a huge fan o

Re: relative import broken?

2007-05-03 Thread Leo Kislov
On May 3, 10:08 am, "Alan Isaac" <[EMAIL PROTECTED]> wrote: > "Alex Martelli" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > Very simply, PEP 328 explains: > > """ > > Relative Imports and __name__ > > > Relative imports use a module's __name__ attribute to determine that > >

urllib.quote fails on Unicode URL

2007-05-03 Thread John Nagle
The code in urllib.quote fails on Unicode input, when called by robotparser. That bit of code needs some attention. - It still assumes ASCII goes up to 255, which hasn't been true in Python for a while now. - The initialization may not be thread-safe; a table is being initial

Getting some element from sets.Set

2007-05-03 Thread [EMAIL PROTECTED]
It is not possible to index set objects. That is OK. But, what if I want to find some element from the Set. from sets import Set s = Set( range(12 ) if I do pop, that particular element gets removed. I do not want to remove the element, but get some element from the Set. s.some_element() # Is n

Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?

2007-05-03 Thread coyote
The Great Attractor wrote: > On Thu, 03 May 2007 13:53:39 +0100, Eeyore > <[EMAIL PROTECTED]> wrote: > >> >> Peter Webb wrote: >> Ask yourself WHY havn't I seen this footage before? >>> OK, why haven't you seen this footage before? >> Nice response ! >>

Re: pack/unpack zero terminated string

2007-05-03 Thread Tim Roberts
tmp123 <[EMAIL PROTECTED]> wrote: > >After review the "struct" documentation, it seems there are no option >to pack/unpack zero terminated strings. Right. Just as there is no way to describe such a thing as a C struct. You'll have to unpack the fields by hand, which is that case won't be hard. --

Re: os.path.join

2007-05-03 Thread Tim Roberts
Elliot Peele <[EMAIL PROTECTED]> wrote: >On Tue, 2007-05-01 at 19:27 -0700, 7stud wrote: >> On May 1, 7:36 pm, Elliot Peele <[EMAIL PROTECTED]> wrote: >> > Why does os.path.join('/foo', '/bar') return '/bar' rather than >> > '/foo/bar'? That just seems rather counter intuitive. >> > >> > Elliot >>

Re: Strange terminal behavior after quitting Tkinter application

2007-05-03 Thread Chris
(I apologize if some similar version of this message has already appeared; I've tried several time to post it, seemingly without success.) > If that is satisfactory, well and good. However, there > is a possibility that you may lose some settings that you would > prefer to keep. The termin

Re: Decorating class member functions

2007-05-03 Thread 7stud
On May 3, 7:21 pm, Andy Terrel <[EMAIL PROTECTED]> wrote: > Okay does anyone know how to decorate class member functions? > > The following code gives me an error: > > Traceback (most recent call last): > File "decorators2.py", line 33, in > s.update() > File "decorators2.py", line 13, in

problem with py2exe and microsoft speech SDK 5.1

2007-05-03 Thread Dave Lim
>On May 3, 1:29 pm, Dave Lim wrote: >> Hello, this is my first time in the mailing list so >> bear with me. >> >> Basically what I did was I followed this site:http://surguy.net/articles/speechrecognition.xml >> >> So I installed microsoft speech SDK 5.1 and then used >> pythonwin COM MakePy utili

Re: My Python annoyances

2007-05-03 Thread Leo Kislov
On May 3, 9:27 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 03 May 2007 10:49:26 -0300, Ben Collver <[EMAIL PROTECTED]> > escribió: > > > I tried to write portable Python code. The zlib CRC function returned > > different results on architectures between 32 bit and 64 bit > >

Re: hp 11.11 64 bit python 2.5 build gets error "import site failed"

2007-05-03 Thread Leo Kislov
On May 3, 2:54 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >>> "import site failed" > >>> OverflowError: signed integer is greater than the maximum. > >> - what is the value of ival? > > ival: 4294967295 > > I see. This is 0x, which would be -1 if it were of type > int. So perhaps so

Re: How do I get type methods?

2007-05-03 Thread Gabriel Genellina
En Fri, 04 May 2007 01:34:20 -0300, <[EMAIL PROTECTED]> escribió: > I'm not against 'dir(MyClass)'; the question is, what should I 'dir()' > to get methods of 'pyuno' type instance? Usually instances don't have its own methods, they get them from the class. So you actually need dir(MyClass). No

Re: passing an array of variant in vb to a python COM object = win32com bug ?

2007-05-03 Thread Gabriel Genellina
En Thu, 03 May 2007 09:41:57 -0300, vml <[EMAIL PROTECTED]> escribió: > On 3 mai, 14:20, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >> En Thu, 03 May 2007 04:54:43 -0300, vml <[EMAIL PROTECTED]> >> escribió: >> >> > I have a python com object which contains a method to inverse an array >> > i

Re: Replacement for HTMLGen?

2007-05-03 Thread Gabriel Genellina
En Thu, 03 May 2007 21:23:42 -0300, Joshua J. Kugler <[EMAIL PROTECTED]> escribió: > I found http://dustman.net/andy/python/HyperText, but it's not listed in > Cheeseshop, and its latest release is over seven years ago. Granted, I > know HTML doesn't change (much) but it's at least nice to know

Re: Organizing code - import question

2007-05-03 Thread Gabriel Genellina
En Thu, 03 May 2007 12:41:00 -0300, Brian Blais <[EMAIL PROTECTED]> escribió: > I am trying to organize some of my code, and am having a little trouble > with the import logic. I find I often have something like: > > MyPackage/ > Part1/ # wants to use functions in Common/ > __init__

Re: I wish that [].append(x) returned [x]

2007-05-03 Thread Carsten Haese
On Wed, 2007-05-02 at 13:45 -0800, Joshua J. Kugler wrote: > On Wednesday 02 May 2007 12:05, Tobiah wrote: > > > > >> In addition to the above good advice, in case you are submitting a query > >> to a DB-API compliant SQL database, you should use query parameters > >> instead of building the quer

Re: How do I get type methods?

2007-05-03 Thread yavannadil
On May 4, 3:21 am, Stargaming <[EMAIL PROTECTED]> wrote: > What's wrong about `dir()`? > x = MyClass() > x.f() I want to cashe pointers to Python functions in a non-Python app. 'dir()' requires an argument, and I want to get function pointers before I have any variable of given type or class. That

Re: Decorating class member functions

2007-05-03 Thread Peter Otten
Andy Terrel wrote: > Okay does anyone know how to decorate class member functions? > > The following code gives me an error: > > Traceback (most recent call last): > File "decorators2.py", line 33, in > s.update() > File "decorators2.py", line 13, in __call__ > retval = self.fn.__ca

Re: My Python annoyances

2007-05-03 Thread Gabriel Genellina
En Thu, 03 May 2007 10:49:26 -0300, Ben Collver <[EMAIL PROTECTED]> escribió: > I tried to write portable Python code. The zlib CRC function returned > different results on architectures between 32 bit and 64 bit > architectures. I filed a bug report. It was closed, without a comment >

New EasyExtend release is out

2007-05-03 Thread Kay Schluehr
Hi folks, EasyExtend is a grammar based preprocessor generator and metaprogramming system for Python written in Python. After reworking an initial release for 11 months (!) it's time to present now EasyExtend 2.0-alpha1. You find EasyExtend on the projects homepage: http://www.fiber-space.de/Eas

Re: tkinter listboxes

2007-05-03 Thread James Stroud
[EMAIL PROTECTED] wrote: > I will give a simplified example of the problem at hand -- > > I have a case in which I have two listboxes - listbox1 and listbox2, > if I click on an item in listbox1 the item gets highlighted as > expected. Now if I click on an item in listbox2 the selected item in > l

Re: Decorating class member functions

2007-05-03 Thread Steven D'Aprano
On Thu, 03 May 2007 19:28:52 -0700, Andy Terrel wrote: > I just need to keep the state around. I make a call to some function > that is pretty expensive so I want to save it as a member during the > __init__ of the decorator. > > Yeah I'm afraid it can't be done either, that's why I asked the gro

Re: file Error

2007-05-03 Thread Gabriel Genellina
En Thu, 03 May 2007 10:15:52 -0300, <[EMAIL PROTECTED]> escribió: > Thanks for the replyHow do i accept the filename is a > parameter and avoid the error.Can you elaborate. To get the arguments passed to the script, use sys.argv[] Most introductory texts should cover it, like the Python t

Re: [ANN] Update to Python Quick Reference Card (for Python 2.4) (v0.67)

2007-05-03 Thread Alex Martelli
Laurent Pointal <[EMAIL PROTECTED]> wrote: ... > > It's an excellent quick-reference card, BTW (though I don't quite > > understand why even-numbered pages are flipped upside-down). > > At work I print it on horizontal A4/USLetter, with recto-back, and with > binding (reliure in french) on smal

tkinter listboxes

2007-05-03 Thread rahulnag22
I will give a simplified example of the problem at hand -- I have a case in which I have two listboxes - listbox1 and listbox2, if I click on an item in listbox1 the item gets highlighted as expected. Now if I click on an item in listbox2 the selected item in listbox1 loses its highlight. My quest

Re: adding methods at runtime and lambda

2007-05-03 Thread Gabriel Genellina
En Thu, 03 May 2007 16:52:55 -0300, Mike <[EMAIL PROTECTED]> escribió: > I was messing around with adding methods to a class instance at > runtime and saw the usual code one finds online for this. All the > examples I saw say, of course, to make sure that for your method that > you have 'self' as

Re: How do I import a variable from another module?

2007-05-03 Thread Steven D'Aprano
On Thu, 03 May 2007 18:27:12 -0700, noagbodjivictor wrote: > I have a variable names actions in a module named qt_actions.py > > Well this is what I get: import qt_actions qt_actions.actions > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'module' object

Re: How do I import a variable from another module?

2007-05-03 Thread sykora
On May 4, 6:39 am, [EMAIL PROTECTED] wrote: > On May 3, 9:36 pm, Andy Terrel <[EMAIL PROTECTED]> wrote: > > > are you sure your variable isn't in some code block that wouldn't be > > read on import? Such as: > > > if __name__ == "__main___": > > actions = 1 > > No Andy, I have not put the var

Re: Decorating class member functions

2007-05-03 Thread Andy Terrel
not quite as elegant but here is a workaround... Thanks Virgil for taking some time to think about it. --- class Bugger (object): def __init__ (self, module): print "Entering __init__" self.module = module self.verb = 0 def instrument (module_name): def wrapper(f)

Re: Decorating class member functions

2007-05-03 Thread Jorge Godoy
Andy Terrel <[EMAIL PROTECTED]> writes: > I just need to keep the state around. I make a call to some function > that is pretty expensive so I want to save it as a member during the > __init__ of the decorator. > > Yeah I'm afraid it can't be done either, that's why I asked the group. Have you lo

Re: Decorating class member functions

2007-05-03 Thread Andy Terrel
I just need to keep the state around. I make a call to some function that is pretty expensive so I want to save it as a member during the __init__ of the decorator. Yeah I'm afraid it can't be done either, that's why I asked the group. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why stay with lisp when there are python and perl?

2007-05-03 Thread Jon Harrop
Nameless wrote: > Why should I keep on learning lisp when there are python and perl? Lisp compilers are much more advanced, for one thing. Xah Lee wrote: > (if there is some demand, i will add a concrept, little programing > example, that shows, how lisp's symbols and macros concepts, set it > ap

Re: 4 quadrant atan

2007-05-03 Thread Charles Sanders
Roel Schroeven wrote: > > I might be wrong of course, but can't you just use atan2? Only problem > is that it returns negative angles for quadrants 3 and 4, but that is > easily solved. In Python: > > from math import atan2, pi, fmod > def vectorAngle(x, y): > return fmod(atan2(y, x) + 2*pi

Re: Can I use Python instead of Joomla?

2007-05-03 Thread walterbyrd
On May 3, 7:49 pm, John Draper <[EMAIL PROTECTED]> wrote: > I admit, Joomla is easy to use I admit, but very easy to vector into > a root exploit. I had no idea. Thank you for posting that. One thing I really like about joomla is the 1600+ extensions. But, I don't need those kinds of security

Re: Decorating class member functions

2007-05-03 Thread Virgil Dupras
On May 3, 9:21 pm, Andy Terrel <[EMAIL PROTECTED]> wrote: > Okay does anyone know how to decorate class member functions? > > The following code gives me an error: > > Traceback (most recent call last): > File "decorators2.py", line 33, in > s.update() > File "decorators2.py", line 13, in

Re: Can I use Python instead of Joomla?

2007-05-03 Thread walterbyrd
On May 3, 11:08 am, Bruno Desthuilliers wrote: > I'm not sure integrating CakePHP stuff into something like Joomla or > Drupal will be that easy. I don't know either. But, there are projects called "jake" and "drake" which are specifically geared toward intergrating cakephp with joomla and drupa

Re: Can I use Python instead of Joomla?

2007-05-03 Thread John Draper
walterbyrd wrote: >If I wanted to build a website with forums, news feeds, galleries, >event calander, document managment, etc. I do so in Joomla easily. > >But, I would perfer to use django/python, if that would be at all >practical. > >I suppose I could put python scripts into django, if those s

Re: Decorating class member functions

2007-05-03 Thread Virgil Dupras
On May 3, 9:33 pm, Virgil Dupras <[EMAIL PROTECTED]> wrote: > On May 3, 9:21 pm, Andy Terrel <[EMAIL PROTECTED]> wrote: > > > > > Okay does anyone know how to decorate class member functions? > > > The following code gives me an error: > > > Traceback (most recent call last): > > File "decorators

Re: How do I import a variable from another module?

2007-05-03 Thread noagbodjivictor
On May 3, 9:36 pm, Andy Terrel <[EMAIL PROTECTED]> wrote: > are you sure your variable isn't in some code block that wouldn't be > read on import? Such as: > > if __name__ == "__main___": > actions = 1 No Andy, I have not put the variable in any code block -- http://mail.python.org/mailman

Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?

2007-05-03 Thread The Great Attractor
On Thu, 03 May 2007 18:08:31 -0500, quasi <[EMAIL PROTECTED]> wrote: >On Fri, 04 May 2007 09:37:37 +1200, Gib Bogle ><[EMAIL PROTECTED]> wrote: > >>Ah, so the firefighters were in on the conspiracy! > >No, but the firefighters are very much aware that there is more to >9/11 than has been officiall

Re: How do I import a variable from another module?

2007-05-03 Thread Andy Terrel
are you sure your variable isn't in some code block that wouldn't be read on import? Such as: if __name__ == "__main___": actions = 1 -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorating class member functions

2007-05-03 Thread Virgil Dupras
On May 3, 9:21 pm, Andy Terrel <[EMAIL PROTECTED]> wrote: > Okay does anyone know how to decorate class member functions? > > The following code gives me an error: > > Traceback (most recent call last): > File "decorators2.py", line 33, in > s.update() > File "decorators2.py", line 13, in

Re: Decorating class member functions

2007-05-03 Thread Andy Terrel
Oh I should mention the decorator needs to have some notion of state (such as with the above class) -- http://mail.python.org/mailman/listinfo/python-list

How do I import a variable from another module?

2007-05-03 Thread noagbodjivictor
I have a variable names actions in a module named qt_actions.py Well this is what I get: >>> import qt_actions >>> qt_actions.actions Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'actions' -- http://mail.python.org/mailman/listinfo/py

Re: Firefighters at the site of WTC7 "Move away the building is going to blow up, get back the building is going to blow up."

2007-05-03 Thread The Great Attractor
On 3 May 2007 08:53:39 -0700, malibu <[EMAIL PROTECTED]> wrote: >On May 3, 12:18 am, Eric Gisse <[EMAIL PROTECTED]> wrote: >> On May 2, 10:14 pm, malibu <[EMAIL PROTECTED]> wrote: >> >> > On May 2, 9:46 pm, Eric Gisse <[EMAIL PROTECTED]> wrote: >> >> > > On May 2, 7:10 pm, Midex <[EMAIL PROTECTED]

Decorating class member functions

2007-05-03 Thread Andy Terrel
Okay does anyone know how to decorate class member functions? The following code gives me an error: Traceback (most recent call last): File "decorators2.py", line 33, in s.update() File "decorators2.py", line 13, in __call__ retval = self.fn.__call__(*args,**kws) TypeError: update()

Re: NewB: Glob Question

2007-05-03 Thread Steven D'Aprano
On Thu, 03 May 2007 10:38:31 -0700, J wrote: > Greetings Group- > > I'm trying to put together a pattern matching script that scans a > directory tree for tif images contained in similar folder names, but > running into a NewB problem already. Is it the way I'm trying to join > multiple paths? An

Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?

2007-05-03 Thread The Great Attractor
On Thu, 03 May 2007 13:53:39 +0100, Eeyore <[EMAIL PROTECTED]> wrote: > > >Peter Webb wrote: > >> > Ask yourself WHY havn't I seen this footage before? >> > >> > >> >> OK, why haven't you seen this footage before? > >Nice response ! > >Graham > You're an utter retard

Re: How do I output a list like the interpreter do?

2007-05-03 Thread noagbodjivictor
On May 3, 8:24 pm, [EMAIL PROTECTED] wrote: > On May 3, 8:01 pm, [EMAIL PROTECTED] wrote: > > > On May 3, 8:00 pm, [EMAIL PROTECTED] wrote: > > > > >>> s = ['a','b'] > > > >>> s > > > ['a', 'b'] > > > > This is what I want so that I can put it in a module then import that > > > module to work with

Replacement for HTMLGen?

2007-05-03 Thread Joshua J. Kugler
I realize that in today's MVC-everything world, the mere mention of generating HTML in the script is near heresy, but for now, it's what I ened to do. :) That said, can someone recommend a good replacement for HTMLGen? I've found good words about it (http://www.linuxjournal.com/article/2986), but

Re: How do I output a list like the interpreter do?

2007-05-03 Thread noagbodjivictor
On May 3, 8:01 pm, [EMAIL PROTECTED] wrote: > On May 3, 8:00 pm, [EMAIL PROTECTED] wrote: > > > >>> s = ['a','b'] > > >>> s > > ['a', 'b'] > > > This is what I want so that I can put it in a module then import that > > module to work with my variable. > > Sorry for that typo in the title... I foun

Re: How do I output a list like the interpreter do?

2007-05-03 Thread noagbodjivictor
On May 3, 8:00 pm, [EMAIL PROTECTED] wrote: > >>> s = ['a','b'] > >>> s > ['a', 'b'] > > This is what I want so that I can put it in a module then import that > module to work with my variable. Sorry for that typo in the title... -- http://mail.python.org/mailman/listinfo/python-list

How do I output a list like the interpreter do?

2007-05-03 Thread noagbodjivictor
>>> s = ['a','b'] >>> s ['a', 'b'] >>> This is what I want so that I can put it in a module then import that module to work with my variable. -- http://mail.python.org/mailman/listinfo/python-list

Re: 32 OS on 64-bit machine

2007-05-03 Thread Joshua J. Kugler
On Thursday 03 May 2007 01:10, SamG wrote: > If anyone has a x86_64 machine and is running a 32bit OS on top of > that could you tell me what output would you get for the following > program > > #== > import platform > print platform.processor() > print platform.architectu

Re: When does input() return an empty string?

2007-05-03 Thread noagbodjivictor
On May 3, 7:50 pm, André <[EMAIL PROTECTED]> wrote: > On May 3, 8:43 pm, [EMAIL PROTECTED] wrote: > > > I'm filling an array with user input, I want an empty string to be > > returned when nothing is entered; ie return key hit twice... How do I > > do that? > > use raw_input(), not input(). input(

Re: When does input() return an empty string?

2007-05-03 Thread André
On May 3, 8:43 pm, [EMAIL PROTECTED] wrote: > I'm filling an array with user input, I want an empty string to be > returned when nothing is entered; ie return key hit twice... How do I > do that? use raw_input(), not input(). input() attempts to evaluate the result, assuming it is a valid python

When does input() return an empty string?

2007-05-03 Thread noagbodjivictor
I'm filling an array with user input, I want an empty string to be returned when nothing is entered; ie return key hit twice... How do I do that? -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I get type methods?

2007-05-03 Thread Stargaming
[EMAIL PROTECTED] schrieb: > Hello! > > If I do > > import uno > localContext=uno.getComponentContext() > > then localContext is of type > I guess it's a new type provided by PyUNO extension. > localContext.__class__ is None > Is there any way to list all methods of that new type, via Python C

Re: getmtime in 2.5 reports GMT instead of local time

2007-05-03 Thread John Machin
On May 4, 12:26 am, Josef Dalcolmo <[EMAIL PROTECTED]> wrote: > Hello, > > I have tried this only on Windows XP. > > in Python 2.4 os.path.getmtime() used to return an integer representing > the local time. The docs say "seconds since the epoch". Noting that the epoch is usually defined with refer

Re: adding methods at runtime and lambda

2007-05-03 Thread ici
On May 3, 10:52 pm, Mike <[EMAIL PROTECTED]> wrote: > I was messing around with adding methods to a class instance at > runtime and saw the usual code one finds online for this. All the > examples I saw say, of course, to make sure that for your method that > you have 'self' as the first parameter.

Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?

2007-05-03 Thread quasi
On Fri, 04 May 2007 09:37:37 +1200, Gib Bogle <[EMAIL PROTECTED]> wrote: >Ah, so the firefighters were in on the conspiracy! No, but the firefighters are very much aware that there is more to 9/11 than has been officially revealed. This is even more true at Pentagon. The firefighters there broug

Re: _csv.Error: string with NUL bytes

2007-05-03 Thread John Machin
On May 4, 3:40 am, [EMAIL PROTECTED] wrote: > On Thu, May 03, 2007 at 10:28:34AM -0700, [EMAIL PROTECTED] wrote: > > On May 3, 10:12 am, [EMAIL PROTECTED] wrote: > > > On Thu, May 03, 2007 at 09:57:38AM -0700, fscked wrote: > > > > > As Larry said, this most likely means there are null bytes in the

Re: My Python annoyances

2007-05-03 Thread John Nagle
Terry Reedy wrote: > "John Nagle" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | Ben Collver wrote: > || > from the person who closed it. I get the unspoken message: bug > reports > | > are not welcome. > > | Getting through the process requires a year or so. > > Ben got a

Re: hp 11.11 64 bit python 2.5 build gets error "import site failed"

2007-05-03 Thread Martin v. Löwis
>>> "import site failed" >>> OverflowError: signed integer is greater than the maximum. >> - what is the value of ival? > ival: 4294967295 I see. This is 0x, which would be -1 if it were of type int. So perhaps some value got cast incorrectly at some point, breaking subsequent computation

Re: hp 11.11 64 bit python 2.5 build gets error "import site failed"

2007-05-03 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > I am on a hp 11.11 machine doing a 64 bit python 2.5 build. When I get > my python executable created and run it, I get the error: > > "import site failed" > OverflowError: signed integer is greater than the maximum. Are you sure about the error message? That error is

Re: cannot import name .....

2007-05-03 Thread Matimus
I do see one problem there... if __name__ == 'main': t = nBaseTest('nBaseTest') t.logon() That should be: if __name__ == "__main__": t = nBaseTest('nBaseTest') t.logon() It should be like that in both files. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to replace the last (and only last) character in a string?

2007-05-03 Thread Steven Howe
Dave Borne wrote: Let's suppose s='12345 4343 454' How can I replace the last '4' character? If the last '4' will not always be the last character in the string, you could do: 'X'.join(s.rsplit('4',1)) from string import rfind def replaceLast_X_with_Y( s, x, y ): lastX =

Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?

2007-05-03 Thread Gib Bogle
Ah, so the firefighters were in on the conspiracy! -- http://mail.python.org/mailman/listinfo/python-list

Re: 32 OS on 64-bit machine

2007-05-03 Thread king kikapu
At Amd Turion 64, it gives: ('32bit', 'ELF') -- http://mail.python.org/mailman/listinfo/python-list

Re: How to replace the last (and only last) character in a string?

2007-05-03 Thread kyosohma
On May 3, 9:44 am, Johny <[EMAIL PROTECTED]> wrote: > On May 3, 4:37 pm, [EMAIL PROTECTED] wrote: > > > > > On May 3, 9:27 am, Johny <[EMAIL PROTECTED]> wrote: > > > > Let's suppose > > > s='12345 4343 454' > > > How can I replace the last '4' character? > > > I tried > > > string.replace(s,s[len(s

PyGTK and Window Size

2007-05-03 Thread Flavio Preto
Hi, Currently i am developing a python script that will be executed in Gnome. This script uses the PyGTK library, however i have a question: How can I make my application to remember the last window size when it was closed? This behavior is natural for the majority of Gnome applications (i think)

Re: My Python annoyances

2007-05-03 Thread Thorsten Kampe
* Paul Boddie (3 May 2007 07:27:11 -0700) > On 3 Mai, 15:49, Ben Collver <[EMAIL PROTECTED]> wrote: > > I installed Cygwin on a Windows machine. I try to quit from an > > interactive Python session. It tells me that on my platform, I must > > press Control-Z to exit. I press Control-Z and it mak

Re: My Python annoyances

2007-05-03 Thread Terry Reedy
"Ben Collver" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I rewrote my code in Python and I found myself running into many of the | same hassles that I run into with other languages: inaccurate and | incomplete documentation, a maze of little platform-specific quirks to | work ar

Re: My Python annoyances

2007-05-03 Thread Terry Reedy
"John Nagle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Ben Collver wrote: || > from the person who closed it. I get the unspoken message: bug reports | > are not welcome. | | That's the problem with bug reporting systems which let developers | close bugs arbitrarily. I

Re: Real Time Battle and Python

2007-05-03 Thread Matimus
On May 3, 5:20 am, hg <[EMAIL PROTECTED]> wrote: > Hi, > > I have started to work on a python-based robot, and am interested in your > feedback: > > http://realtimebattle.sourceforge.net/www.snakecard.com/rtb > > hg This is not necessarily a response to your effort, but just a note (rant) about re

Re: How to check if a string is empty in python?

2007-05-03 Thread [EMAIL PROTECTED]
On May 3, 2:03 pm, John Salerno <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On May 2, 3:49 pm, Basilisk96 <[EMAIL PROTECTED]> wrote: > >> A simple > > >> if s: > >> print "not empty" > >> else: > >> print "empty" > > >> will do. > > > How do you know that s is a string? > > Se

Re: How to replace the last (and only last) character in a string?

2007-05-03 Thread Dave Borne
> Let's suppose > s='12345 4343 454' > How can I replace the last '4' character? If the last '4' will not always be the last character in the string, you could do: 'X'.join(s.rsplit('4',1)) -Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: Using python with MySQL

2007-05-03 Thread hlubenow
hlubenow wrote: > There's even another approach: ... On the other hand you may be better off with the "mysql-python"-module. Anyway, here's a nice overview over the most commonly used MySQL-commands (The commands should speak for themselves, even if the explanations are in German): http://www.l

Re: adding methods at runtime and lambda

2007-05-03 Thread James Stroud
Mike wrote: > I was messing around with adding methods to a class instance at > runtime and saw the usual code one finds online for this. All the > examples I saw say, of course, to make sure that for your method that > you have 'self' as the first parameter. I got to thinking and thought > "I have

Re: adding methods at runtime and lambda

2007-05-03 Thread Mike
In the above example 'addm' should be 'AddMethod' superdict = AddMethod(dict(), lambda self, d: myUtils.HasDrive(d),"hasdrive") -- http://mail.python.org/mailman/listinfo/python-list

Re: Using python with MySQL

2007-05-03 Thread hlubenow
HMS Surprise wrote: > Greetings, > > I need to peform some simple queries via MySQL. Searching the list I > see that folks are accessing it with python. I am very new to python > and pretty new to MySQL too. Would appreciate it if you could point me > to some documentation for accessing MySQL via

Re: Article on wxPython ToolKit for Mac OS X

2007-05-03 Thread James Stroud
James Stroud wrote: > miah_gbg wrote: > >> Hi there! >> >> Just wanted to let people know in this group that I have recently >> (April 24th) published an introductory article on wxPython and Mac OS >> X. It is available here: http://www.macdevcenter.com/ >> >> Hope someone finds it useful. >> >> R

adding methods at runtime and lambda

2007-05-03 Thread Mike
I was messing around with adding methods to a class instance at runtime and saw the usual code one finds online for this. All the examples I saw say, of course, to make sure that for your method that you have 'self' as the first parameter. I got to thinking and thought "I have a lot of arbitrary me

Re: Article on wxPython ToolKit for Mac OS X

2007-05-03 Thread James Stroud
miah_gbg wrote: > Hi there! > > Just wanted to let people know in this group that I have recently > (April 24th) published an introductory article on wxPython and Mac OS > X. It is available here: http://www.macdevcenter.com/ > > Hope someone finds it useful. > > Regards, > > Jeremiah > N

Re: Why stay with lisp when there are python and perl?

2007-05-03 Thread Markus E Leypold
Xah Lee <[EMAIL PROTECTED]> writes: > (if there is some demand, i will add a concrept, little programing No. There ain't. - M -- http://mail.python.org/mailman/listinfo/python-list

Re: Article on wxPython ToolKit for Mac OS X

2007-05-03 Thread James Stroud
miah_gbg wrote: > Hi there! > > Just wanted to let people know in this group that I have recently > (April 24th) published an introductory article on wxPython and Mac OS > X. It is available here: http://www.macdevcenter.com/ > > Hope someone finds it useful. > > Regards, > > Jeremiah > F

How do I get type methods?

2007-05-03 Thread yavannadil
Hello! If I do import uno localContext=uno.getComponentContext() then localContext is of type I guess it's a new type provided by PyUNO extension. localContext.__class__ is None Is there any way to list all methods of that new type, via Python C API or through interpreter (other then dir(localC

Real Time Battle and Python

2007-05-03 Thread hg
Hi, I have started to work on a python-based robot, and am interested in your feedback: http://realtimebattle.sourceforge.net/ www.snakecard.com/rtb hg -- http://mail.python.org/mailman/listinfo/python-list

Re: Why stay with lisp when there are python and perl?

2007-05-03 Thread Xah Lee
Nameless wrote: « Python has readable syntax, a huge library, and bindings for what seems like every major in linux. Perl has CPAN. It seems with those languages if you want to do something all you have to do is import functionality from a library someone had written and use that. In lisp you'd ha

Re: How to check if a string is empty in python?

2007-05-03 Thread John Salerno
[EMAIL PROTECTED] wrote: > On May 2, 3:49 pm, Basilisk96 <[EMAIL PROTECTED]> wrote: >> A simple >> >> if s: >> print "not empty" >> else: >> print "empty" >> >> will do. > > How do you know that s is a string? Seems like a fair assumption given the OP's question and example. -- http://ma

Re: _csv.Error: string with NUL bytes

2007-05-03 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I'm guessing that your file is in UTF-16, then -- Windows seems to do > that a lot. It kind of makes it *not* a CSV file, but oh well. Try > > print open("test.csv").decode('utf-16').read().replace("\0", > ">>>NUL<<<") > > I'm not terribly unicode-savvy, so I'll

Re: problem with py2exe and microsoft speech SDK 5.1

2007-05-03 Thread kyosohma
On May 3, 1:29 pm, Dave Lim <[EMAIL PROTECTED]> wrote: > Hello, this is my first time in the mailing list so > bear with me. > > Basically what I did was I followed this > site:http://surguy.net/articles/speechrecognition.xml > > So I installed microsoft speech SDK 5.1 and then used > pythonwin CO

Re: My Python annoyances

2007-05-03 Thread John Salerno
André wrote: > Fortunately, Python has incorporated some newbie-unfriendly features, > like metaclasses and, to a lesser extent, decorators which, at last, > make use of a special character. There should be more of these, to > make Python something more challenging to learn. After reading the en

Re: Slicing Arrays in this way

2007-05-03 Thread Tobiah
John Machin wrote: > On May 3, 8:55 am, Steven D'Aprano > <[EMAIL PROTECTED]> wrote: >> On Wed, 02 May 2007 15:03:24 -0700, Tobiah wrote: >> >>> >>> elegant_solution([1,2,3,4,5,6,7,8,9,10]) >>> [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]] >> Wow! That's impressive. What version of Python are you usin

  1   2   3   >