[ANN] Soya 3D 0.12

2006-07-20 Thread Jiba
*** What is Soya 3D ? *** Soya 3D is an object oriented high level 3D engine for Python. Somehow, Soya is to 3D what Python is to programming: an 'avant guarde' 3D engine, a kind of 'UFO' in the 3D world :-). Soya allows to develop very rapidly games of other 3D apps, entirely in the Python

Re: restricted environment

2006-07-20 Thread K.S.Sreeram
Gabriele *darkbard* Farina wrote: The first attempt to reach my goal was to override the __import__ function to limit it working on modules that can be used and on custom import directories that can be accessed. Then I executed the scripts using exec. There is any security problem related to

Depricated String Functions in Python

2006-07-20 Thread Anoop
Hi All Can any one help me out with the various depricated string functions that is followed in Python. For example how will be string.lower depricated. As far as string.lower('PYTHON') is concerned it is depricated as 'PYTHON'.lower(). Both of them would return an output : python Thanks for

Re: Depricated String Functions in Python

2006-07-20 Thread Stefan Behnel
Anoop wrote: Can any one help me out with the various depricated string functions that is followed in Python. For example how will be string.lower depricated. As far as string.lower('PYTHON') is concerned it is depricated as 'PYTHON'.lower(). Both of them would return an output : python

Re: Weird MemoryError issue

2006-07-20 Thread jedi200581
John Machin wrote: On 20/07/2006 6:05 AM, John Machin wrote: On 20/07/2006 1:58 AM, [EMAIL PROTECTED] wrote: def is_prime n: Syntax error. Should be: def is_prime n: Whoops! Take 2: Should be: def is_prime(n): Sorry for that, I was not able to cut-paste the code at the

Re: using names before they're defined

2006-07-20 Thread Nick Vatamaniuc
Dave, Python properties allow you to get rid of methods like c.getAttr(), c.setAttr(v), c.delAttr() and replace them with simple constructs like c.attr, c.attr=v and del c.attr. If you have been using Java or C++ you know that as soon as you code your class you have to start filling in the get()

Re: New to threads. How do they work?

2006-07-20 Thread gel
Dennis Lee Bieber wrote: On 19 Jul 2006 19:08:12 -0700, gel [EMAIL PROTECTED] declaimed the following in comp.lang.python: import thread Step one... Skip the thread module and use threading module instead. def create(): pythoncom.CoInitialize() c =

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], mystilleef wrote: Bruno Desthuilliers wrote: mystilleef wrote: Bruno Desthuilliers wrote: Because you don't want third parties illegimately tampering with an object's internal data and thus crashing your system? Let's try again... point 1 : there's *no*

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Steve Holden
Dennis Lee Bieber wrote: On 19 Jul 2006 22:38:17 -0700, mystilleef [EMAIL PROTECTED] declaimed the following in comp.lang.python: permitted should be between an object and its mediator. Messages are passed through the system via signals or events or established protocols. What are the

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Steve Holden
mystilleef wrote: [...] I don't know it's your code not mine. class Robust(object): def __init__(self): # Arbitrarily changing this state to False will crash app or will # corrupt the whole event system. self.__is_active = True

Re: Depricated String Functions in Python

2006-07-20 Thread Steve Holden
Anoop wrote: Hi All Can any one help me out with the various depricated string functions that is followed in Python. For example how will be string.lower depricated. As far as string.lower('PYTHON') is concerned it is depricated as 'PYTHON'.lower(). Both of them would return an output

Re: using names before they're defined

2006-07-20 Thread Steve Holden
[EMAIL PROTECTED] wrote: Steve Holden wrote: [EMAIL PROTECTED] wrote: I have a problem. I'm writing a simulation program with a number of mechanical components represented as objects. When I create instances of objects, I need to reference (link) each object to the objects upstream and

Re: New to threads. How do they work?

2006-07-20 Thread Dermot Doran
Hi I think the answer to your last question is that the threading module provides a high level interface (i.e. easier to use) to the thread module. The thread module is very low-level. Any threaded python scripts I have written (not expert) have used the threading module which is, in my opinion,

Re: Getting and Setting Cookies

2006-07-20 Thread Vlad Dogaru
John J. Lee wrote: Vlad Dogaru [EMAIL PROTECTED] writes: [...] I am trying to write a simple login script. I understand (or rather I think I understand) how to set a cookie with the Cookie module. My problem is getting the cookies that are currently set. How can I do that? You still

Re: Coding style

2006-07-20 Thread Antoon Pardon
On 2006-07-19, Georg Brandl [EMAIL PROTECTED] wrote: Antoon Pardon wrote: Other than in PHP, Python has clear rules when an object of a builtin type is considered false (i.e. when it's empty). So why not take advantage of this? Because it doesn't always do what I want. I once had a

Re: mysqldb problem

2006-07-20 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], liupei wrote: when I set mysql some fields collate utf8_bin, and then fetch these fields is array.array,not the string I expected Can you post some example code? -- http://mail.python.org/mailman/listinfo/python-list

Re: questions to anyone who uses wxPython

2006-07-20 Thread Dermot Doran
Hi the wxPython in Action provides a very good explanation as to how to handle this sort of problem using a combination of pure Python threads and the wx.CallAfter function. Also if you want more help on this you can join the wxPython mailing list via www.wxpython.org. Here is a small example

Re: Depricated String Functions in Python

2006-07-20 Thread John Machin
On 20/07/2006 5:18 PM, Steve Holden wrote: Anoop wrote: Hi All Can any one help me out with the various depricated string functions that is followed in Python. For example how will be string.lower depricated. As far as string.lower('PYTHON') is concerned it is depricated as

Re: access to submodules

2006-07-20 Thread TG
okay, thanks everyone. this is much clearer now. -- http://mail.python.org/mailman/listinfo/python-list

Re: Coding style

2006-07-20 Thread Antoon Pardon
On 2006-07-19, Donn Cave [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], Georg Brandl [EMAIL PROTECTED] wrote: Lawrence D'Oliveiro wrote: One of my rules is, always program like the language actually has a Boolean type, even if it doesn't. That means, never assume that arbitrary

Re: Depricated String Functions in Python

2006-07-20 Thread Steve Holden
John Machin wrote: On 20/07/2006 5:18 PM, Steve Holden wrote: Anoop wrote: Hi All Can any one help me out with the various depricated string functions that is followed in Python. For example how will be string.lower depricated. As far as string.lower('PYTHON') is concerned it is depricated

Re: restricted environment

2006-07-20 Thread Gabriele *darkbard* Farina
Paul Rubin wrote: Gabriele *darkbard* Farina [EMAIL PROTECTED] writes: Using a separate interpreter could be a solution, but restarting any time the interpreter give me too much overhead and the application will work as slow as a CGI app even if it runs using FastCGI. How many users are

Re: CSV with comments

2006-07-20 Thread GinTon
and which method is the best, Daniel's generator or the subclass? -- http://mail.python.org/mailman/listinfo/python-list

Re: restricted environment

2006-07-20 Thread Gabriele *darkbard* Farina
faulkner wrote: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496746 When you think of modifying the interpreter, think of the compiler module. This seems a good solutions. Does it works correctly and safely ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Warning when new attributes are added to classes at run time

2006-07-20 Thread Bruno Desthuilliers
Matthew Wilson wrote: I sometimes inadvertently create a new attribute on an object rather update a value bound to an existing attribute. For example: (snip) I meant to update c.a but I created a new c.A. I make this mistake probably hourly. I suspect adding attributes at run time can

Re: using names before they're defined

2006-07-20 Thread Iain King
[EMAIL PROTECTED] wrote: Iain, thanks - very helpful. Really I'm trying to write a simulation program that goes through a number of objects that are linked to one another and does calculations at each object. The calculations might be backwards or fowards (i.e. starting at the supply or

Re: Partial classes

2006-07-20 Thread Bruno Desthuilliers
Stefan Behnel wrote: Kay Schluehr wrote: What about letting your teammates editing certain data-structures in different files ( physical modules ) but using them in a uniform way and enable a single access point. If you have partial classes there is no reason why your team has to share a large

Re: Accessors in Python (getters and setters)

2006-07-20 Thread mystilleef
Steve Holden wrote: mystilleef wrote: [...] I don't know it's your code not mine. class Robust(object): def __init__(self): # Arbitrarily changing this state to False will crash app or will # corrupt the whole event system.

Re: function v. method

2006-07-20 Thread Bruno Desthuilliers
danielx wrote: Bruno Desthuilliers wrote: danielx wrote: (snip) which gets me thinking again about the stuff I self-censored. Since the dot syntax does something special and unexpected in my case, unexpected ? Did you ever wondered how the instance or class was passed as first arg when doing

Re: Detecting socket connection failure

2006-07-20 Thread Ben Sizer
[EMAIL PROTECTED] wrote: First, the proof that something is there and rejecting the connection (or is it that this thing actually accepts the connection and then drops it?)... Yes, it accepts it and then drops it, or perhaps drops it after receiving some data? It's not a failed or rejected

Re: Coding style

2006-07-20 Thread Antoon Pardon
On 2006-07-19, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On 19 Jul 2006 12:27:39 GMT, Antoon Pardon [EMAIL PROTECTED] declaimed the following in comp.lang.python: I once had a producer consumer code. When the client asked whether new items were available the function could return three

Re: how to know if socket is still connected

2006-07-20 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Grant Edwards wrote: If the server has closed the connection, then a recv() on the socket will return an empty string , and a send() on the socket will raise an exception. Would that still apply when trying to send an empty string? --

Re: Coding style

2006-07-20 Thread Bruno Desthuilliers
Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Bruno Desthuilliers wrote: Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Bob Greschke wrote: I'd go even one step further. Turn it into English (or your favorite non-computer language): 1. While list, pop. 2. While

Re: how to know if socket is still connected

2006-07-20 Thread Steve Holden
Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Grant Edwards wrote: If the server has closed the connection, then a recv() on the socket will return an empty string , and a send() on the socket will raise an exception. Would that still apply when trying to send an empty string?

Help Needed. Removing a Folder Problem

2006-07-20 Thread Kilicaslan Fatih
When I push a button to trigger the code: def run(self, event): cmd_out = self.A_com() if App.runF != : os.mkdir('C:\copiedFiles') for item in App.runF: App.beCopied = str(item)

Re: Augument assignment versus regular assignment

2006-07-20 Thread Antoon Pardon
On 2006-07-19, Terry Reedy [EMAIL PROTECTED] wrote: Antoon Pardon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] So IMV those preparation before the attachment, belong to whatever the interpreter does before it actually attaches an object to a name/slot. So the evaluation of

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Bruno Desthuilliers
mystilleef wrote: Bruno Desthuilliers wrote: mystilleef wrote: Bruno Desthuilliers wrote: mystilleef wrote: (snip) Of course using setters for the sake of just using them is pointless. Indeed. The reason to use them is if pre-conditions or post-conditions need to be met. Or to control

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Bruno Desthuilliers
Dennis Lee Bieber wrote: On Wed, 19 Jul 2006 18:54:55 +0200, Bruno Desthuilliers [EMAIL PROTECTED] declaimed the following in comp.lang.python: Indeed. And when you don't need too ? (the second 'o' is not a typo) Pardon, but for the sense you intend, it should be:

Bug? Certainly a new *behavior* from subprocess in 2.5 on Win32

2006-07-20 Thread Larry Hastings
I run the following script: -- from subprocess import * Popen(ls -l) -- (yeah, I have ls.exe on Windows) Under Python 2.4.2, this simply dumped the results of ls.exe to the terminal--sorry, to the command shell. Under Python 2.5, both beta 1 and beta 2, it dumps the results to the command shell,

Re: using names before they're defined

2006-07-20 Thread davehowey
Paddy, thanks for your mail. In Digital electronics we have what are called netlists, (and also component lists) yes, years back I did a 3rd year project on a 'logic simulator' which used the kind of thing you are talking about. I think spice does as well. Fortunately my problem is a little

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Gerhard Fiedler
On 2006-07-20 04:15:33, Steve Holden wrote: mystilleef wrote: [...] I don't know it's your code not mine. class Robust(object): def __init__(self): # Arbitrarily changing this state to False will crash app or will # corrupt the whole event system.

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Steve Holden
Gerhard Fiedler wrote: On 2006-07-20 04:15:33, Steve Holden wrote: mystilleef wrote: [...] I don't know it's your code not mine. class Robust(object): def __init__(self): # Arbitrarily changing this state to False will crash app or will # corrupt the whole

Re: wxPython: wxStaticBitmap and large images

2006-07-20 Thread Will McGugan
Roger Miller wrote: I have a WxPython app that displays images that are typically around 600x600 pixels. I use a wxStaticBitmap, which appears to work fine on Windows XP. However the documentation states that a StaticBitmap ... is meant for display of the small icons in the dialog boxes and

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Diez B. Roggisch
Lol. I actually did *un*learn the hard way. Mystilleef, I've started programing 17 years ago, and have done it professionnaly for almost 10 years now. I do not pretend to be a good programmer, but please believe that I do know my job. I've read the Book too, I've tried applying it blindly,

Re: using names before they're defined

2006-07-20 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: (snip) brings me onto another question that has been bugging me, which is, if I want to create components (as object instances) at run time (rather than through a python code imported in), how do I do this? i.e. if I hardcoded something like turbine1 = turbine(...)

Re: Recursive function returning a list

2006-07-20 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: Bruno Desthuilliers wrote: [EMAIL PROTECTED] wrote: [...] Sorry, but I kinda agree with Boris here. On what ? On the argument that you are (implicitly?) disagreeing with him it's getting messy - too much level of indirection !-) on, obviously. That the

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Bruno Desthuilliers
mystilleef wrote: (snip) __monitor_event is not supposed to be a write accessor. My point was show how you can change the state of an object internally without needing external access to it. Since some people are surprisingly claiming it is not possible. I failed to see anyone making such a

Re: questions to anyone who uses wxPython

2006-07-20 Thread [EMAIL PROTECTED]
damacy wrote: hello. i'm using wxPython as my GUI package and whenever my program executes a long process which takes at least 2 or 3 seconds, the user interface gets corrupted while executing the progrocess during the period. Hi Darnacy, I had the same issue and used wxProcess to run the

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Bruno Desthuilliers
Gerhard Fiedler wrote: (snip) I'm not sure, but there's one thing that has a potential to be the real issue: what's the common way to create a property that is read-write for the implementation and read-only for the interface? class Foo(object): @apply def _imp(): def fget(self):

Re: Depricated String Functions in Python

2006-07-20 Thread Anoop
Thanks Stefen let me be more specific how would i have to write the following function in the deprecated format map(string.lower,list) Thanks Anoop Stefan Behnel wrote: Anoop wrote: Can any one help me out with the various depricated string functions that is followed in Python. For

SOAPy Question

2006-07-20 Thread gregarican
I apologize in advance for not googling in depth enough :-) I am looking for use Python's SOAP implementation to pull some retail pricing data for a work project. Our Internet access goes through an authenticating proxy server. Can I access information in this scenario using SOAPy? I have seen

Checking File permissions

2006-07-20 Thread Anoop
Hi All Please tell me how to check the existence of a file and the read permission to the file using python script Thanks for ur inputs Anoop -- http://mail.python.org/mailman/listinfo/python-list

Checking File permissions

2006-07-20 Thread Anoop
Hi All Please tell me how to check the existence of a file and the read permission to the file using python script Thanks for ur inputs Anoop -- http://mail.python.org/mailman/listinfo/python-list

Checking File permissions

2006-07-20 Thread Anoop
Hi All Please tell me how to check the existence of a file and the read permission to the file using python script Thanks for ur inputs Anoop -- http://mail.python.org/mailman/listinfo/python-list

Re: Depricated String Functions in Python

2006-07-20 Thread Steve Holden
Anoop wrote: Thanks Stefen let me be more specific how would i have to write the following function in the deprecated format map(string.lower,list) To avoid the deprecated usage you would use the unbound method of the str type (that's the type of all strings): lst = ['Steve',

Re: Depricated String Functions in Python

2006-07-20 Thread Simon Forman
Anoop wrote: Thanks Stefen let me be more specific how would i have to write the following function in the deprecated format map(string.lower,list) Thanks Anoop Ah. This is easy enough: lower_list = [s.lower() for s in str_list] Or, if you really like map() (or really don't like list

Re: Depricated String Functions in Python

2006-07-20 Thread Duncan Booth
Anoop wrote: let me be more specific how would i have to write the following function in the deprecated format map(string.lower,list) What you just wrote is the deprecated format. There are plenty of ways to write it in an undeprecated format. The simplest is probably: [ s.lower()

Re: Accessors in Python (getters and setters)

2006-07-20 Thread mystilleef
Bruno Desthuilliers wrote: mystilleef wrote: Bruno Desthuilliers wrote: mystilleef wrote: Bruno Desthuilliers wrote: mystilleef wrote: (snip) Of course using setters for the sake of just using them is pointless. Indeed. The reason to use them is if pre-conditions

Encode filenames to safe format

2006-07-20 Thread Dara Durum
Hi !I want to encode filenames to safe format, like in browser url (space - %20, etc.).What the module and function name that helps me in this project ?Thanx for it:dd -- http://mail.python.org/mailman/listinfo/python-list

Re: Warning when new attributes are added to classes at run time

2006-07-20 Thread Matthew Wilson
On Thu 20 Jul 2006 04:32:28 AM EDT, Bruno Desthuilliers wrote: self.__dict__[name] = value Make it: object.__setattr__(self, name, value) Your approach will lead to strange results if you mix it with properties or other descriptors... Thanks! class

Re: question about what lamda does

2006-07-20 Thread nephish
hey thanks for that last post, although some of it was a bit over my head. i think i am getting more of the differences here. thanks again, sk danielx wrote: [EMAIL PROTECTED] wrote: Hey there, i have been learning python for the past few months, but i can seem to get what exactly a lamda

Re: Help Needed. Removing a Folder Problem

2006-07-20 Thread Larry Bates
Note the error is permission denied. I would guess that either the file has read-only flag set or perhaps the '' program is still running and has the file open in a separate thread so you can't delete the directory until it has completed. You should take a look at the subprocess module and

subprocess module

2006-07-20 Thread placid
Hi all, If someone could give me an example of creating a subprocess (on Windows) using the subprocess module and Popen class and connecting to its stdout/stdin file handles. I googled for a bit but the only example i found was here ;

Re: Warning when new attributes are added to classes at run time

2006-07-20 Thread Bruno Desthuilliers
Matthew Wilson wrote: On Thu 20 Jul 2006 04:32:28 AM EDT, Bruno Desthuilliers wrote: (snip) class C1(C): standard_attributes = ['a1', 'a2'] DRY violation here. And a potential problem with inheritance (as always with class attributes). Considering I had to look up what DRY

Re: Depricated String Functions in Python

2006-07-20 Thread riquito
Steve Holden ha scritto: Anoop wrote: Thanks Stefen let me be more specific how would i have to write the following function in the deprecated format map(string.lower,list) To avoid the deprecated usage you would use the unbound method of the str type (that's the type of all

Re: Checking File permissions

2006-07-20 Thread Avell Diroll
Anoop wrote: Please tell me how to check the existence of a file and the read permission to the file using python script You can check the os module (os.stat comes to mind). For an exemple you can have a look at : http://www.pixelbeat.org/talks/python/ls.py Regards, Avell --

Re: Checking File permissions

2006-07-20 Thread Larry Bates
Note: You really don't have to post the same question 3 times (2 in response to yourself). import os if os.path.exists(pathname): do something To see if a file is writeable: import stat def iswriteable(path): mode=os.stat(path)[stat.ST_mode] return bool(stat.S_IMODE(mode)

Py2exe (Py)QT4

2006-07-20 Thread shane . external
I'm having trouble using Py2exe with a PyQT-based python project. Or possibly I'm having a problem with PyQT and Py2exe makes it apparent. Whichever it is, I run into trouble with importing QtCore and QtGui. The error reported is: Traceback (most recent call last): File xmlEdit.py, line 3, in

Re: SOAPy Question

2006-07-20 Thread gregarican
Please disregard, as I googled my way to the answer. I used SOAPProxy to specify the information I needed to get out to the external SOAP service. All is well and away we go :-) gregarican wrote: I apologize in advance for not googling in depth enough :-) I am looking for use Python's SOAP

Re: Help Needed. Removing a Folder Problem

2006-07-20 Thread Kilicaslan Fatih
--- Larry Bates [EMAIL PROTECTED] wrote: Note the error is permission denied. I would guess that either the file has read-only flag set or perhaps the '' program is still running and has the file open in a separate thread so you can't delete the directory until it has completed.

Re: Encode filenames to safe format

2006-07-20 Thread Amit Khemka
On 7/20/06, Dara Durum [EMAIL PROTECTED] wrote: Hi ! I want to encode filenames to safe format, like in browser url (space - %20, etc.). What the module and function name that helps me in this project ? import urllib urllib.quote('file name') cheers, amit -- Amit Khemka --

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Bruno Desthuilliers
mystilleef wrote: Bruno Desthuilliers wrote: (snip) You use accessors when you need to control access to a data attribute. Indeed. And when you don't need too ? (the second 'o' is not a typo) You make the attribute private/protected. doh :( Let's talk about psychorigid mindset...

Re: text representation of HTML

2006-07-20 Thread garabik-news-2005-05
Ksenia Marasanova [EMAIL PROTECTED] wrote: Hi, I am looking for a library that will give me very simple text representation of HTML. For example divh1Title/h1pThis is a br /test/p/div will be transformed to: Title This is a test i want to send plain text alternative of html

Re: question about what lamda does

2006-07-20 Thread Bruno Desthuilliers
danielx wrote: (snip) Python's lambda really can't be as powerful as Lisp's because Python does not have expressions that do case analysis (this is not lambda's fault, of course ;). The reason is that you really want to put each case on its own set of lines. This enhances readability at the

Re: text representation of HTML

2006-07-20 Thread Duncan Booth
Ksenia Marasanova wrote: I am looking for a library that will give me very simple text representation of HTML. For example divh1Title/h1pThis is a br /test/p/div will be transformed to: Title This is a test i want to send plain text alternative of html email, and would prefer

Re: range() is not the best way to check range?

2006-07-20 Thread Alex Martelli
Paul Boddie [EMAIL PROTECTED] wrote: John Machin wrote: range() and xrange() are functions. You are suggesting that 2 *functions* should acquire a __contains__ method each? I trust not. Well, range is a function in the current implementation, although its usage is similar to that one

Note on PEP 299

2006-07-20 Thread bearophileHUGS
I don't like much the syntax of: if __name__ == '__main__': Some time ago I have read this PEP: http://www.python.org/dev/peps/pep-0299/ And why it was refused: http://mail.python.org/pipermail/python-dev/2006-March/062955.html I think the name of the standard main function may be just main(),

Re: range() is not the best way to check range?

2006-07-20 Thread Paul Boddie
Alex Martelli wrote: Paul Boddie [EMAIL PROTECTED] wrote: Well, range is a function in the current implementation, although its usage is similar to that one would get if it were a class, particularly a subclass of list or one providing a list-style interface. With such a class, you

Re: Python linker

2006-07-20 Thread Alex Martelli
Ben Sizer [EMAIL PROTECTED] wrote: Sion Arrowsmith wrote: Er, what? How are you generating your standalone executables? What size is acceptable? python24.dll is only 1.8M -- surely on any non-embedded platform these days 1.8M isn't worth bothering about. And since you mention wx (all of

Re: Help Needed. Removing a Folder Problem(Problem Solved)

2006-07-20 Thread Kilicaslan Fatih
--- Larry Bates [EMAIL PROTECTED] wrote: Note the error is permission denied. I would guess that either the file has read-only flag set or perhaps the '' program is still running and has the file open in a separate thread so you can't delete the directory until it has completed.

Re: Help Needed. Removing a Folder Problem(Problem Solved)

2006-07-20 Thread Kilicaslan Fatih
--- Larry Bates [EMAIL PROTECTED] wrote: Note the error is permission denied. I would guess that either the file has read-only flag set or perhaps the '' program is still running and has the file open in a separate thread so you can't delete the directory until it has completed.

Re: Help Needed. Removing a Folder Problem(Problem Solved)

2006-07-20 Thread Kilicaslan Fatih
--- Larry Bates [EMAIL PROTECTED] wrote: Note the error is permission denied. I would guess that either the file has read-only flag set or perhaps the '' program is still running and has the file open in a separate thread so you can't delete the directory until it has completed.

Re: Python linker

2006-07-20 Thread Alex Martelli
[EMAIL PROTECTED] wrote: I develop shareware applications that need to be extremely slim (less than 1 MB is preferable). Delphi applications easily meet this requirement and I can expect end users to download the .NET framework (if they don't already have it!). However, I cannot expect

Re: range() is not the best way to check range?

2006-07-20 Thread Alex Martelli
Paul Boddie [EMAIL PROTECTED] wrote: Alex Martelli wrote: Paul Boddie [EMAIL PROTECTED] wrote: Well, range is a function in the current implementation, although its usage is similar to that one would get if it were a class, particularly a subclass of list or one providing a

Re: Question regarding commit/backout of a message using the pymqi module

2006-07-20 Thread JonS
Andrew Robert wrote: Hi everyone, Could someone help explain what I am doing wrong in this code block? This code block is an excerpt from a larger file that receives transmitted files via IBM WebSphere MQSeries an drops it to the local file system. Transmission of the file works as

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Diez B. Roggisch
You mean: class Pythonic(object): def __init__(self): self._is_active = True @apply def is_active(): def fget(self): return self._is_active def fset(self): raise SomeException('sorry, read-only') return property(**locals()) Neat! That slipped my

Re: Accessors in Python (getters and setters)

2006-07-20 Thread mystilleef
Bruno Desthuilliers wrote: mystilleef wrote: Bruno Desthuilliers wrote: (snip) You use accessors when you need to control access to a data attribute. Indeed. And when you don't need too ? (the second 'o' is not a typo) You make the attribute private/protected. doh :( Let's

strange error when importing a module

2006-07-20 Thread Robin Becker
I'm trying to understand the following strangeness C:\code\rlextra\erspython Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. from rlextra.utils.SimpleXMLRPCServer import SimpleXMLRPCServer Traceback

Re: Depricated String Functions in Python

2006-07-20 Thread Donn Cave
In article [EMAIL PROTECTED], Steve Holden [EMAIL PROTECTED] wrote: Anoop wrote: Thanks Stefen let me be more specific how would i have to write the following function in the deprecated format map(string.lower,list) To avoid the deprecated usage you would use the unbound

Re: Coding style

2006-07-20 Thread Donn Cave
In article [EMAIL PROTECTED], Antoon Pardon [EMAIL PROTECTED] wrote: On 2006-07-19, Donn Cave [EMAIL PROTECTED] wrote: ... http://groups.google.com/group/comp.lang.python/msg/2de5e1c8384c0360 It's lengthy but very readable, and for me it has that quality of exposition where you feel at

Re: text representation of HTML

2006-07-20 Thread Tim Williams
On 20 Jul 2006 15:12:27 GMT, Duncan Booth [EMAIL PROTECTED] wrote: Ksenia Marasanova wrote: i want to send plain text alternative of html email, and would prefer to do it automatically from HTML source. Any hints? Use htmllib: import htmllib, formatter, StringIO def cleanup(s):

Re: strange error when importing a module

2006-07-20 Thread Robin Becker
Robin Becker wrote: I'm trying to understand the following strangeness C:\code\rlextra\erspython Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. from rlextra.utils.SimpleXMLRPCServer import

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Bruno Desthuilliers
mystilleef wrote: Bruno Desthuilliers wrote: point 2 : so anyone *can* illegimately tampering with an object's internal data at will. And this is robust how? You can do just the same in Java or C++. OMG! It's common knowledge. I ask how your solution is robust, This is definitively

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Ant
Came across this article this afternoon - thought it may be of interest to some of those following this thread... http://www.devx.com/opensource/Article/31593/0/page/2 -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Gerhard Fiedler
On 2006-07-20 09:40:31, Bruno Desthuilliers wrote: I'm not sure, but there's one thing that has a potential to be the real issue: what's the common way to create a property that is read-write for the implementation and read-only for the interface? class Foo(object): @apply def

Using python code from Java?

2006-07-20 Thread fortepianissimo
Is there a solution to enable Java programmers to call functions written in Python? Any wrapper generator that wraps Python code into some Java-callable form? I briefly looked at Jython, but if I understand it right, it didn't support full power of Python 2.3.x (which I need). Any suggestion is

Re: Warning when new attributes are added to classes at run time

2006-07-20 Thread Nick Vatamaniuc
Use __slots__ they will simply give you an error. But at the same time I don't think they are inheritable and in general you should only use slots for performance reasons (even then test before using). Or you could also simulate a __slots__ mechanism the way you are doing i.e. checking the

Re: Using python code from Java?

2006-07-20 Thread Diez B. Roggisch
fortepianissimo schrieb: Is there a solution to enable Java programmers to call functions written in Python? Any wrapper generator that wraps Python code into some Java-callable form? I briefly looked at Jython, but if I understand it right, it didn't support full power of Python 2.3.x

ConfigParser: what read('non-existent-filename') returns in 2.3.x?

2006-07-20 Thread Danil Dotsenko
Wrote a little user-friedly wrapper for ConfigParser for a KDE's SuperKaramba widget. (http://www.kde-look.org/content/show.php?content=32185) I was using 2.4.x python docs as reference and ConfigParser.read('non-existent-filename') returns [] in 2.4.x One user with 2.3.x reported an error

Re: Using python code from Java?

2006-07-20 Thread fortepianissimo
Diez B. Roggisch wrote: fortepianissimo schrieb: Is there a solution to enable Java programmers to call functions written in Python? Any wrapper generator that wraps Python code into some Java-callable form? I briefly looked at Jython, but if I understand it right, it didn't support

  1   2   >