Learn about mod_wsgi at SyPy Meetup Thursday, 1 Nov 2007

2007-10-25 Thread Mark Rees
Hi everyone, For our November meeting, Google have kindly offered to host us again. Thursday, November 1, 2007 6:15-8:30PM Google Australia Level 18, Tower 1 Darling Park 201 Sussex St Sydney We will have one scheduled presentation: Graham Dumpleton will talk about mod_wsgi

Re: Python on Intel A110?

2007-10-25 Thread Tim Roberts
Bob Greschke [EMAIL PROTECTED] wrote: Will the stock Windows version of Python install on a Samsung Q1U-EL UMPC running Vista and with an Intel A110 processor? ANYTHING that runs Vista will run Python. I want to do some development and just happened to think about this. I don't know what

Re: Python Windows Installation

2007-10-25 Thread Tim Roberts
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. Selecting D:\Python25 on a previous iteration put the exe in D:\ and did not

Re: win32com.client documentation?

2007-10-25 Thread Tim Roberts
Colin J. Williams [EMAIL PROTECTED] wrote: Mark Morss wrote: I am a unix person, not new to Python, but new to Python programming on windows. Does anyone know where to find documentation on win32com.client? I have successfully installed this module and implemented some example code. But a

Re: win32com.client documentation?

2007-10-25 Thread Tim Roberts
Mark Morss [EMAIL PROTECTED] wrote: I want to be able to script the creation of Excel spreadsheets and Word documents, interract with Access data bases, and so forth. Empirically, the best way to do this (for me, at least) is to Google for examples. There are a few simple rules to learn on how

about functions question

2007-10-25 Thread NoName
I try it: def b(): ... a() ... def a(): ... b() ... b() it's not work. Is it possible pre-define function like in c++ or place functions code after main block? int a(); int b(); int main () { ... a(); ... } int a() { ... b(); ... } int b() { ... a(); ... } =) sorry for my

Regular Expression question

2007-10-25 Thread looping
Hi, It's not really a Python question but I'm sure someone could help me. When I use RE, I always have trouble with this kind of search: Ex. I've a text file: create or replace package XXX ... create or replace package body XXX ... now I want to search the position (line) of this two string.

Re: Mobile Startup looking for sharp coders

2007-10-25 Thread George Sakkis
On Oct 24, 2:42 pm, Vangati [EMAIL PROTECTED] wrote: Plusmo is Hiring! (snipped) Recruiting Agencies: Please do not send us unsolicited resumes. Plusmo does not consider resumes from any agencies. Lame company headhunters: Please do not send us unsolicited spamvertisments irrelevant to

Re: about functions question

2007-10-25 Thread Diez B. Roggisch
NoName schrieb: I try it: def b(): ... a() ... def a(): ... b() ... b() it's not work. It works. def a(): print a b() def b(): print b print a # not calling! b() But if you really call a in b, you create an endless loop. In all

Re: about functions question

2007-10-25 Thread George Sakkis
On Oct 25, 2:28 am, NoName [EMAIL PROTECTED] wrote: I try it: def b(): ... a() ... def a(): ... b() ... b() it's not work. It sure does. Please post full code and error message, something else is wrong, not the cyclic reference. George --

Re: Regular Expression question

2007-10-25 Thread Marc 'BlackJack' Rintsch
On Thu, 25 Oct 2007 06:34:03 +, looping wrote: Hi, It's not really a Python question but I'm sure someone could help me. When I use RE, I always have trouble with this kind of search: Ex. I've a text file: create or replace package XXX ... create or replace package body XXX

Re: about functions question

2007-10-25 Thread Marc 'BlackJack' Rintsch
On Thu, 25 Oct 2007 06:28:16 +, NoName wrote: I try it: def b(): ... a() ... def a(): ... b() ... b() it's not work. What do you mean by not working? At the time `b()` is called, both functions are defined so it should working. Or at least it's not the problem

Re: Regular Expression question

2007-10-25 Thread looping
On Oct 25, 8:49 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: needle = re.compile(r'create\s+or\s+replace\s+package(\s+body)?\s+', re.IGNORECASE) What I want here is a RE that return ONLY the line without the body keyword. Your RE return both. I know I could use it

Re: Regular Expression question

2007-10-25 Thread Peter Otten
looping wrote: On Oct 25, 8:49 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: needle = re.compile(r'create\s+or\s+replace\s+package(\s+body)?\s+', re.IGNORECASE) What I want here is a RE that return ONLY the line without the body keyword. Your RE return both.

Re: TeX pestilence (was Distributed RVS, Darcs, tech love)

2007-10-25 Thread Byung-Hee HWANG
On Thu, 2007-10-25 at 00:48 +0200, Wildemar Wildenburger wrote: Byung-Hee HWANG wrote: On Mon, 2007-10-22 at 12:19 -0400, Lew wrote: [something attackish] Well, you are making a personal attack, it's dangerous. I wish to see only discussions about TeX ;; On a python group?

Re: TeX pestilence (was Distributed RVS, Darcs, tech love)

2007-10-25 Thread Joachim Durchholz
Wildemar Wildenburger schrieb: Joachim Durchholz wrote: And yes, it sucks in major ways. Oh my God, I don't want to, but I just have to ask: Why? First of all, irregularities. http://en.wikipedia.org/wiki/TeX#The_typesetting_system: [...]almost all of TeX's syntactic properties can be changed

Solaris 64 bit compilation

2007-10-25 Thread Srigiri, Joel
Hi Holden, I am having problems compiling some custom apps. Can you send me the configure.in where you added the lines. Since then, I have hacked the configure.in and added the option --enable-solaris-64bit and regenerated the configure script. Now, good news, it all builds fine. Except I am

Re: python project ideas

2007-10-25 Thread clbr
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 person

Re: Regular Expression question

2007-10-25 Thread looping
On Oct 25, 9:25 am, Peter Otten [EMAIL PROTECTED] wrote: You want a negative lookahead assertion then: Now I feel dumb... I've seen the (?!...) dozen times in the doc but never figure out that it is what I'm looking for. So this one is the winner: s =

Re: python project ideas

2007-10-25 Thread Evan Klitzke
On 10/24/07, [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 person group.

local variable referenced before assignment

2007-10-25 Thread Pete Bartonly
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 logMsg.changed_paths: This generates the

Re: python project ideas

2007-10-25 Thread Stefan Behnel
Evan Klitzke wrote: but you could also write your own templating engine for this. No, please. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: python project ideas

2007-10-25 Thread Arnaud Delobelle
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 engine. After all, it takes less time to

Re: local variable referenced before assignment

2007-10-25 Thread A.T.Hofkamp
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 if (logMsg != None):

Re: local variable referenced before assignment

2007-10-25 Thread Peter Otten
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

Re: local variable referenced before assignment

2007-10-25 Thread Arnaud Delobelle
On Oct 25, 10:02 am, 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 if (logMsg != None):

Re: about functions question

2007-10-25 Thread Arnaud Delobelle
On Oct 25, 7:28 am, NoName [EMAIL PROTECTED] wrote: I try it: def b(): ... a() ... def a(): ... b() ... b() it's not work. Probably all those dots! Is it possible pre-define function like in c++ or place functions code after main block? Python binds names to objects

Re: about functions question

2007-10-25 Thread Arnaud Delobelle
On Oct 25, 10:30 am, Arnaud Delobelle [EMAIL PROTECTED] wrote: [...] look for the object currently bound to the name 'b' in the global dictionary, and execute the __call__ method of that object with no arguments This is what happens at runtime. Rereading, I thought I hadn't made it clear. --

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 engine. Oh,

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 inaccessible

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 person

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 fact, Qt apps have always

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 testing

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

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: 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 __init__

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: 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 module print qq() NameError: name 'qq' is not defined Or onli possible: def

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 postgresql the same

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 module

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 time :-)

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 logMsg is

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 'is not' instead

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 person

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: 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 module print qq()

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

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 been plenty to

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 inside the

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

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()

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: 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, xrange(2,n+1). Save a

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__':

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: 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

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 goes the

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: (a, b, c, d, e) (or in a more object-like display: set(obj1.choices=set(a, b, c) ). There may be obj1..objN objects in the

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 these 3

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'ü', u'Ç',

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: 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 what you are

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'ü', u'Ç',

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', 'G',

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 if (logMsg

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 for the

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): for

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

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 your main code

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

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 ?-) And

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 in 2-3

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

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

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: 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. Selecting

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:\Python25 which it

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 stdin, line 1, in module UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in

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 in this way is

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 other problems with

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'ü', u'Ç',

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: 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: (a, b, c, d, e) (or in a more object-like display:

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: 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 stdin, line 1, in module

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 --

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-check

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') Traceback (most recent call last):

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

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 Hat

Re: Bypassing __getattribute__ for attribute access

2007-10-25 Thread Steven Bethard
Adam Donahue wrote: class X( object ): ... def c( self ): pass ... X.c unbound method X.c x = X() x.c bound method X.c of __main__.X object at 0x81b2b4c If my interpretation is correct, the X.c's __getattribute__ call knows the attribute reference is via a class, and thus returns

[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 ziga.seilnacht-AT-gmail.com 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, ... Linux working OK now

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)

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

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 take the

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 things

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:41) [GCC

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

Re: Bypassing __getattribute__ for attribute access

2007-10-25 Thread Chris Mellon
On Thu, 2007-10-25 at 23:13 +0200, Bruno Desthuilliers wrote: snip excellent breakdown 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

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 --

  1   2   >