Conditionally subclassing based on Import

2008-10-02 Thread David Pratt
Hi, just want to conditionally base a class on another if it can be imported, otherwise base it on object. Does the following look ok for this? try: import foo.bar except ImportError: MyBase = foo.bar.Baz else: MyBase = object class Something(MyBase): -- http://mail.python.or

Re: python-2.6

2008-10-02 Thread luca . ciciriello
Strange things happens. I've download the installer package for Mac of Python 2.6 and I've launched it. When finished, I've launched from a terminal the command "Python" and all worked fine The response was "Python 2.6 etc...". Now I've launched IDLE. Nothing. IDLE icon blinked a couple of time in

Re: questions from a lost sheep

2008-10-02 Thread Michele Simionato
On Oct 2, 11:08 pm, johannes raggam <[EMAIL PROTECTED]> wrote: > statically typed language: A language in which types are fixed at > compile time. Most statically typed languages enforce this by requiring > you to declare all variables with their datatypes before using them. > Java and C are static

Re: Python is slow?

2008-10-02 Thread greg
Steven D'Aprano wrote: We agree that the restriction is artificial, and I think irrational I think it's irrational for another reason, too -- it's actually vacuous. There's nothing to prevent you creating a set of patches that simply say "Delete all of the original source and replace it with t

Re: Event-driven framework (other than Twisted)?

2008-10-02 Thread James Mills
On 10/2/08, Phillip B Oldham <[EMAIL PROTECTED]> wrote: > On Oct 2, 1:28 am, "James Mills" <[EMAIL PROTECTED]> wrote: > > Phillip, I have been developing a rather unique > > event-driven and component architecture library > > for quite some time that is (not twisted). Actually > > it's nothing

Re: docs.python.org inaccessible

2008-10-02 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Terry Reedy wrote: > Seems to be working now, at least if you start at the top with > http://docs.python.org/ Yeah, I can get into it, thanks. Now to get used to the new layout... -- http://mail.python.org/mailman/listinfo/python-list

Re: Sample code required to validate a xml file against XSD

2008-10-02 Thread Frank Millman
On Oct 2, 3:32 pm, hrishy <[EMAIL PROTECTED]> wrote: > Hi > > Does anybody have a python xample program to validate a xml file against a > XSD. > > regards > Hrisy I have used minixsv successfully in a test environment - http://www.familieleuthe.de/MiniXsv.html Here is some sample code - #

Re: Python style: exceptions vs. sys.exit()

2008-10-02 Thread greg
Lawrence D'Oliveiro wrote: In message <[EMAIL PROTECTED]>, Steven D'Aprano wrote: > (2) Even when the source is available, it is sometimes a legal trap to > read it with respect to patents and copyright. That's not how patents work. I don't think that's how copyrights work either. As far as I

Re: problem with sockets code

2008-10-02 Thread James Mills
On Fri, Oct 3, 2008 at 2:13 AM, Daniel <[EMAIL PROTECTED]> wrote: > Hello, > > I can't seem to get my sockets code to work right. Here is what I > have inside my RequestHandler handle() function: > >total_data=[] > >data = True >logger_server.debug(self.__class__.__name__ +

Re: using SSh problem!

2008-10-02 Thread Larry Bates
sa6113 wrote: I want to connect form a windows machine to a Linux one using SSH (I use Paramiko) and simply copy a file to Linux machine. Would you please help me how should I start? Is there any useful code? I find that one of the easiest ways of doing this is to install Cygwin on the windows

Re: Fun with reverse sorts

2008-10-02 Thread David Di Biase
I did see that actually, I thought it was only applied to specifying default parameters and wasn't sure if it ALSO applied to putting it into a function. In a way however, I see what you're getting at - it's basically the same thing you're just specifying a default value the same way... Ok problem

Re: questions from a lost sheep

2008-10-02 Thread Larry Bates
johannes raggam wrote: On Thu, 2008-10-02 at 15:18 -0500, [EMAIL PROTECTED] wrote: Joe> I've started to think fondly of the rock-solid stability of Python, Joe> and have been wondering if perhaps aggressive unit testing could Joe> mitigate most of the problems of weak typing. Note: Pyt

Re: Fun with reverse sorts

2008-10-02 Thread Chris Rebert
On Thu, Oct 2, 2008 at 8:07 PM, David Di Biase <[EMAIL PROTECTED]> wrote: > Hi there, > > I'm sorting an expansive list descending according to a list of tuples. > Basically it has to sort the last value in the tuple (3) but if they are the > same then it should resort to using the second last valu

Re: How to send Data Transfer Objects across the network?

2008-10-02 Thread Larry Bates
Daniel wrote: Hello, I've been building a system that has need to send object data across the network. The approach I've taken has been to build Data Transfer Objects, which just contain the attributes of the objects, and to pickle them and send them over a socket connection. As I get deeper t

Re: del and sets proposal

2008-10-02 Thread Larry Bates
Chris Hebert wrote: On Thu, Oct 2, 2008 at 3:20 PM, Larry Bates <[EMAIL PROTECTED]> wrote: You can do the following: a = [1,2,3,4,5] del a[0] and a = {1:'1', 2: '2', 3: '3', 4:'4', 5:'5'} del a[1] why doesn't it work the same for sets (particularly since sets are based on a dictionary)? a =

Fun with reverse sorts

2008-10-02 Thread David Di Biase
Hi there, I'm sorting an expansive list descending according to a list of tuples. Basically it has to sort the last value in the tuple (3) but if they are the same then it should resort to using the second last value (2). Now according to my very limited testing I've somewhat figured out that this

Re: Python for the Playstation 3

2008-10-02 Thread Terry Reedy
Blubaugh, David A. wrote: I was wondering if there is still a community effort to develop Python for Linux distributions for the Sony Playstation 3?? I have found a few WebPages stating this effort to port Python in such a way to take advantage of the Cell architecture within the playstation?

Re: why? __builtins__ key added from eval

2008-10-02 Thread Terry Reedy
Lie Ryan wrote: On Tue, 30 Sep 2008 16:04:34 -0500, William Purcell wrote: You could remove the builtin if you don't think it is necessary for you. Or you could do "dictionary comprehension" that collects only names you require (actually use generator comprehension then do a dict() conversio

Re: python-2.6

2008-10-02 Thread Terry Reedy
[EMAIL PROTECTED] wrote: Hi all. I've installed on may MacOS X 10.4.11 (PPC) Python-2.5.2, numpy and scipy. Now I'm interested to insall Python-2.6. My question is: What will happen to may scientific modules if now I jump fro 2.5.2 to 2.6? I've to reinstall numpy and scipy? Keep your 2.5.2 ins

Re: docs.python.org inaccessible

2008-10-02 Thread Terry Reedy
Lawrence D'Oliveiro wrote: Been getting 403 errors all afternoon. At one time I used to assiduously download PDF files of all the documentation I wanted to refer to. These days I've grown accustomed to just having a bunch of Web browser windows semi-permanently open. Until a rude shock like this

Re: RELEASED Python 2.6 final

2008-10-02 Thread Terry Reedy
nneonneo wrote: Hmm, I was looking forward to trying this out, but the Windows installer link (http://www.python.org/ftp/python/2.6/python-2.6.msi) is presently broken (as is the link for the 64-bit Windows version). While I'm at it, I might also point out that http://www.python.org/download/wi

Re: Python arrays and sting formatting options

2008-10-02 Thread bearophileHUGS
Steven D'Aprano: > With Python 3.0, GvR had the > opportunity to strip Python of all the features that makes Python easy to > learn, and he didn't. Python still has features that are easy for > newbies, and features that are powerful for experienced coders, and that > friendliness for newbies isn't

Spawing a daemon from my app and closing only when the daemon is done its job

2008-10-02 Thread Ritesh Nadhani
Hello So I have a wxPython GUI app. I have two independent modules which are command line are more of a daemon app which does separate but related processing for the whole system. Now, I am able to spawn the daemons and even close it when my wxPython app closes. But what I want is that if the da

Pydev 1.3.22 Released

2008-10-02 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.3.22 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on its development: http://pydev.blogspot.com Release Highlights in Pydev Extensions: --

Python import path issue. Suggestions and ideas?

2008-10-02 Thread Ritesh Nadhani
Hello All So my sourcecode has the following structure: / - app.py - commonlib.py - app.cnf - module/ - module/submodule/ - module/submodule/app2.py Commonlib is generally used for one method: def GetConfValue(section, item): config = ConfigParser.ConfigParser() config.read( "app.cnf" )

Re: Advice for a replacement for plone.

2008-10-02 Thread Dmitry S. Makovey
disclaimer: I'm not affiliated with any company selling Plone services ;) I also have nothing against Django and such. Ken Seehart wrote: > I want a new python based CMS. ... One that won't keep me up all night > > > I've been fooling around with zope and plone, and I like plone for some

Re: windows help files ?

2008-10-02 Thread Martin v. Löwis
> 1. how can I launch the windows help file (CHM), from python with a > keyword as argument ? Run hh.exe. If you want it to navigate to specific page, also pass that page on the command line (finding out the exact syntax is left as an exercise) > 2. now when my program should also run under Linu

Re: call of duty 4 crack multiplayer

2008-10-02 Thread Heiko Kröner
-- http://mail.python.org/mailman/listinfo/python-list

Re: del and sets proposal

2008-10-02 Thread Marc 'BlackJack' Rintsch
On Thu, 02 Oct 2008 15:39:55 -0700, Chris Rebert wrote: > On Thu, Oct 2, 2008 at 3:20 PM, Larry Bates <[EMAIL PROTECTED]> > wrote: >> a = set([1,2,3,4,5]) >> del a[1] > > Sets don't support subscripting, so if you can't go 'a_set[something]', > why would you expect to be able to be able to 'del'

Re: del and sets proposal

2008-10-02 Thread bearophileHUGS
Chris Rebert: > No, sets are a datatype unto themselves. They are based on > dictionaries internally (at least in CPython), but that's an > implemention detail to be hidden, not emphasized. Later Hettinger has simplified their code, making them use less memory (and be a little faster too, I think)

Re: del and sets proposal

2008-10-02 Thread Marc 'BlackJack' Rintsch
On Thu, 02 Oct 2008 16:48:42 -0700, Jon Clements wrote: > It's also worth noting that removing an object from a container > (.remove) is different than proposing the object goes to GC (del...) ``del`` doesn't propose that the object goes to GC, at least not more then a `remove()` method does. J

Re: Python arrays and sting formatting options

2008-10-02 Thread Marc 'BlackJack' Rintsch
On Thu, 02 Oct 2008 14:51:29 +, Steven D'Aprano wrote: > On Wed, 01 Oct 2008 10:38:12 +, Marc 'BlackJack' Rintsch wrote: > >> Even if newbies don't understand all the details they should be >> introduced to ``with`` right away IMHO. Because if you explain all the >> details, even if they

Re: del and sets proposal

2008-10-02 Thread Jon Clements
On Oct 2, 11:20 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > You can do the following: > > a = [1,2,3,4,5] > del a[0] > > and > > a = {1:'1', 2: '2', 3: '3', 4:'4', 5:'5'} > del a[1] > > why doesn't it work the same for sets (particularly since sets are based on a > dictionary)? > > a = set([1,2,3,

Re: Stopping a Thread with Time Slicing

2008-10-02 Thread Todd Whiteman
Steve wrote: Hi All, I've been trying to come up with a good way to run a certain process at a timed interval (say every 5 mins) using the SLEEP command and a semaphore flag. The basic thread loop was always sitting in the sleep command and not able to be interrupted. When the time came to set t

Re: help using py2app

2008-10-02 Thread Carl
Joe Strout wrote: I'm trying to use py2app to convert the pySketch wxPython example into a stand-alone OS X app. I've found the documentation at , but it wasn't terribly enlightening for me. My setup.py looks like this: #!/usr/bin/env python """ setu

Re: Tuple parameter unpacking in 3.x

2008-10-02 Thread bearophileHUGS
Martin Geisler: > ci.addCallback(lambda (ai, bi): ai * bi) > or > map(lambda (i, s): (field(i + 1), s), enumerate(si)) > Rewriting these to > ci.addCallback(lambda abi: abi[0] * abi[1]) > and > map(lambda is: (field(is[0] + 1), is[1]), enumerate(si)) > makes the code much uglier! And slight

Stopping a Thread with Time Slicing

2008-10-02 Thread Steve
Hi All, I've been trying to come up with a good way to run a certain process at a timed interval (say every 5 mins) using the SLEEP command and a semaphore flag. The basic thread loop was always sitting in the sleep command and not able to be interrupted. When the time came to set the semaphore fl

help using py2app

2008-10-02 Thread Joe Strout
I'm trying to use py2app to convert the pySketch wxPython example into a stand-alone OS X app. I've found the documentation at , but it wasn't terribly enlightening for me. My setup.py looks like this: #!/usr/bin/env python """ setup.py - script fo

Re: Python 2.6, GUI not working on vista?

2008-10-02 Thread Mensanator
On Oct 2, 1:27 pm, process <[EMAIL PROTECTED]> wrote: > i just downloaded 2.6 and when running the gui nothing happens. I assume you mean IDLE won't run. > > anyone else with the same problem? Yes. Here's how I fixed it: First of all, there's a note on the Python page that says Vista Note Adm

Re: Suppressing Python wanings globally

2008-10-02 Thread Paul Moore
2008/10/2 Jean-Paul Calderone <[EMAIL PROTECTED]>: > On Thu, 2 Oct 2008 23:39:29 +0100, Paul Moore <[EMAIL PROTECTED]> wrote: >> >> How can I suppress a Python warning globally (i.e., for all instances >> of Python I run)? I have a test suite that runs Python via >> sys.executable, so the -W flag w

Re: Suppressing Python wanings globally

2008-10-02 Thread Jean-Paul Calderone
On Thu, 2 Oct 2008 23:39:29 +0100, Paul Moore <[EMAIL PROTECTED]> wrote: How can I suppress a Python warning globally (i.e., for all instances of Python I run)? I have a test suite that runs Python via sys.executable, so the -W flag won't work. A wrapper script doesn't work, as sys.executable doe

Re: del and sets proposal

2008-10-02 Thread Chris Rebert
On Thu, Oct 2, 2008 at 3:20 PM, Larry Bates <[EMAIL PROTECTED]> wrote: > You can do the following: > > a = [1,2,3,4,5] > del a[0] > > and > > a = {1:'1', 2: '2', 3: '3', 4:'4', 5:'5'} > del a[1] > > why doesn't it work the same for sets (particularly since sets are based on > a dictionary)? > > a =

Re: How to send Data Transfer Objects across the network?

2008-10-02 Thread Jean-Paul Calderone
On Thu, 2 Oct 2008 14:45:12 -0700 (PDT), Daniel <[EMAIL PROTECTED]> wrote: Hello, I've been building a system that has need to send object data across the network. The approach I've taken has been to build Data Transfer Objects, which just contain the attributes of the objects, and to pickle th

Suppressing Python wanings globally

2008-10-02 Thread Paul Moore
How can I suppress a Python warning globally (i.e., for all instances of Python I run)? I have a test suite that runs Python via sys.executable, so the -W flag won't work. A wrapper script doesn't work, as sys.executable doesn't point to that. And PYTHONSTARTUP is only for interactive use, so that'

Re: What is not objects in Python?

2008-10-02 Thread William McBrine
On Wed, 01 Oct 2008 17:56:34 +0200, Boris Borcic wrote: > 42, for instance. > > Proof : > > >>> 42 is not object > True > > QED >>> isinstance(42, object) True -- 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 -- pass it on -- http://mail.python.org/mailman/listinfo/python-list

del and sets proposal

2008-10-02 Thread Larry Bates
You can do the following: a = [1,2,3,4,5] del a[0] and a = {1:'1', 2: '2', 3: '3', 4:'4', 5:'5'} del a[1] why doesn't it work the same for sets (particularly since sets are based on a dictionary)? a = set([1,2,3,4,5]) del a[1] Yes I know that sets have a remove method (like lists), but sin

Re: Inheritance but only partly?

2008-10-02 Thread bearophileHUGS
Gary Herron: > You can also redefine the ones you don't want inherited: > class A: > def DontInheritMe(self, ...): >... > Class B(A): > def DontInheritMe(self, ...): >raise NotImplementedError // Or some such I have never used something like this, but the OP may use a maski

Re: How to send Data Transfer Objects across the network?

2008-10-02 Thread Bruno Desthuilliers
Daniel a écrit : Hello, I've been building a system that has need to send object data across the network. The approach I've taken has been to build Data Transfer Objects, which just contain the attributes of the objects, and to pickle them and send them over a socket connection. As I get deepe

Re: Regular expressions question

2008-10-02 Thread Vlastimil Brom
2008/10/2 aditya shukla <[EMAIL PROTECTED]> > Hello folks , > > I trying to match a pattern in a string , i am new in using re .This is > what is happening > > When i do this > > p = re.compile('(\[&&NHX:)') > >>> m = p.match("[&&NHX:C=0.195.0]") > >>> print m > <_sre.SRE_Match object at 0x013FE1E

How to send Data Transfer Objects across the network?

2008-10-02 Thread Daniel
Hello, I've been building a system that has need to send object data across the network. The approach I've taken has been to build Data Transfer Objects, which just contain the attributes of the objects, and to pickle them and send them over a socket connection. As I get deeper this is a bit pro

Tuple parameter unpacking in 3.x

2008-10-02 Thread Martin Geisler
Hi, I just tried running my code using "python2.6 -3" and got a bunch of SyntaxWarning: tuple parameter unpacking has been removed in 3.x warnings. I've read PEP-3113: http://www.python.org/dev/peps/pep-3113/ but I'm still baffled as to why you guys could remove such a wonderful feature?!

Re: javascript to python

2008-10-02 Thread Bruno Desthuilliers
lkcl a écrit : On Oct 2, 5:54 pm, Joe Hrbek <[EMAIL PROTECTED]> wrote: Could someone help me translate to something that would close to it in python? The anonymous functions are giving me problems. class dataListener: def __init__(self): data = "" def onStartRequest(self, req

Re: questions from a lost sheep

2008-10-02 Thread johannes raggam
On Thu, 2008-10-02 at 15:18 -0500, [EMAIL PROTECTED] wrote: > Joe> I've started to think fondly of the rock-solid stability of Python, > Joe> and have been wondering if perhaps aggressive unit testing could > Joe> mitigate most of the problems of weak typing. > > Note: Python is not weakl

2.6 multiprocessing and pdb

2008-10-02 Thread Aaron "Castironpi" Brady
Hi, I'm trying to step through a subprocess I launch with multiprocessing. Does anyone know what hack to add? The actual call comes in forking.Popen.__init__, Windows version, forking.py, line 222: hp, ht, pid, tid = _subprocess.CreateProcess( _python_exe, cmd, None,

Re: Professional quality scripts/code

2008-10-02 Thread Mike Driscoll
On Oct 2, 3:38 pm, robean <[EMAIL PROTECTED]> wrote: > I have been learning Python for the last 3 months or so and I have a > working (but somewhat patchy) sense of the the language. I've been > using a couple of the more popular Python books as well as online > resources. > > A question for experi

Python for the Playstation 3

2008-10-02 Thread Blubaugh, David A.
To All, I was wondering if there is still a community effort to develop Python for Linux distributions for the Sony Playstation 3?? I have found a few WebPages stating this effort to port Python in such a way to take advantage of the Cell architecture within the playstation? However, all of the

Re: Python equivalent of Perl e flag with regular expression

2008-10-02 Thread Mark Thomas
On Oct 2, 4:03 pm, [EMAIL PROTECTED] wrote: >     Jason> With Perl I might do something like this: >     Jason> $line =~ s/(select)/uc($1)/e; >     ... >     Jason> How would I do this with Python? > > I'm sure there are plenty of ways to skin this particular cat, but how is > 's/.../.../e' differe

Re: Inheritance but only partly?

2008-10-02 Thread Aaron "Castironpi" Brady
On Oct 2, 3:16 pm, process <[EMAIL PROTECTED]> wrote: > Let's say I have a class X which has 10 methods. > > I want class Y to inherit 5 of them. > > Can I do that? Can I do something along the lines of super(Y, exclude > method 3 4 7 9 10) ? That implies that the 5 you do include don't rely on or

Re: Professional quality scripts/code

2008-10-02 Thread Benjamin Kaplan
On Thu, Oct 2, 2008 at 4:38 PM, robean <[EMAIL PROTECTED]> wrote: > I have been learning Python for the last 3 months or so and I have a > working (but somewhat patchy) sense of the the language. I've been > using a couple of the more popular Python books as well as online > resources. > > A quest

Re: Inheritance but only partly?

2008-10-02 Thread Gary Herron
Gary Herron wrote: > process wrote: > >> Let's say I have a class X which has 10 methods. >> >> I want class Y to inherit 5 of them. >> >> Can I do that? Can I do something along the lines of super(Y, exclude >> method 3 4 7 9 10) ? >> >> -- >> http://mail.python.org/mailman/listinfo/python-list

self signing a py2exe windows executable

2008-10-02 Thread William Heath
Hi All, I thought I sent an email to the list regarding a need I have to self sign a py2exe windows executable. Does anyone know how to do that? -Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Inheritance but only partly?

2008-10-02 Thread Matimus
On Oct 2, 1:16 pm, process <[EMAIL PROTECTED]> wrote: > Let's say I have a class X which has 10 methods. > > I want class Y to inherit 5 of them. > > Can I do that? Can I do something along the lines of super(Y, exclude > method 3 4 7 9 10) ? I think the noral way of doing that is to split the ori

Professional quality scripts/code

2008-10-02 Thread robean
I have been learning Python for the last 3 months or so and I have a working (but somewhat patchy) sense of the the language. I've been using a couple of the more popular Python books as well as online resources. A question for experienced Python programmers: can you recommend resources where I ca

Regular expressions question

2008-10-02 Thread aditya shukla
Hello folks , I trying to match a pattern in a string , i am new in using re .This is what is happening When i do this p = re.compile('(\[&&NHX:)') >>> m = p.match("[&&NHX:C=0.195.0]") >>> print m <_sre.SRE_Match object at 0x013FE1E0> --- thus i am able to find the match but when i use the stri

Re: Inheritance but only partly?

2008-10-02 Thread Gary Herron
process wrote: > Let's say I have a class X which has 10 methods. > > I want class Y to inherit 5 of them. > > Can I do that? Can I do something along the lines of super(Y, exclude > method 3 4 7 9 10) ? > > -- > http://mail.python.org/mailman/listinfo/python-list > No. But why do yo care? Yo

Inheritance but only partly?

2008-10-02 Thread process
Let's say I have a class X which has 10 methods. I want class Y to inherit 5 of them. Can I do that? Can I do something along the lines of super(Y, exclude method 3 4 7 9 10) ? -- http://mail.python.org/mailman/listinfo/python-list

Re: questions from a lost sheep

2008-10-02 Thread skip
Joe> I've started to think fondly of the rock-solid stability of Python, Joe> and have been wondering if perhaps aggressive unit testing could Joe> mitigate most of the problems of weak typing. Note: Python is not weakly typed. It is dynamically typed. But, yes, there is no substit

Re: Regular expressions and Unicode

2008-10-02 Thread Peter Otten
Jeffrey Barish wrote: > I have a regular expression that I use to extract the surname: > > surname = r'(?u).+ (\w+)' > > However, when I apply it to this Unicode string, I get only the first 3 > letters of the surname: > > name = 'Anton\xc3\xadn Dvo\xc5\x99\xc3\xa1k' That's a byte string. You

Re: Regular expressions and Unicode

2008-10-02 Thread skip
Jeffrey> However, when I apply it to this Unicode string, I get only the Jeffrey> first 3 letters of the surname: Jeffrey> name = 'Anton\xc3\xadn Dvo\xc5\x99\xc3\xa1k' Maybe name = unicode('Anton\xc3\xadn Dvo\xc5\x99\xc3\xa1k', "utf-8") ? Yup, that works: >>> name = unico

Tkinter Entry blocked by tkFileDialog

2008-10-02 Thread Leonhard Vogt
Hello I have the following problem in Python 2.5 on Windows XP. On Ubuntu I do not see the problem. I have a Tkinter application as in the following example The entry-widget is somehow blocked (i cannot type characters into it) when I call askopenfilename before I create the widget. Calling asko

Re: Python equivalent of Perl e flag with regular expression

2008-10-02 Thread skip
Jason> With Perl I might do something like this: Jason> $line =~ s/(select)/uc($1)/e; ... Jason> How would I do this with Python? I'm sure there are plenty of ways to skin this particular cat, but how is 's/.../.../e' different from 's/.../.../'? (For those of us who are not Perl

Re: questions from a lost sheep

2008-10-02 Thread Chris Mellon
On Thu, Oct 2, 2008 at 2:22 PM, Joe Strout <[EMAIL PROTECTED]> wrote: > Hi all, > > I used to by a big Python fan, many years ago [1]. I stopped using it after > discovering REALbasic, because my main developmental need is to write > desktop applications that are as native as possible on each plat

tkinter textwidget problem

2008-10-02 Thread kib2
Hi, In a tkinter TextWidget I would like to retrieve the last typed word. I've tried this with the 'wordstart' Expression [From the effbot site, "wordstart" and "wordend" moves the index to the beginning (end) of the current word. Words are sequences of letters, digits, and underline, or singl

questions from a lost sheep

2008-10-02 Thread Joe Strout
Hi all, I used to by a big Python fan, many years ago [1]. I stopped using it after discovering REALbasic, because my main developmental need is to write desktop applications that are as native as possible on each platform, and because I really like a strongly-typed language with a good

Re: why? __builtins__ key added from eval

2008-10-02 Thread Lie Ryan
On Tue, 30 Sep 2008 16:04:34 -0500, William Purcell wrote: > I want to use eval to evaluate wx.TextCtrl inputs. How can I keep python > from adding the __builtins__ key to mydict when I use it with eval? > Other wise I have to __delitem__('__builtins__') everytime I use eval? > mydict = {'a'

Re: how to find the directory where python is installed ?

2008-10-02 Thread Stef Mientki
Timothy Grant wrote: On Thu, Oct 2, 2008 at 12:16 PM, Stef Mientki <[EMAIL PROTECTED]> wrote: hello, how can I determine the location of the Python installation under winXP / Linux, with a Python program ? thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Regular expressions and Unicode

2008-10-02 Thread Jeffrey Barish
I have a regular expression that I use to extract the surname: surname = r'(?u).+ (\w+)' However, when I apply it to this Unicode string, I get only the first 3 letters of the surname: name = 'Anton\xc3\xadn Dvo\xc5\x99\xc3\xa1k' surname_re = re.compile(surname) m = surname_re.search(name) m.gr

Re: how to find the directory where python is installed ?

2008-10-02 Thread Timothy Grant
On Thu, Oct 2, 2008 at 12:16 PM, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > how can I determine the location of the Python installation under winXP / > Linux, > with a Python program ? > > thanks, > Stef Mientki > > -- > http://mail.python.org/mailman/listinfo/python-list > This what you

Re: RELEASED Python 2.6 final

2008-10-02 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Oct 1, 2008, at 11:46 PM, Barry Warsaw wrote: On behalf of the Python development team and the Python community, I am happy to announce the release of Python 2.6 final. This is the production-ready version of the latest in the Python 2 series

how to find the directory where python is installed ?

2008-10-02 Thread Stef Mientki
hello, how can I determine the location of the Python installation under winXP / Linux, with a Python program ? thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Python equivalent of Perl e flag with regular expression

2008-10-02 Thread George Sakkis
On Oct 2, 1:06 pm, "Friedman, Jason" <[EMAIL PROTECTED]> wrote: > I have lines that look like this: > select column1, 'select' as type > from table > where column2 = 'foo' > > I want to return: > SELECT column1, 'select' AS type > FROM table > WHERE column2 = 'foo' > > This is SQL with the keywords

Re: Python 2.6, GUI not working on vista?

2008-10-02 Thread [EMAIL PROTECTED]
On Oct 2, 2:27 pm, process <[EMAIL PROTECTED]> wrote: > i just downloaded 2.6 and when running the gui nothing happens. > > anyone else with the same problem? I have no idea what "gui" you're referring to. However, when I try to run Python on vista, I get: The application has failed to start bec

Re: Python equivalent of Perl e flag with regular expression

2008-10-02 Thread Peter Otten
Friedman, Jason wrote: > I have lines that look like this: > select column1, 'select' as type > from table > where column2 = 'foo' > > I want to return: > SELECT column1, 'select' AS type > FROM table > WHERE column2 = 'foo' > > This is SQL with the keywords converted to uppercase. Note that th

Python 2.6, GUI not working on vista?

2008-10-02 Thread process
i just downloaded 2.6 and when running the gui nothing happens. anyone else with the same problem? -- http://mail.python.org/mailman/listinfo/python-list

Unpickling Exception-type objects

2008-10-02 Thread David McClosky
Hi everyone, I'm stumped over what is probably (hopefully?) a very simple problem. Suppose I have a class that multiply inherits from two classes, call them A and B. A inherits from a class that takes any number of arguments in __init__. B does not inherit from anything and requires one argument

Re: javascript to python

2008-10-02 Thread Bruno Desthuilliers
Joe Hrbek a écrit : Could someone help me translate to something that would close to it in python? The anonymous functions are giving me problems. var dataListener = { data : "", onStartRequest: function(request, context){}, onStopRequest: function(request, context, status

Re: windows help files ?

2008-10-02 Thread Lie Ryan
On Thu, 02 Oct 2008 17:13:50 +0200, Stef Mientki wrote: > Hello, > > I've 2 questions about python help files: Python help files or your program's help files? > 1. how can I launch the windows help file (CHM), from python with a > keyword as argument ? I'm not really sure, but isn't CHM obsol

Re: javascript to python

2008-10-02 Thread lkcl
On Oct 2, 5:54 pm, Joe Hrbek <[EMAIL PROTECTED]> wrote: > Could someone help me translate to something that would close to it in > python? The anonymous functions are giving me problems. class dataListener: def __init__(self): data = "" def onStartRequest(self, request, context)

Re: code critique requested - just 60 lines

2008-10-02 Thread Lie Ryan
On Thu, 02 Oct 2008 07:51:30 -0700, Terrence Brannon wrote: > Hi, I would like some feedback on how you would improve the following > program: > http://www.bitbucket.org/metaperl/ptc_math/src/21979c65074f/payout.py > > Basically, using non-strict dictionary keys can lead to bugs, so that > worrie

javascript to python

2008-10-02 Thread Joe Hrbek
Could someone help me translate to something that would close to it in python? The anonymous functions are giving me problems. var dataListener = { data : "", onStartRequest: function(request, context){}, onStopRequest: function(request, context, status){ instream.cl

Re: Database GUI generation from schema

2008-10-02 Thread Peter Decker
On Thu, Oct 2, 2008 at 11:24 AM, Eric Wertman <[EMAIL PROTECTED]> wrote: >> Perhaps are you talking about dabo ? >> http://www.dabodev.com > > Yes, that was it. Thanks! I was a little dissapointed to see that > the wikipedia entry for that software was deleted. Is dabo not widely > used? Depend

self signing a py2exe winxp executable with signtool

2008-10-02 Thread William Heath
Hi All, I am trying to figure out how to self sign a py2exe winxp executable with signtool. Anyone know? I saw this which looked kind of promising: http://markmail.org/message/zj5nzechzgmjuu7c#query:signtool%20python+page:1+mid:s4jrb2hter4zxvg3+state:results -Tim P.S. Python rocks! -- http:/

Python equivalent of Perl e flag with regular expression

2008-10-02 Thread Friedman, Jason
I have lines that look like this: select column1, 'select' as type from table where column2 = 'foo' I want to return: SELECT column1, 'select' AS type FROM table WHERE column2 = 'foo' This is SQL with the keywords converted to uppercase. Note that the second "select" string is not a keyword and

Re: IDLE doesn't run on OSX 10.3.9

2008-10-02 Thread thomascribbs
Looks like installing TclTkAqua-8.4.10.dmg fixed it...IDLE runs now! -Tom On Oct 1, 9:22 am, Kevin Walzer <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Just did a new install of Tcl/tk from activestate.com and IDLE still > > not working... > > > -Tom > > Did you install Tcl/Tk 8.5?

Re: index all instances by id - a memory leak?

2008-10-02 Thread Richard Levasseur
On Oct 1, 10:35 pm, Jason Scheirer <[EMAIL PROTECTED]> wrote: > On Oct 1, 10:01 pm, Dan Barbus <[EMAIL PROTECTED]> wrote: > > > On Oct 2, 7:54 am, Dan Barbus <[EMAIL PROTECTED]> wrote: > > > >     def getItemById(id): > > >         return _itemsById[id] > > > I just saw that this won't compile. Sti

Re: Re: pylab without X11

2008-10-02 Thread Willem-Jan Vriend
Thanks that worked ! I changed the backend to Agg. Allthough a problem there is that with the backend Agg you only can write the resulting image to a file or a file like object, it does not accept the (apache) request handler to write the file to. And I do not want to save the file to disk fir

Re: Database GUI generation from schema

2008-10-02 Thread Eric Wertman
> Perhaps are you talking about dabo ? > http://www.dabodev.com Yes, that was it. Thanks! I was a little dissapointed to see that the wikipedia entry for that software was deleted. Is dabo not widely used? -- http://mail.python.org/mailman/listinfo/python-list

Re: Sample code required to validate a xml file against XSD

2008-10-02 Thread Daniel
On Oct 2, 7:32 am, hrishy <[EMAIL PROTECTED]> wrote: > Hi > > Does anybody have a python xample program to validate a xml file against a > XSD. > > regards > Hrisy I just googled "python validate a xml file against XSD" and found this: http://mail.python.org/pipermail/xml-sig/2003-March/009244.h

Re: windows help files ?

2008-10-02 Thread Daniel
On Oct 2, 9:13 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > Hello, > > I've 2 questions about python help files: > > 1. how can I launch the windows help file (CHM), from python  with a > keyword as argument ? > > 2. now when my program should also run under Linux/Mac,  how should I > call the hel

problem with sockets code

2008-10-02 Thread Daniel
Hello, I can't seem to get my sockets code to work right. Here is what I have inside my RequestHandler handle() function: total_data=[] data = True logger_server.debug(self.__class__.__name__ + ' set data = True') while data: logger_server.debug(self.

  1   2   >