ANN: PyTables 1.3.1 - Hierarchical datasets

2006-05-04 Thread Francesc Altet
=== Announcing PyTables 1.3.1 === This is a new minor release of PyTables. On it, you will find support for NumPy integers as indexes of datasets and many bug fixes. *Important note*: one of the fixes adresses a bug in the flushing of I/O buffers

ANN: Advanced Python training, May 17-19, San Francisco

2006-05-04 Thread w chun
FINAL REMINDER... we still have some seats left! What: Advanced Python Programming When: May 17-19, 2006 Where: San Francisco (SFO/San Bruno), CA, USA http://cyberwebconsulting.com (click on Python Training) This course, meant to follow our in-depth introduction class, adds new tools to

[ANN] DOPAL 0.60 - Python library for Azureus

2006-05-04 Thread Allan Crooks
Summary: --- DOPAL is a library to allow programs written in Python to easily communicate the Java BitTorrent client Azureus, via the XML/HTTP plugin (allowing communication over a network). Changes: --- Version 0.60 is the fourth public release of DOPAL. The first major change is the

Shed Skin Python-to-C++ Compiler 0.0.8

2006-05-04 Thread Mark Dufour
Hi there, I have just released version 0.0.8 of Shed Skin, an optimizing Python-to-C++ compiler. It allows for translation of pure (unmodified), implicitly statically typed Python programs into optimized C++, and hence, highly optimized machine language. Many non-trivial benchmarks (ray tracer,

Re: stripping unwanted chars from string

2006-05-04 Thread Edward Elliott
John Machin wrote: [expletives deleted] and it was wrong anyway (according to your requirements); using \w would keep '_' which is *NOT* alphanumeric. Actually the perl is correct, the explanation was the faulty part. When in doubt, trust the code. Plus I explicitly allowed _ further down,

Re: Playability of a file in windows media player

2006-05-04 Thread Roger Upole
The below code will catch the OnError event that's triggered when you specify a bad URL. import win32com.client class wmpevents: def OnOpenStateChange(self, NewState): Sent when the control changes OpenState print 'OnOpenStateChange', NewState if

Re: basic python programing

2006-05-04 Thread Terry Hancock
gregarican wrote: Ravi Teja wrote: How To Ask Questions The Smart Way http://www.catb.org/~esr/faqs/smart-questions.html Actual the parent post on the thread wasn't asking a question. They were making a somewhat puzzling dangling statement. here we discuss the most basic concepts about

Re: Defining class methods outside of classes

2006-05-04 Thread Peter Otten
Lord Landon wrote: Hi, I'm working on a bot written in python. It will consist of a mostly empty class that will then call a loader which in turn defines functions and adds them to the class. At the moment, I do this by using execfile(file,globals()) and calling a load(bot) method defined in

Re: stripping unwanted chars from string

2006-05-04 Thread Edward Elliott
Bryan wrote: keepchars = set(string.letters + string.digits + '-.') Now that looks a lot better. Just don't forget the underscore. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Possibly dumb question about dicts and __hash__()

2006-05-04 Thread Peter Otten
Joel Hedlund wrote: There's one thing about dictionaries and __hash__() methods that puzzle me. I have a class with several data members, one of which is 'name' (a str). I would like to store several of these objects in a dict for quick access ({name:object} style). Now, I was thinking that

Re: Possible constant assignment operators := and ::= for Python

2006-05-04 Thread Fredrik Lundh
Christophe wrote: That's easy, since A is a symbolic constant know at compile time, and since it's a known mutable objet, the code once compiled will be equivalent to: b = [[]] # much later b|0].append('1') the OP talked about constants as names for immutable objects, not pre-

Re: Possibly dumb question about dicts and __hash__()

2006-05-04 Thread Joel Hedlund
Hi! Just the hash is not enough. You need to define equality, too: Thanks a million for clearing that up. Cheers! /Joel -- http://mail.python.org/mailman/listinfo/python-list

Re: stripping unwanted chars from string

2006-05-04 Thread bruno at modulix
Edward Elliott wrote: Bryan wrote: keepchars = set(string.letters + string.digits + '-.') Now that looks a lot better. Just don't forget the underscore. :) You may also want to have a look at string.translate() and string.maketrans() -- bruno desthuilliers python -c print

Re: This coding style bad practise?

2006-05-04 Thread bruno at modulix
Carl Friedrich Bolz wrote: Bruno Desthuilliers wrote: Martin P. Hellwig a écrit : I created a class which creates a relative unique id string, now my program just works fine and as expected but somehow I get the feeling that I misused the __repr__ since I guess people expect to 'execute'

Re: This coding style bad practise?

2006-05-04 Thread bruno at modulix
Martin P. Hellwig wrote: Bruno Desthuilliers wrote: cut Why not just use the call operator instead ? ie: id = IDGenerator(...) id() 01_20060424_151903_1 id() 01_20060424_151905_2 Because of: id = IDGenerator(01,99) id() Traceback (most recent call last): File

Re: pythonic way to sort

2006-05-04 Thread Boris Borcic
Jay Parlar wrote: On May 4, 2006, at 12:12 AM, [EMAIL PROTECTED] wrote: [...] Assume that you have the lines in a list called 'lines', as follows: lines = [ 1SOME STRING ~ABC~12311232432D~20060401~, 3SOME STRING ~ACD~14353453554G~20060401~, 2SOME

Re: noob question: TypeError wrong number of args

2006-05-04 Thread bruno at modulix
Ben Finney wrote: Bruno Desthuilliers [EMAIL PROTECTED] writes: Ben Finney a écrit : So now you're proposing that this be a special case when a function is declared by that particular syntax, and it should be different to when a function is created outside the class definition and added as a

Displaying Images and getting input from Mouse

2006-05-04 Thread Wynand Singels
Hi there everyone I'm trying to figure out the best (and fastest way) to display a JPEG image and then input several (x,y) coordinate pairs from mouse clicks on the image. I figured out how to do this in pylab using matplotlib as follows: img = 256 - S.misc.pilutil.imread('pic1.jpg')

Re: Because of multithreading semantics, this is not reliable.

2006-05-04 Thread Christophe
[EMAIL PROTECTED] a écrit : Tim and Grant if q.empty(): return Of course you explanation is understood and ideally should be included as a note in the Python documentation. And the not reliable should be removed from the documentation! Anyway, many thanks for your

Re: noob question: TypeError wrong number of args

2006-05-04 Thread bruno at modulix
Edward Elliott wrote: Ben Finney wrote: As I understand it, the point was not what the code does, but to give a sample input (a Python program) for the simple text processor you described to wade through. Ah, well then, there's no need for a full-blown parser. It should suffice to

Re: Possible constant assignment operators := and ::= for Python

2006-05-04 Thread Christophe
Fredrik Lundh a écrit : Christophe wrote: That's easy, since A is a symbolic constant know at compile time, and since it's a known mutable objet, the code once compiled will be equivalent to: b = [[]] # much later b|0].append('1') the OP talked about constants as names for

Re: Customize IE to make a toolbar visible

2006-05-04 Thread Roger Upole
This does the trick for Google toolbar: import win32com.client ie=win32com.client.Dispatch('internetexplorer.application') ie.Visible=1 ie.ShowBrowserBar('{2318C2B1-4965-11d4-9B18-009027A5CD4F}',True,0) You should be able to just substitute the GUID for the Yahoo toolbar. Roger [EMAIL

Re: Dispatching operations to user-defined methods

2006-05-04 Thread Michele Simionato
Apparently Guido fell in love with generic functions, so (possibly) in future Python versions you will be able to solve dispatching problems in in an industrial strenght way. Sometimes however the simplest possible way is enough, and you can use something like this : class

Fw: Swaying A Coder Away From Python

2006-05-04 Thread Tim Williams
- Original Message - From: DevWebProUK [EMAIL PROTECTED] To: Sent: Wednesday, May 03, 2006 10:14 PM Subject: Swaying A Coder Away From Python Swaying A Coder Away From Python By David A. Utter One programmer blogged about the powerful attraction he is feeling to C# programming, and

Re: Possible constant assignment operators := and ::= for Python

2006-05-04 Thread Michele Simionato
Edward Elliott wrote: Michele Simionato wrote: Python solution is to rely on the intelligence of programmers. If they see an all caps name and then they try to change it without knowing what they are doing, then they are stupid. If you have stupid programmers there is no way the language

Re: stripping unwanted chars from string

2006-05-04 Thread John Machin
On 4/05/2006 4:30 PM, Edward Elliott wrote: Bryan wrote: keepchars = set(string.letters + string.digits + '-.') Now that looks a lot better. Just don't forget the underscore. :) *Looks* better than the monkey business. Perhaps I should point out to those of the studio audience who are

Re: scope of variables

2006-05-04 Thread Gary Wessle
Ryan Forsythe [EMAIL PROTECTED] writes: Gary Wessle wrote: the example was an in-accuretlly representation of a the problem I am having. my apologies. a = [] def prnt(): print len(a) prnt function prnt at 0xb7dc21b4 I expect to get 0 the length of list a You want

Re: scope of variables

2006-05-04 Thread bruno at modulix
Gary Wessle wrote: Ryan Forsythe [EMAIL PROTECTED] writes: Gary Wessle wrote: the example was an in-accuretlly representation of a the problem I am having. my apologies. (snip) I finally was able to duplicate the error with a through away code as follows,

Usage of single click or double click in Tix programming

2006-05-04 Thread praveenkumar . 117
Dear all, I am developing an GUI application using Tix I want to trigger a window on single or double click on a name displayed in the GUI. How to go about using Python your help is very much appreciated regards praveen --

Problem building extension under Cygwin (ImportError: Bad address)

2006-05-04 Thread Lars
Hi, I have problems building a simple handcoded C-extension (hello.c) with Cygwin and gcc3.4.4. I hope somebody has encountered the same problem before, and has some advice. The extension works just fine with Linux: gcc -c hello.c -I/usr/local/include/python2.4/ ld -shared hello.o -o hello.so

Re: This coding style bad practise?

2006-05-04 Thread Martin P. Hellwig
bruno at modulix wrote: Martin P. Hellwig wrote: Bruno Desthuilliers wrote: cut Why not just use the call operator instead ? ie: id = IDGenerator(...) id() 01_20060424_151903_1 id() 01_20060424_151905_2 Because of: id = IDGenerator(01,99) id() Traceback (most recent call

Re: Swaying A Coder Away From Python

2006-05-04 Thread Fredrik Lundh
Tim Williams wrote: By David A. Utter who's this, and why does he think that sampling some random comments by some random bloggers should mean anything to anyone ? (and why do you seem to think that this matters, btw ?) (and yes, I recognize the names of some of the bloggers he quotes.

Re: ZSI usage

2006-05-04 Thread Maxim Sloyko
There is a typo there in functions name. It is called session_open not open_session, but everything else is as described -- http://mail.python.org/mailman/listinfo/python-list

pleac

2006-05-04 Thread jonas
Hi, I'm new to python. After a search on http://pleac.sourceforge.net/pleac_python/index.html why python have a low %? Thanks in advance -- http://mail.python.org/mailman/listinfo/python-list

Re: Zope Guru...

2006-05-04 Thread Nico Grubert
In doing some research into Workflow apps regarding document management, I came across Zope. Given that it's Python Based, I figured I'd shout to the group here... If you want to develop an application with Zope+Python from scratch, there are a few Zope products out there that handle

Re: pleac

2006-05-04 Thread Fredrik Lundh
jonas wrote: After a search on http://pleac.sourceforge.net/pleac_python/index.html why python have a low %? why not ask the pleac maintainers? (it might be that pythoneers have better things to do with their time than translating old Perl stuff to Python... if you want Python cook- book

ZSI usage

2006-05-04 Thread Maxim Sloyko
Hi all! I'm trying to make a simple SOAP call from python to SOAP::Lite (perl) SOAP server. My SOAP server has https://myserv.com/open-api URI, the function open_session has the QW/API namespace. SO I do the following: from ZSI.client import Binding fp = open('debug.out', 'a') client =

Pythoncard question

2006-05-04 Thread DarkBlue
I am trying to port a Delphi database application to python on linux with a firebird database backend and I am using pythoncard to recreate the gui. I will have about 25 delphi forms to be recreated and I would like to know what is the best way to call them up from within each other . There is a

RegEx with multiple occurrences

2006-05-04 Thread Mike
Hi again. I'm trying to strip all script blocks from HTML, and am using the following re to do it: p = re.compile((\script.**\/script),re.IGNORECASE | re.DOTALL) m = p.search(data) The problem is that I'm getting everything from the 1st script's start tag to the last script's end tag in one

about the implement of the PyString_InternFromString

2006-05-04 Thread kyo guan
Hi : Hi guys: I have a question about the this API. PyObject * PyString_InternFromString(const char *cp) { PyObject *s = PyString_FromString(cp); if (s == NULL) return NULL; PyString_InternInPlace(s); return s; } Why it always try to

about the implement of the PyString_InternFromString

2006-05-04 Thread Kyo Guan
Hi guys: I have a question about the this API. PyObject * PyString_InternFromString(const char *cp) { PyObject *s = PyString_FromString(cp); if (s == NULL) return NULL; PyString_InternInPlace(s); return s; } Why it always try to call

Re: RegEx with multiple occurrences

2006-05-04 Thread Tim Chase
p = re.compile((\script.**\/script),re.IGNORECASE | re.DOTALL) m = p.search(data) First, I presume you didn't copy paste your expression, as it looks like you're missing a period before the second asterisk. Otherwise, all you'd get is any number of greater-than signs followed by a closing

__getattr__ for global namespace?

2006-05-04 Thread Harold Fellermann
Hi, I am writing an application that initializes the global namespace, and afterwards, leaves the user with the python prompt. Now, I want to catch NameErrors in user input like e.g. some_name Traceback (most recent call last): File stdin, line 1, in ? NameError: name 'some_name' is not

Re: about the implement of the PyString_InternFromString

2006-05-04 Thread Heiko Wundram
Am Donnerstag 04 Mai 2006 13:44 schrieb Kyo Guan: Hi guys: I have a question about the this API. PyObject * PyString_InternFromString(const char *cp) { PyObject *s = PyString_FromString(cp); if (s == NULL) return NULL; PyString_InternInPlace(s);

Re: Swaying A Coder Away From Python

2006-05-04 Thread Tim Williams
(and why do you seem to think that this matters, btw ?) I actually think it is complete twaddle, for the same reasons as you. It was forwarded to me by someone who knows I use Python, and I thought it might be of interest to a balanced list, especially as it shows an external perspective

Python function returns:

2006-05-04 Thread Michael Yanowitz
I am still new to Python but have used it for the last 2+ months. One thing I'm still not used to is that functions parameters can't change as expected. For example in C, I can have status = get_network_info (strIpAddress, strHostname, nPortNumber) where this fictitious function returns a

Re: Mod_python.publisher behavior - sending .py file tobrowser not processing it in pyton

2006-05-04 Thread Daniel Nogradi
As Graham pointed out SetHandler and AddHandler should not be used at the same time. SetHandler mod_python causes all files to be served by mod_python and when you refer to them in your browser you don't need to specify any extension such as .py and AddHandler mod_python .py causes all

Re: pleac

2006-05-04 Thread jonas
Thanks Fredrik, i'm going to buy the book. After all, there's nothing about the Python language power! thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: RegEx with multiple occurrences

2006-05-04 Thread Mike
Tim - you're a legend. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: RegEx with multiple occurrences

2006-05-04 Thread Tim Chase
Tim - you're a legend. Thanks. A leg-end? I always knew something was a-foot. Sorry to make myself the butt of such joking. :) My pleasure...glad it seems to be working for you. -tkc (not much of a legend at all...just a regexp wonk) --

Re: Pythoncard question

2006-05-04 Thread bryan rasmussen
Hi, I'm doing a sort of symbolic linking app in Windows for my own enjoyment, and figured I would do it in python for the same reason + learning the language. The following functions could obviously do with some refactoring. One obvious thing would be to make wordsetter and wordsforfolder more

refactoring question

2006-05-04 Thread bryan rasmussen
Hi, I'm doing a sort of symbolic linking app in Windows for my own enjoyment, and figured I would do it in python for the same reason + learning the language. The following functions could obviously do with some refactoring. One obvious thing would be to make wordsetter and wordsforfolder more

Re: Pythoncard question

2006-05-04 Thread bryan rasmussen
oops, sorry about that. I copied the message over in gmail but forgot to change the subject. Sorry, Bryan Rasmussen -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem building extension under Cygwin (ImportError: Bad address)

2006-05-04 Thread Jason Tishler
Lars, On Thu, May 04, 2006 at 03:50:13AM -0700, Lars wrote: I have problems building a simple handcoded C-extension (hello.c) with Cygwin and gcc3.4.4. I hope somebody has encountered the same problem before, and has some advice. [snip] The following works for me: $ gcc -shared

Re: Swaying A Coder Away From Python

2006-05-04 Thread Fredrik Lundh
Tim Williams wrote: It was forwarded to me by someone who knows I use Python, and I thought it might be of interest to a balanced list, especially as it shows an external perspective of Python. Are we not allowed to post negative things about Python anymore /.../ nope, but if we were to

Re: Because of multithreading semantics, this is not reliable.

2006-05-04 Thread Olaf Meding
return result before that line, some other thread added a value ! Sure, but that is the nature of using threads and a mutex. I hope you are you not saying that every function that uses a mutex should have a comment saying this is not reliable? Olaf --

Re: Swaying A Coder Away From Python

2006-05-04 Thread BartlebyScrivener
I'm picking this up via clp on Google Groups. I can't tell what Mr. Lundh is referring to. The first line of his post is: Tim Williams wrote but there's nothing that comes before. I had seen the article on Django on Digg I think, but what is article Tim Williams is referring to? Thanks, rick --

HTMLParseError: EOF in middle of construct error

2006-05-04 Thread Mike
Me again. I'm getting this error when parsing an external URL - I understand that a common cause of this is badly formed HTML (or XHTML) and that's fair enough, but is there any way to turn the parser into forgiving mode? As I'm getting this error from documents over which I have no control, I

Re: about the implement of the PyString_InternFromString

2006-05-04 Thread Fredrik Lundh
Kyo Guan wrote: I have a question about the this API. PyObject * PyString_InternFromString(const char *cp) { PyObject *s = PyString_FromString(cp); if (s == NULL) return NULL; PyString_InternInPlace(s); return s; } Why it always try to call PyString_FromString first? if char* cp is

Re: HTMLParseError: EOF in middle of construct error

2006-05-04 Thread Diez B. Roggisch
Mike wrote: Me again. I'm getting this error when parsing an external URL - I understand that a common cause of this is badly formed HTML (or XHTML) and that's fair enough, but is there any way to turn the parser into forgiving mode? As I'm getting this error from documents over which I

Re: Python function returns:

2006-05-04 Thread Diez B. Roggisch
Michael Yanowitz wrote: I am still new to Python but have used it for the last 2+ months. One thing I'm still not used to is that functions parameters can't change as expected. For example in C, I can have status = get_network_info (strIpAddress, strHostname, nPortNumber) where this

Multiple Version Install?

2006-05-04 Thread David C.Ullrich
Would there be issues (registry settings, environment variables, whatever) if a person tried to install versions 1.x and 2.x simultaneously on one Windows system? Windows 98, if it matters. (I can handle the file associations with no problem.) Thanks. ** If anyone feels

Re: Python function returns:

2006-05-04 Thread Duncan Booth
Michael Yanowitz wrote: In Python, there does not seem to be an easy way to have functions return multiple values except it can return a list such as: strHostname, nPortNumber, status = get_network_info (strIpAddress, strHostname,

Re: Gettings subdirectories

2006-05-04 Thread Philippe Martin
Hi, The second edition of Programming Python - O'REILLY - Mark Lutz shows how to do that using os.path.walk Philippe Florian Lindner wrote: Hello, how can I get all subdirectories of a given directories? os.listdir() gives me all entries and I've found no way to tell if an object is a

Re: Python function returns:

2006-05-04 Thread Tim Chase
In Python, there does not seem to be an easy way to have functions return multiple values except it can return a list such as: strHostname, nPortNumber, status = get_network_info (strIpAddress, strHostname, nPortNumber) Am I missing something obvious? Is there a better, or more standard way

Re: Because of multithreading semantics, this is not reliable.

2006-05-04 Thread Sergei Organov
Olaf Meding [EMAIL PROTECTED] writes: return result before that line, some other thread added a value ! Sure, but that is the nature of using threads and a mutex. I hope you are you not saying that every function that uses a mutex should have a comment saying this is not reliable?

Subclassing array

2006-05-04 Thread TG
Hi. i've already something about inheriting from array a few weeks ago and had my answer. But again, there is something that I don't understand. Here is my vector class, which works quite well : class Vector(array): def __new__(cls,length,data=None): return

Python sample code for PLSQL REF CURSORS

2006-05-04 Thread A.M
Hi, I am having hard time to find a sample that shows me how to return an OUT REF CURSOR from my oracle stored procedure to my python program. The technique is explained here for Java and Visual Basic: http://www.oracle-base.com/articles/8i/UsingRefCursorsToReturnRecordsets.php I am

Re: This coding style bad practise?

2006-05-04 Thread Martin P. Hellwig
cut Thanks for the input folks! I adapted my script to the given suggestions and it's now far more 'logical', for reference I added it below. -- mph - script - import string import time class IDGenerator(object): (leading_id, subversion_length, tz) # tz = 'local' or 'gm'

Re: Python function returns:

2006-05-04 Thread Roy Smith
In article [EMAIL PROTECTED], Tim Chase [EMAIL PROTECTED] wrote: They Python way (that you deride) is much clearer. Your input goes in the parameters, and your output gets assigned the way functions are intended to work. Unambiguous. It's probably worth mentioning that the only reason

Re: Swaying A Coder Away From Python

2006-05-04 Thread Tim Williams
On 04/05/06, Fredrik Lundh [EMAIL PROTECTED] wrote: nope, but if we were to post to the list every time some random blogger says something about Python, we wouldn't have room for much other stuff. It wasn't from a random blogger, it was from an email newsletter for this site:

Shed Skin Python-to-C++ Compiler - Summer of Code?

2006-05-04 Thread Mark Dufour
Hello all, As Bearophile pointed out, I have just released Shed Skin 0.0.8. For those of you that do not know Shed Skin, it is an optimizing Python-to-C++ compiler, that allows for translation of pure (unmodified) Python programs into optimized machine language. The speed of generated code is

Re: Python function returns:

2006-05-04 Thread bruno at modulix
Michael Yanowitz wrote: I am still new to Python but have used it for the last 2+ months. One thing I'm still not used to is that functions parameters can't change as expected. For example in C, I can have status = get_network_info (strIpAddress, strHostname, nPortNumber) You have to

Re: Swaying A Coder Away From Python

2006-05-04 Thread bruno at modulix
BartlebyScrivener wrote: I'm picking this up via clp on Google Groups. I can't tell what Mr. Lundh is referring to. The first line of his post is: Tim Williams wrote but there's nothing that comes before. I had seen the article on Django on Digg I think, but what is article Tim Williams is

Re: Problem building extension under Cygwin (ImportError: Bad address)

2006-05-04 Thread Lars
Thanks Jason, it works now. There seems to be some sort of issue with ld in cygwin when compiling shared libraries (e.g. DLL's). This worked on my Cygwin installation also: -- gcc hello.c -I/usr/include/python2.4/ -L/usr/lib/python2.4/config/ -lpython2.4 -shared -o

Re: Because of multithreading semantics, this is not reliable.

2006-05-04 Thread Christophe
Olaf Meding a écrit : return result before that line, some other thread added a value ! Sure, but that is the nature of using threads and a mutex. I hope you are you not saying that every function that uses a mutex should have a comment saying this is not reliable? That function can

Re: Swaying A Coder Away From Python

2006-05-04 Thread Tim Williams
On 4 May 2006 05:24:40 -0700, BartlebyScrivener [EMAIL PROTECTED] wrote: I'm picking this up via clp on Google Groups. I can't tell what Mr. Lundh is referring to. The first line of his post is: Tim Williams wrote but there's nothing that comes before. I had seen the article on Django on Digg

Re: unable to resize mmap object

2006-05-04 Thread Georg Brandl
Carl Banks wrote: Frankly, I'm not so sure matching Windows behavior is a great idea. mmap module seems to be having an identity crisis. Is it a low-level system call, or a high-level, OS-independent way to access files as blocks of memory? The modules is moving towards the latter (what

Re: Because of multithreading semantics, this is not reliable.

2006-05-04 Thread Grant Edwards
On 2006-05-04, Olaf Meding [EMAIL PROTECTED] wrote: return result before that line, some other thread added a value ! Sure, but that is the nature of using threads and a mutex. Yes. I hope you are you not saying that every function that uses a mutex should have a comment saying this is

Re: Gettings subdirectories

2006-05-04 Thread Lou Losee
import os.pathos.path.isdir(file)LouOn 5/4/06, Philippe Martin [EMAIL PROTECTED] wrote: Hi,The second edition of Programming Python - O'REILLY - Mark Lutz shows how to do that using os.path.walkPhilippeFlorian Lindner wrote: Hello, how can I get all subdirectories of a given directories?

Re: Python sample code for PLSQL REF CURSORS

2006-05-04 Thread Gerhard Häring
A.M wrote: Hi, I am having hard time to find a sample that shows me how to return an OUT REF CURSOR from my oracle stored procedure to my python program. [...] import cx_Oracle con = cx_Oracle.connect(me/[EMAIL PROTECTED]) cur = con.cursor() outcur = con.cursor() cur.execute( BEGIN

Re: Because of multithreading semantics, this is not reliable.

2006-05-04 Thread OlafMeding
Christophe Same reason that there is a warning in the os.access manual I understand the if file exists open it code. I looked at the os.access documentation and see no warning or not reliable wording there. 6.1.4 Files and Directories access(path, mode) Olaf --

Re: pleac

2006-05-04 Thread Thomas Guettler
Am Thu, 04 May 2006 04:05:49 -0700 schrieb jonas: Hi, I'm new to python. After a search on http://pleac.sourceforge.net/pleac_python/index.html why python have a low %? Python has the highest percentage of all languages at pleac. For those who don't know pleac: Following the great Perl

Re: Multiple Version Install?

2006-05-04 Thread Fredrik Lundh
David C.Ullrich wrote: Would there be issues (registry settings, environment variables, whatever) if a person tried to install versions 1.x and 2.x simultaneously on one Windows system? Windows 98, if it matters. (I can handle the file associations with no problem.) in general, no. (I

Re: Sorting a list of dictionaries by dictionary key

2006-05-04 Thread Alex Martelli
Tim Chase [EMAIL PROTECTED] wrote: assuming that DateTime returns something that compares correctly, you can do something like: def sortkey(item): return item.get(from_datetime) data.sort(key=sortkey) (assuming Python 2.4 or later) Building on Fredrik's

Re: Because of multithreading semantics, this is not reliable.

2006-05-04 Thread Christophe
[EMAIL PROTECTED] a écrit : Christophe Same reason that there is a warning in the os.access manual I understand the if file exists open it code. I looked at the os.access documentation and see no warning or not reliable wording there. 6.1.4 Files and Directories access(path,

Re: simultaneous assignment

2006-05-04 Thread Dave Hansen
On Tue, 02 May 2006 18:52:48 GMT in comp.lang.python, John Salerno [EMAIL PROTECTED] wrote: [...] Yeah, after trying some crazy things, I just wrote it this way: def truth_test(seq): truth = 0 for item in seq: if item: truth += 1 if truth == 1:

Re: simultaneous assignment

2006-05-04 Thread Paul Rubin
Dave Hansen [EMAIL PROTECTED] writes: Well, if you want something minimalist, you could try def truth_test(seq): return sum(1 for item in seq if item) == 1 def truth_test(seq): return sum(map(bool, seq)) == 1 -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling a Postgres Function using CGI written in Python

2006-05-04 Thread Fuzzydave
cheers :) thats what i wanted to know :) David -- http://mail.python.org/mailman/listinfo/python-list

Re: python strings

2006-05-04 Thread Sion Arrowsmith
Bryan [EMAIL PROTECTED] wrote: s = '\x00' s[0] == chr(0) True That's a little excessive when: s = '\0' s[0] == chr(0) True Oh, and to reassure the OP that that null really is *in* the string: len(s) 1 -- \S -- [EMAIL PROTECTED] -- http://www.chaos.org.uk/~sion/ ___ | Frankly I

Unicode code has no method float() ?

2006-05-04 Thread Rony Steelandt
How can I get the value of a Unicode object ? When I do myobject.float() I get the error message that it doesn't have a float() attribute tia R_ -- --- Rony Steelandt BuCodi rony dot steelandt (at) bucodi dot com Visit the python blog at http://360.yahoo.com/bucodi --

Re: Unicode code has no method float() ?

2006-05-04 Thread Alexandre Fayolle
Le 04-05-2006, Rony [EMAIL PROTECTED] nous disait: How can I get the value of a Unicode object ? When I do myobject.float() I get the error message that it doesn't have a float() attribute Try to use the float builtin function, as in: float(myobject) instead of a method. -- Alexandre

Re: Subclassing array

2006-05-04 Thread Alex Martelli
TG [EMAIL PROTECTED] wrote: ... When I call Vector.__init__() in Stimulus, doesn't it also call __new__ ? I don't understand the detail of callings to __new__ and __init__ in python inheritance ... Calling a (new-style) class does __new__ first, THEN calls the class's __init__ on the

Tuple assignment and generators?

2006-05-04 Thread Tim Chase
Just as a pedantic exercise to try and understand Python a bit better, I decided to try to make a generator or class that would allow me to unpack an arbitrary number of calculatible values. In this case, just zeros (though I just to prove whatever ends up working, having a counting

Re: stripping unwanted chars from string

2006-05-04 Thread Alex Martelli
Edward Elliott [EMAIL PROTECTED] wrote: I'm looking for the best way to strip a large set of chars from a filename string (my definition of best usually means succinct and readable). I only want to allow alphanumeric chars, dashes, and periods. This is what I would write in Perl (bless me

Re: Python function returns:

2006-05-04 Thread Sion Arrowsmith
Michael Yanowitz [EMAIL PROTECTED] wrote: In Python, there does not seem to be an easy way to have functions return multiple values except it can return a list such as: strHostname, nPortNumber, status = get_network_info (strIpAddress, strHostname,

Re: Multiple Version Install?

2006-05-04 Thread David C.Ullrich
On Thu, 4 May 2006 16:17:57 +0200, Fredrik Lundh [EMAIL PROTECTED] wrote: David C.Ullrich wrote: Would there be issues (registry settings, environment variables, whatever) if a person tried to install versions 1.x and 2.x simultaneously on one Windows system? Windows 98, if it matters. (I

Re: Unicode code has no method float() ?

2006-05-04 Thread Rony Steelandt
Works, thank you Le 04-05-2006, Rony [EMAIL PROTECTED] nous disait: How can I get the value of a Unicode object ? When I do myobject.float() I get the error message that it doesn't have a float() attribute Try to use the float builtin function, as in: float(myobject) instead of a

Re: Wake on LAN and Shutdown for Windows and Linux

2006-05-04 Thread diffuser78
Any help is appreciated -- http://mail.python.org/mailman/listinfo/python-list

Re: Swaying A Coder Away From Python

2006-05-04 Thread Sion Arrowsmith
On 4 May 2006 05:24:40 -0700, BartlebyScrivener [EMAIL PROTECTED] wrote: I'm picking this up via clp on Google Groups. I can't tell what Mr. Lundh is referring to. The first line of his post is: Tim Williams wrote but there's nothing that comes before. Similarly, I'm reading this via

  1   2   >