Re: Bypassing __getattribute__ for attribute access

2007-10-25 Thread Bruno Desthuilliers
Chris Mellon a écrit : > On Thu, 2007-10-25 at 23:13 +0200, Bruno Desthuilliers wrote: > >> Dynamically adding methods to classes is pretty >> straightforward, the tricky point is to dynamically add methods to >> instances, since the descriptor protocol is only triggered for class >> attribu

Re: threading problem..

2007-10-25 Thread John Nagle
Tried that on Python 2.5 on Windows and it worked. John Nagle Abandoned wrote: > Hi.. > I want to threading but i have a interesting error.. > == > class SelectAll(threading.Thread): >def __init__(self, name): > threading.Thread.__init

sqlite to .el translator [2 of 2]

2007-10-25 Thread smitty1e
Since I haven't yet been shot for the earlier post of a .py to sqlite rendering script, here is another script that takes the previous output and does something useful. Note that this is not the full integration with PyMacs--I rather hope to spark some interest and save some time headbanging on a)

JOIN WWW.A2ZLEARING.ORG AND GET FREE STUFF

2007-10-25 Thread RATISH KAKKAD
Register with a2zlearning and get: * More than 1000 electronic book * Lecture notes for Arts, Commerce, Science, Management * Multiple Choice Questions for Competitive Exams * Case Studies for Management Aspirants * Slide Shows on various subjects * Kids Games, Software, Co

.py to sqlite translator [1 of 2]

2007-10-25 Thread smitty1e
Disclaimer(s): the author is nobody's pythonista. This could probably be done more elegantly. The driver for the effort is to get PyMacs to work with new-style classes. This rendering stage stands alone, and might be used for other purposes. A subsequent post will show using the resulting file to

How to create a PUG mailing list?

2007-10-25 Thread Kevin D. Smith
I'm trying to get a Python User Group started in Norman, OK and I want to get one of those fancy mailing lists on mail.python.org. There is a link there to create a new list if you have the proper authority. How does someone get the proper authority? -- Kevin D. Smith -- http://mail.python

OT Re: Parallel insert to postgresql with thread

2007-10-25 Thread Erik Jones
If you're not Scott Daniels, beware that this conversation has gone horribly off topic and, unless you have an interest in PostreSQL, you may not want to bother reading on... On Oct 25, 2007, at 9:46 PM, Scott David Daniels wrote: > Erik Jones wrote: >> >> On Oct 25, 2007, at 7:28 AM, Scott D

Re: Parallel insert to postgresql with thread

2007-10-25 Thread Scott David Daniels
Erik Jones wrote: > > On Oct 25, 2007, at 7:28 AM, Scott David Daniels wrote: >> Diez B. Roggisch wrote: >>> Abandoned wrote: Hi.. I use the threading module for the fast operation. But >> [in each thread] def save(a,b,c): cursor.execute("INSERT INTO ...

Re: Dual Python Installed Environments..

2007-10-25 Thread algotother
Gaia dhuit, On Oct 25, 10:45 pm, "sam" <[EMAIL PROTECTED]> dropped 2 cents into the slot and wrote: > Hi.. Well, hello > > I'm looking to install dual versions of python 2.3, 2.4 on the same box. I'm > trying to figure out if there's something I'm missing, some kind of gotchas > that I haven't s

[python-list] Problem with SQLObject

2007-10-25 Thread Guillermo Heizenreder
I'm creating one aplicattion and I use SQLObject, but I have a little problem, when I try to create one table my aplicattion crash! :( Let me show you: [EMAIL PROTECTED]:~/Proyectos/ghhp/lib$ python Python 2.4.4 (#2, Apr 5 2007, 20:11:18) [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on lin

Re: Dual Python Installed Environments..

2007-10-25 Thread Yu-Xi Lim
sam wrote: > Hey Diez... > > So you're saying it's as simple as creating an env var, and setting it to > the python version... > > ok.. (and yeah, we're talking fedora) > No, env doesn't create an environment variable. It creates a modified environment. The goal here is to have the proper PATH

Re: An efficient, pythonic way to calculate result sets

2007-10-25 Thread Raymond Hettinger
> Easy exercise of transforming recursion to iteration left to the > reader. Ack! That part was already done. Raymond -- http://mail.python.org/mailman/listinfo/python-list

Re: An efficient, pythonic way to calculate result sets

2007-10-25 Thread Raymond Hettinger
On Oct 25, 8:31 am, [EMAIL PROTECTED] wrote: > I've got a little issue, both programming and performance-wise. I have > a set, containing objects that refer to other sets. For example, in a > simple notation: (, ) (or in a more object-like > display: set(obj1.choices=set(a, b, c) ). There may be ob

Re: Delete all not allowed characters..

2007-10-25 Thread Zentrader
> And my problem this function replace the character to "" but i > want to " " > for example: > input: Exam%^^ple > output: Exam ple > I want to this output but in my code output "Example" I don't think anyone has addressed this yet. It would be if chr found_in_allowed_set: output_string

urllib2 weirdness when https_proxy environment variable is exported

2007-10-25 Thread Devraj
Hi Everyone, I have been extensively using Python's urllib2 while developing a project with the Google Data API. The Google Data API uses httplib to place all of its requests. However I have been using urllib2 and some handlers that I discovered in an ASPN article to handle HTTPS proxies in my cod

Re: stderr is a lame hack?

2007-10-25 Thread Aahz
In article <[EMAIL PROTECTED]>, Erik Jones <[EMAIL PROTECTED]> wrote: > >So, I was just taking a look at doctest.py and saw this: > >Then running the module as a script will cause the examples in the >docstrings to get executed and verified: > >python M.py > >This won't display any

Re: Delete all not allowed characters..

2007-10-25 Thread Paul Hankin
On Oct 26, 12:05 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Thu, 25 Oct 2007 23:23:37 +0200, Michal Bozon wrote: > >> Repeatedly adding strings together in this way is about the most > >> inefficient, slow way of building up a long string. (Although I'm sure > >> somebod

Re: Delete all not allowed characters..

2007-10-25 Thread Steven D'Aprano
On Thu, 25 Oct 2007 23:23:37 +0200, Michal Bozon wrote: >> Repeatedly adding strings together in this way is about the most >> inefficient, slow way of building up a long string. (Although I'm sure >> somebody can come up with a worse way if they try hard enough.) >> >> Even though recent version

Re: sys.path not properly initialized (was: PyImport_ImportModule/embedding: surprising behaviors)

2007-10-25 Thread Graham Dumpleton
On Oct 26, 6:53 am, David Abrahams <[EMAIL PROTECTED]> wrote: > > David Abrahams wrote: > >> I'm seeing highly surprising (and different!) behaviors of > >> PyImport_ImportModule on Linux and Windows when used in a program with > >> python embedding. > > >> On Linux, ... > > > > Unfortunately, not

Re: An efficient, pythonic way to calculate result sets

2007-10-25 Thread happyhondje
On Oct 25, 8:44 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Oct 25, 10:31 am, [EMAIL PROTECTED] wrote: > > > > > Hello everyone, > > > I've got a little issue, both programming and performance-wise. I have > > a set, containing objects that refer to other sets. For example, in a > > sim

Re: Delete all not allowed characters..

2007-10-25 Thread Zentrader
> allowed = > [u'+',u'0',u'1',u'2',u'3',u'4',u'5',u'6',u'7',u'8',u'9',u' ', u'Þ', > u'þ', u'Ö', u'ö', u'Ü', u'ü', u'Ç', u'ç', u'Ý', u'ý', u'Ð', u'ð', 'A', > 'C', 'B', 'E', 'D', 'G', 'F', 'I', 'H', 'K', 'J', 'M', 'L', 'O', 'N', > 'Q', 'P', 'S', 'R', 'U', 'T', 'W', 'V', 'Y', 'X', 'Z', 'a', 'c

RE: Dual Python Installed Environments..

2007-10-25 Thread sam
Hey Diez... So you're saying it's as simple as creating an env var, and setting it to the python version... ok.. (and yeah, we're talking fedora) Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Diez B. Roggisch Sent: Thursday, October 25, 2007 2:48

Read Matlab files with Python and Numeric?

2007-10-25 Thread QAM
Hi Travis, Could you please send me the matlab reader you mentioned? Thanks, Frank -- http://mail.python.org/mailman/listinfo/python-list

Re: Dual Python Installed Environments..

2007-10-25 Thread Diez B. Roggisch
sam schrieb: > Hi.. > > I'm looking to install dual versions of python 2.3, 2.4 on the same box. I'm > trying to figure out if there's something I'm missing, some kind of gotchas > that I haven't seen. THey shouldn't affect each other. > I'm also trying to figure out how to allow my script to de

Re: elementtree w/utf8

2007-10-25 Thread Diez B. Roggisch
Tim Arnold schrieb: > Hi, I'm getting the by-now-familiar error: > return codecs.charmap_decode(input,errors,decoding_map) > UnicodeEncodeError: 'ascii' codec can't encode character u'\xa9' in position > 4615: ordinal not in range(128) > > the html file I'm working with is in utf-8, I open it wit

Re: threading problem..

2007-10-25 Thread Diez B. Roggisch
Abandoned schrieb: > Hi.. > I want to threading but i have a interesting error.. > == > class SelectAll(threading.Thread): >def __init__(self, name): > threading.Thread.__init__(self) > self.name = name #kelime > >def run(self): > > > self.result=.

Re: elementtree w/utf8

2007-10-25 Thread Marc 'BlackJack' Rintsch
On Thu, 25 Oct 2007 17:15:36 -0400, Tim Arnold wrote: > Hi, I'm getting the by-now-familiar error: > return codecs.charmap_decode(input,errors,decoding_map) > UnicodeEncodeError: 'ascii' codec can't encode character u'\xa9' in position > 4615: ordinal not in range(128) > > the html file I'm work

Re: Delete all not allowed characters..

2007-10-25 Thread Michal Bozon
> >> the list comprehension does not allow "else", but it can be used in a >> similar form: >> ( I was wrong, as Tim Chase have shown ) >> s2 = "" >> for ch in s1: >> s2 += ch if ch in allowed else " " >> >> (maybe this could be written more nicely) > > Repeatedly adding strings together

Dual Python Installed Environments..

2007-10-25 Thread sam
Hi.. I'm looking to install dual versions of python 2.3, 2.4 on the same box. I'm trying to figure out if there's something I'm missing, some kind of gotchas that I haven't seen. I'm also trying to figure out how to allow my script to determine which version to use??? Thanks -- http://mail.p

Re: Bypassing __getattribute__ for attribute access

2007-10-25 Thread Chris Mellon
On Thu, 2007-10-25 at 23:13 +0200, Bruno Desthuilliers wrote: > > The logical next question then is how does one best add a new method > > to this class so that future references to x.set_x() and X.set_x will > > properly resolve? It seems the answer would be to somehow add to > > X.__dict__ a

elementtree w/utf8

2007-10-25 Thread Tim Arnold
Hi, I'm getting the by-now-familiar error: return codecs.charmap_decode(input,errors,decoding_map) UnicodeEncodeError: 'ascii' codec can't encode character u'\xa9' in position 4615: ordinal not in range(128) the html file I'm working with is in utf-8, I open it with codecs, try to feed it to Tid

Re: "sem_post: Invalid argument"

2007-10-25 Thread robert
Jonathan Gardner wrote: > On Oct 25, 12:56 pm, robert <[EMAIL PROTECTED]> wrote: >> On a server the binary (red hat) installed python2.4 and also a >> fresh compiled python2.5 spits "sem_post: Invalid argument". >> What is this and how can this solved? >> ... >> Python 2.4.3 (#1, Jun 6 2006, 21:10

Re: Python and Combinatorics

2007-10-25 Thread Alan Isaac
none wrote: > Is there some package to calculate combinatorical stuff like (n over > k), i.e., n!/(k!(n - k!) ? Yes, in SciPy. Alan Isaac >>> from scipy.misc.common import comb >>> help(comb) Help on function comb in module scipy.misc.common: comb(N, k, exact=0) Combinations of N thin

Re: Bypassing __getattribute__ for attribute access

2007-10-25 Thread Bruno Desthuilliers
Adam Donahue a écrit : > Bruno, > > I appreciate your attempt to answer my questions below, although I > think my main point was lost amongst all your commentary and > assumptions. :^) Possibly. I sometimes tend to get a bit verbose !-) > I'm not inexperienced, Obviously not. > but I tak

Re: Python Windows Installation

2007-10-25 Thread Wildemar Wildenburger
Bjoern Schliessmann wrote: > Dennis Lee Bieber wrote: >> Besides preferring an install path that doesn't have spaces... > > Which I don't understand (works best for me, and is best practice in > Windows). > Best practice? Says who? /W -- http://mail.python.org/mailman/listinfo/python-list

threading problem..

2007-10-25 Thread Abandoned
Hi.. I want to threading but i have a interesting error.. == class SelectAll(threading.Thread): def __init__(self, name): threading.Thread.__init__(self) self.name = name #kelime def run(self): self.result=... nglist=[] current = SelectAll(name) ngli

[Windows embedding] sys.path not properly initialized (was: PyImport_ImportModule/embedding: surprising behaviors)

2007-10-25 Thread David Abrahams
on Sat Mar 24 2007, "Ziga Seilnacht" wrote: > David Abrahams wrote: >> I'm seeing highly surprising (and different!) behaviors of >> PyImport_ImportModule on Linux and Windows when used in a program with >> python embedding. >> >> On Linux, ... Unfortunately, nothing you have written below or

Re: Bypassing __getattribute__ for attribute access

2007-10-25 Thread Steven Bethard
Adam Donahue wrote: class X( object ): > ... def c( self ): pass > ... X.c > x = X() x.c > > > > If my interpretation is correct, the X.c's __getattribute__ call knows > the attribute reference is via a class, and thus returns an unbound > method (though it does convert th

Re: "sem_post: Invalid argument"

2007-10-25 Thread Jonathan Gardner
On Oct 25, 12:56 pm, robert <[EMAIL PROTECTED]> wrote: > On a server the binary (red hat) installed python2.4 and also a > fresh compiled python2.5 spits "sem_post: Invalid argument". > What is this and how can this solved? > ... > Python 2.4.3 (#1, Jun 6 2006, 21:10:41) > [GCC 3.2.3 20030502 (Red

"sem_post: Invalid argument"

2007-10-25 Thread robert
On a server the binary (red hat) installed python2.4 and also a fresh compiled python2.5 spits "sem_post: Invalid argument". What is this and how can this solved? Robert == server [~]# python2.4 sem_post: Invalid argument sem_post: Invalid argument sem_post: Invalid argument sem_pos

Re: print vs sys.stdout.write, and UnicodeError

2007-10-25 Thread Brent Lievers
Martin Marcher <[EMAIL PROTECTED]> wrote: > 25 Oct 2007 17:37:01 GMT, Brent Lievers <[EMAIL PROTECTED]>: >> Greetings, >> >> I have observed the following (python 2.5.1): >> >> >>> import sys >> >>> print sys.stdout.encoding >> UTF-8 >> >>> print(u'\u00e9') >> ? >> >>> sys.stdout.write(u'\u00e9\n')

Re: does PyAntlr come with Antlr download

2007-10-25 Thread matt wilkie
chewie54 wrote: > > I want use java2python which requires PyAntlr.I can't seem to find > PyAntlr mentioned on the main website for Antlr. > j2py requires antlr 2.7.7 This is what I did (for windows): - download and run 2.7.7 msi installer from http://www.antlr2.org/download.html, un-che

Re: Test for a unicode string

2007-10-25 Thread goldtech
snip... > > Like: > > if unicode string: > > print 'string's line #' > > else: > > process the string > If I use "re.UNICODE" like: m = re.match(r"\w+", s, re.UNICODE) then it seems to fix my problem. Trying to read as much as I can on unicode -- http://mail.python.org/ma

Re: print vs sys.stdout.write, and UnicodeError

2007-10-25 Thread Martin Marcher
25 Oct 2007 17:37:01 GMT, Brent Lievers <[EMAIL PROTECTED]>: > Greetings, > > I have observed the following (python 2.5.1): > > >>> import sys > >>> print sys.stdout.encoding > UTF-8 > >>> print(u'\u00e9') > é > >>> sys.stdout.write(u'\u00e9\n') > Traceback (most recent call last): > File "", lin

Re: Bypassing __getattribute__ for attribute access

2007-10-25 Thread Adam Donahue
Bruno, I appreciate your attempt to answer my questions below, although I think my main point was lost amongst all your commentary and assumptions. :^) I'm not inexperienced, but I take the blame for the rambling initial post, though, which probably lead to the confusion. So let me be more

Re: An efficient, pythonic way to calculate result sets

2007-10-25 Thread [EMAIL PROTECTED]
On Oct 25, 10:31 am, [EMAIL PROTECTED] wrote: > Hello everyone, > > I've got a little issue, both programming and performance-wise. I have > a set, containing objects that refer to other sets. For example, in a > simple notation: (, ) (or in a more object-like > display: set(obj1.choices=set(a, b,

RE: parsing the output from matlab

2007-10-25 Thread wang frank
Hi, Travis, Thanks very much for your help. Since each day, my mail box is flooded with python forum email. I simply overlooked your email, eventhough I am desperately waiting for the help. Today when I googled the topic and found your reply. I am sorry that I send a similar help request to

Re: Delete all not allowed characters..

2007-10-25 Thread Steven D'Aprano
On Thu, 25 Oct 2007 07:52:36 -0700, Abandoned wrote: > Hi.. > I want to delete all now allowed characters in my text. I use this > function: > > def clear(s1=""): > if s1: > allowed = > [u'+',u'0',u'1',u'2',u'3',u'4',u'5',u'6',u'7',u'8',u'9',u' ', u'Ş', > u'ş', u'Ö', u'ö', u'Ü', u'ü',

Re: Parallel insert to postgresql with thread

2007-10-25 Thread Erik Jones
On Oct 25, 2007, at 10:12 AM, Jean-Paul Calderone wrote: > On Thu, 25 Oct 2007 09:46:54 -0500, Erik Jones <[EMAIL PROTECTED]> > wrote: >> >> [snip] >> >> Fortunately, in his case, that's not necessarily true. If they do >> all their work with the same connection then, yes, but there are >> othe

Re: Delete all not allowed characters..

2007-10-25 Thread Steven D'Aprano
On Thu, 25 Oct 2007 17:42:36 +0200, Michal Bozon wrote: > the list comprehension does not allow "else", but it can be used in a > similar form: > > s2 = "" > for ch in s1: > s2 += ch if ch in allowed else " " > > (maybe this could be written more nicely) Repeatedly adding strings together i

print vs sys.stdout.write, and UnicodeError

2007-10-25 Thread Brent Lievers
Greetings, I have observed the following (python 2.5.1): >>> import sys >>> print sys.stdout.encoding UTF-8 >>> print(u'\u00e9') é >>> sys.stdout.write(u'\u00e9\n') Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in posi

Re: Python Windows Installation

2007-10-25 Thread kyosohma
On Oct 25, 12:36 pm, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > On Oct 24, 11:22 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > > > TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > > > >I am trying to install Python 2.5 on Windows XP. It installs into the > > >root directory on C:\ instead of C:\Py

Re: Python Windows Installation

2007-10-25 Thread TheFlyingDutchman
On Oct 24, 11:22 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > > >I am trying to install Python 2.5 on Windows XP. It installs into the > >root directory on C:\ instead of C:\Python25 which it shows by default > >as what it plans to install to. Selectin

Re: Python Windows Installation

2007-10-25 Thread Bjoern Schliessmann
Dennis Lee Bieber wrote: > Besides preferring an install path that doesn't have spaces... Which I don't understand (works best for me, and is best practice in Windows). > On a proper XP (or later) system, one needs ADMIN privileges to > install/modify the contents of %PROGRAMFILES%. Any user can

Re: building a linux executable

2007-10-25 Thread Bjoern Schliessmann
Paul Boddie wrote: > Any suggestions, then? ;-) Not really; I've got a vaguely similar problem myself -- several Debian systems with Python 2.4 and Python 2.5. But modules I need (wxWidgets 2.8 and Twisted) aren't available as Python 2.5 packages for Debian, so I'm stuck with 2.4. Packages from un

Re: python project ideas

2007-10-25 Thread Daniel Fetchinson
> hi to everyone > I wondered if this might be the right place to ask for some ideas for > python project for university. > I'd like it to be something useful and web-based. And the project must > be complete in 2-3 months by 2-3 person group. > May be something useful for open source or python com

Re: python project ideas

2007-10-25 Thread TeroV
Neil Wallace wrote: > On Thu, 25 Oct 2007 04:09:00 +, [EMAIL PROTECTED] wrote: > >> hi to everyone >> I wondered if this might be the right place to ask for some ideas for >> python project for university. >> I'd like it to be something useful and web-based. And the project must >> be complete

Re: Bypassing __getattribute__ for attribute access

2007-10-25 Thread Bruno Desthuilliers
Adam Donahue a écrit : > As an exercise I'm attempting to write a metaclass that causes an > exception to be thrown whenever a user tries to access > 'attributes' (in the traditional sense) via a direct reference. I guess you're new to Python, and coming from either C++ or Java. Am I wrong ?-) A

Re: local variable referenced before assignment

2007-10-25 Thread Pete Bartonly
Pete Bartonly wrote: > > Quick question, probably quite a simple matter. Take the follow start of > a method: > > > def review(filesNeedingReview): > > for item in filesNeedingReview: > (tightestOwner, logMsg) = item > > if (logMsg != None): > for logInfo in lo

Re: about functions question

2007-10-25 Thread Chris Mellon
On 10/25/07, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-10-25, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > > The canonical case for small scripts is to have first all > > functions and globals defined, then the main code protected by > > a guard, ie: > > There's no reason to "protect"

bug: subprocess.Popen() hangs

2007-10-25 Thread Jonathan Amsterdam
This is a bug in python 2.4 under Linux 2.6. I occasionally see subprocess.Popen() fail to return, and I have finally figured out roughly what's going on. It involves the GC and stderr. 1. os.fork() 2. Parent blocks reading from errpipe_read (subprocess.py:982) 3. In child, a GC occurs before t

Re: local variable referenced before assignment

2007-10-25 Thread Pete Bartonly
Peter Otten wrote: > Pete Bartonly wrote: > >> Quick question, probably quite a simple matter. Take the follow start of >> a method: >> >> >> def review(filesNeedingReview): >> >> for item in filesNeedingReview: >> (tightestOwner, logMsg) = item >> >> if (logMsg != None): >

Re: local variable referenced before assignment

2007-10-25 Thread Pete Bartonly
A.T.Hofkamp wrote: > On 2007-10-25, Pete Bartonly <[EMAIL PROTECTED]> wrote: >> Quick question, probably quite a simple matter. Take the follow start of >> a method: > With respect to compactness and style, you can move your multi-assignment > statement in the for loop, as in [snip] Btw, thanks

Re: local variable referenced before assignment

2007-10-25 Thread Pete Bartonly
A.T.Hofkamp wrote: > On 2007-10-25, Pete Bartonly <[EMAIL PROTECTED]> wrote: >> Quick question, probably quite a simple matter. Take the follow start of >> a method: >> >> >> def review(filesNeedingReview): >> >> for item in filesNeedingReview: >> (tightestOwner, logMsg) = item >> >>

Re: Delete all not allowed characters..

2007-10-25 Thread Tim Chase
> I want to delete all now allowed characters in my text. > I use this function: > > def clear(s1=""): > if s1: > allowed = > [u'+',u'0',u'1',u'2',u'3',u'4',u'5',u'6',u'7',u'8',u'9',u' ', u'Ş', > u'ş', u'Ö', u'ö', u'Ü', u'ü', u'Ç', u'ç', u'İ', u'ı', u'Ğ', u'ğ', 'A', > 'C', 'B', 'E', 'D

Re: Delete all not allowed characters..

2007-10-25 Thread Michal Bozon
On Thu, 25 Oct 2007 07:52:36 -0700, Abandoned wrote: > Hi.. > I want to delete all now allowed characters in my text. > I use this function: > > def clear(s1=""): > if s1: > allowed = > [u'+',u'0',u'1',u'2',u'3',u'4',u'5',u'6',u'7',u'8',u'9',u' ', u'Ş', > u'ş', u'Ö', u'ö', u'Ü', u'ü',

Re: New to Vim and Vim-Python

2007-10-25 Thread projecktzero
On Oct 24, 12:25 pm, Daniel Folkes <[EMAIL PROTECTED]> wrote: > I am new to using Vim's scripts. > > I was wondering if anyone uses Vim-Python and how to use it? This > includes things like key bindings and such. > > Thanks in advance, > Daniel Folkes > [EMAIL PROTECTED] I'm not exactly sure wha

Re: python project ideas

2007-10-25 Thread Massimo Di Pierro
Hi Menkaur, I work in a university as well. I am looking for some help in developing an apache graphical log analyzer using gluon http:// mdp.cti.depaul.edu/ I am about to release a pre-configured virtual appliance with it and a graphical log analyzer would be very handy. Massimo On Oct

Re: Delete all not allowed characters..

2007-10-25 Thread Adam Donahue
On Oct 25, 10:52 am, Abandoned <[EMAIL PROTECTED]> wrote: > Hi.. > I want to delete all now allowed characters in my text. > I use this function: > > def clear(s1=""): > if s1: > allowed = > [u'+',u'0',u'1',u'2',u'3',u'4',u'5',u'6',u'7',u'8',u'9',u' ', u'Þ', > u'þ', u'Ö', u'ö', u'Ü', u'

Re: [0..9] list (range) syntax

2007-10-25 Thread Wildemar Wildenburger
Michal Bozon wrote: > The .. syntax was not meant only as something > which would include the last item, > but also/rather a range list syntactic shortcut: > > [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] --> > [0, 1, ... 9, 10] --> > [0..10] > OK, I see. But I still fail to see where this is useful. All

An efficient, pythonic way to calculate result sets

2007-10-25 Thread happyhondje
Hello everyone, I've got a little issue, both programming and performance-wise. I have a set, containing objects that refer to other sets. For example, in a simple notation: (, ) (or in a more object-like display: set(obj1.choices=set(a, b, c) ). There may be obj1..objN objects in the outer set, a

Re: Parallel insert to postgresql with thread

2007-10-25 Thread Jean-Paul Calderone
On Thu, 25 Oct 2007 09:46:54 -0500, Erik Jones <[EMAIL PROTECTED]> wrote: > > [snip] > >Fortunately, in his case, that's not necessarily true. If they do >all their work with the same connection then, yes, but there are >other problems with that as mention wrt thread safety and psycopg2. >If he go

Re: python project ideas

2007-10-25 Thread Neil Wallace
On Thu, 25 Oct 2007 04:09:00 +, [EMAIL PROTECTED] wrote: > hi to everyone > I wondered if this might be the right place to ask for some ideas for > python project for university. > I'd like it to be something useful and web-based. And the project must > be complete in 2-3 months by 2-3 person

Bypassing __getattribute__ for attribute access

2007-10-25 Thread Adam Donahue
As an exercise I'm attempting to write a metaclass that causes an exception to be thrown whenever a user tries to access 'attributes' (in the traditional sense) via a direct reference. Consider: class X( object ): y = 'private value' def get_y( self ): return self.y Normally

Re: about functions question

2007-10-25 Thread Neil Cerutti
On 2007-10-25, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > The canonical case for small scripts is to have first all > functions and globals defined, then the main code protected by > a guard, ie: There's no reason to "protect" your main code in a small script. > if __name__ == '__main__': >

Re: Iteration for Factorials

2007-10-25 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > def factorial(i): > >fact=1.0 > >for n in xrange(i): > > fact=n*fact > >return fact > > Simple minded indeed. > > >>> factorial(3) > 0.0 > Whoops, should have xrange(i)+1 there. Or, better, xr

Delete all not allowed characters..

2007-10-25 Thread Abandoned
Hi.. I want to delete all now allowed characters in my text. I use this function: def clear(s1=""): if s1: allowed = [u'+',u'0',u'1',u'2',u'3',u'4',u'5',u'6',u'7',u'8',u'9',u' ', u'Ş', u'ş', u'Ö', u'ö', u'Ü', u'ü', u'Ç', u'ç', u'İ', u'ı', u'Ğ', u'ğ', 'A', 'C', 'B', 'E', 'D', 'G', 'F',

Re: Parallel insert to postgresql with thread

2007-10-25 Thread Erik Jones
On Oct 25, 2007, at 7:28 AM, Scott David Daniels wrote: > Diez B. Roggisch wrote: >> Abandoned wrote: >> >>> Hi.. >>> I use the threading module for the fast operation. But > [in each thread] >>> def save(a,b,c): >>> cursor.execute("INSERT INTO ... >>> conn.commit() >

Re: Regular Expression

2007-10-25 Thread patrick . waldo
Marc, thank you for the example it made me realize where I was getting things wrong. I didn't realize how specific I needed to be. Also http://weitz.de/regex-coach/ really helped me test things out on this one. I realized I had some more exceptions like C18H34O2.1/2Cu and I also realized I didn

Re: delineating by comma where commas inside quotation marks don't count

2007-10-25 Thread Travis Brady
On 10/24/07, Dan Bishop <[EMAIL PROTECTED]> wrote: > > On Oct 24, 8:56 pm, "Junior" <[EMAIL PROTECTED]> wrote: > > I want to open a text file for reading and delineate it by comma. I > also > > want any data > > surrounded by quotation marks that has a comma in it, not to count the > > commas insi

Re: Cross-platform GUI development

2007-10-25 Thread bramble
On Oct 25, 6:32 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On 10/24/07, bramble <[EMAIL PROTECTED]> wrote: > > > In the end, GTK+ is themable, and it's a free software project, so if > > the MS Windows port has warts, anyone can come along and polish it up > > for that platform. > > There's be

Re: about functions question

2007-10-25 Thread Bruno Desthuilliers
NoName a écrit : > sorry! Yes it's work. > What about 2 question? > Can i put function after main block? > > print qq() > > def qq(): > return 'hello' Where's your "main block" here ? > Traceback (most recent call last): > File "C:\Python25\projects\indexer\test.py", line 1, in > print

Help wanted for opensource project

2007-10-25 Thread news.interbusiness.it
I'm looking for Python programmers for an open source project: http://sourceforge.net/projects/spectrag/ SpectraG is a program to generate, edit and convert gradients. Formats: ggr, svg, ... Gradients are used in Inkscape, The Gimp, and are an essential tool for graphics. Current Gradient Edito

Re: How to best send email to a low volume list?

2007-10-25 Thread Benjamin M. A'Lee
On Thu, Oct 25, 2007 at 04:47:51AM -, Steven D'Aprano wrote: > On Wed, 24 Oct 2007 23:08:14 -0500, Shane Geiger wrote: > > > A mailing list manager is really overkill for what he is trying to do > > *IF* he is not maintaining a discussion list. > > It's not overkill at all. Mailman is easy to

Re: python project ideas

2007-10-25 Thread Hyuga
On Oct 25, 12:09 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > hi to everyone > I wondered if this might be the right place to ask for some ideas for > python project for university. > I'd like it to be something useful and web-based. And the project must > be complete in 2-3 months by 2-3 p

Re: local variable referenced before assignment

2007-10-25 Thread A.T.Hofkamp
On 2007-10-25, Tim Williams <[EMAIL PROTECTED]> wrote: > On 25/10/2007, A.T.Hofkamp <[EMAIL PROTECTED]> wrote: >> On 2007-10-25, Pete Bartonly <[EMAIL PROTECTED]> wrote: >> > >> Also, brackets around conditions (in the if) are not needed, and comparing >> against None is usually done with 'is' or '

Re: local variable referenced before assignment

2007-10-25 Thread Tim Williams
On 25/10/2007, A.T.Hofkamp <[EMAIL PROTECTED]> wrote: > On 2007-10-25, Pete Bartonly <[EMAIL PROTECTED]> wrote: > > > Also, brackets around conditions (in the if) are not needed, and comparing > against None is usually done with 'is' or 'is not' instead of '==' or '!='. > The result is then > > if

Re: New to Vim and Vim-Python

2007-10-25 Thread Paddy
On Oct 24, 7:25 pm, Daniel Folkes <[EMAIL PROTECTED]> wrote: > I am new to using Vim's scripts. > > I was wondering if anyone uses Vim-Python and how to use it? This > includes things like key bindings and such. > > Thanks in advance, > Daniel Folkes > [EMAIL PROTECTED] You asked at the right ti

Re: about functions question

2007-10-25 Thread Diez B. Roggisch
NoName wrote: > sorry! Yes it's work. > What about 2 question? > Can i put function after main block? > print qq() > > def qq(): > return 'hello' You can't call a thing before it is defined. > Traceback (most recent call last): > File "C:\Python25\projects\indexer\test.py", line 1, in >

Re: Parallel insert to postgresql with thread

2007-10-25 Thread Scott David Daniels
Diez B. Roggisch wrote: > Abandoned wrote: > >> Hi.. >> I use the threading module for the fast operation. But [in each thread] >> def save(a,b,c): >> cursor.execute("INSERT INTO ... >> conn.commit() >> cursor.execute(...) >> How can i insert data to postgr

Re: about functions question

2007-10-25 Thread NoName
sorry! Yes it's work. What about 2 question? Can i put function after main block? print qq() def qq(): return 'hello' Traceback (most recent call last): File "C:\Python25\projects\indexer\test.py", line 1, in print qq() NameError: name 'qq' is not defined Or onli possible: def main()

Re: Parallel insert to postgresql with thread

2007-10-25 Thread Jean-Paul Calderone
On Thu, 25 Oct 2007 04:00:44 -0700, Abandoned <[EMAIL PROTECTED]> wrote: >Hi.. >I use the threading module for the fast operation. For fast operation, avoid the threading module. Here's a code sample: conn = connect(...) cursor = conn.cursor() cursor.executemany("INSERT INTO keywords

Re: Parallel insert to postgresql with thread

2007-10-25 Thread Diez B. Roggisch
Abandoned wrote: > Hi.. > I use the threading module for the fast operation. But i have some > problems.. > This is my code sample: > = > conn = > psycopg2.connect(user='postgres',password='postgres',database='postgres') > cursor = conn.cursor() > class paralel(Thread): > def _

Parallel insert to postgresql with thread

2007-10-25 Thread Abandoned
Hi.. I use the threading module for the fast operation. But i have some problems.. This is my code sample: = conn = psycopg2.connect(user='postgres',password='postgres',database='postgres') cursor = conn.cursor() class paralel(Thread): def __init__ (self, veriler, sayii):

Re: Test for a unicode string

2007-10-25 Thread Thorsten Kampe
* goldtech (Wed, 24 Oct 2007 12:09:24 -0700) > I have a regular expression test in a script. When a unicode character > get tested in the regex it gives an error: As Martin pointed out: you are *not* using unicode... > Question: Is there a way to test a string for unicode chars (ie. test > if a

Re: Adding idle timeout capabilities to asyncore

2007-10-25 Thread Jean-Paul Calderone
On Thu, 25 Oct 2007 04:46:12 -, Josiah Carlson <[EMAIL PROTECTED]> wrote: > [snip] >But really, since I already wrote code that handles *all* of >the timeout handling with a *single* time.time() call, and that also >generally minimizes all explicit function calls, I'm not sure that >your testin

Re: Cross-platform GUI development

2007-10-25 Thread Chris Mellon
On 10/24/07, bramble <[EMAIL PROTECTED]> wrote: > On Oct 23, 2:59 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > On 10/23/07, maco <[EMAIL PROTECTED]> wrote: > > > > > > > On Oct 13, 12:34 am, Michael L Torrie <[EMAIL PROTECTED]> wrote: > > > > > > Qt doesn't look very native on my desktop. In

Re: python project ideas

2007-10-25 Thread Paddy
On Oct 25, 5:09 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > hi to everyone > I wondered if this might be the right place to ask for some ideas for > python project for university. > I'd like it to be something useful and web-based. And the project must > be complete in 2-3 months by 2-3 pe

Re: python project ideas

2007-10-25 Thread George Sakkis
On Oct 25, 6:12 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Template engines are amongst the things that seem easy enough to look at the > available software and say "bah, I'll write my own in a day", but are complex > enough to keep them growing over years until they become as huge and > inacc

Re: python project ideas

2007-10-25 Thread Stefan Behnel
Arnaud Delobelle wrote: > On Oct 25, 10:05 am, Stefan Behnel <[EMAIL PROTECTED]> > wrote: >> Evan Klitzke wrote: >>> but you could also write your own templating engine for this. >> No, please. > > I'm afraid it is the inalienable right of every python programmer to > write their own templating en

  1   2   >