ANN: Schevo 3.0-beta1 released

2005-11-03 Thread Matthew Scott
== Schevo 3.0-beta1 == -- Release Announcement -- Also available at http://schevo.org/latest/release/announcements/3.0-beta1.html What's new in version 3.0-beta1? * Initial release of

when and how do you use Self?

2005-11-03 Thread Tieche Bruce A MSgt USMTM/AFD
I am new to python, Could someone explain (in English) how and when to use self? I have been reading, and haven't found a good example/explanation Bruce Tieche ([EMAIL PROTECTED]) -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting a function name from string

2005-11-03 Thread Bengt Richter
On Wed, 02 Nov 2005 19:01:46 -0500, Mike Meyer [EMAIL PROTECTED] wrote: Paul McGuire [EMAIL PROTECTED] writes: David Rasmussen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] If I have a string that contains the name of a function, can I call it? As in: def someFunction(): print

Re: Microsoft Hatred FAQ

2005-11-03 Thread W.H.Offenbach
John W. Kennedy wrote: IBM was genuinely innovative, and did their best to provide value for money. Microsoft hasn't been able to produce anything but me-too products since the 80's. (Multiplan, Word for DOS, the QBASIC engine, early sponsorship of mouses, and the gutsy decision to morph

Re: when and how do you use Self?

2005-11-03 Thread Fredrik Lundh
Tieche Bruce A MSgt USMTM/AFD [EMAIL PROTECTED] wrote: Could someone explain (in English) how and when to use self? I have been reading, and haven't found a good example/explanation consider a class C: class C: ... def method(self): ... print self ... C

Re: when and how do you use Self?

2005-11-03 Thread bruno at modulix
Tieche Bruce A MSgt USMTM/AFD wrote: I am new to python, Could someone explain (in English) how and when to use self? Don't use self. Use other. -- bruno desthuilliers python -c print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')]) --

Re: how to write a blog system with Python

2005-11-03 Thread bruno at modulix
ice wrote: I am a fresh here , and I have no idea of it. Do you have any comments? Learn Python Learn web programming Write the specs for your blog system Design the solution Implement it -- bruno desthuilliers python -c print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in

Re: Python and MySQL

2005-11-03 Thread Aquarius
I am also have _mysql.c that has to be compiled. I downloaded 1.2.0 from here http://sourceforge.net/project/showfiles.php?group_id=22307package_id=15775 (the .tar.gz). Do you mean, that if I drop the import _mysql and from _mysql import ... lines everything will work OK? I private install would

OT - Re: Microsoft Hatred FAQ

2005-11-03 Thread Tim Daneliuk
David Blomstrom wrote: Everytime someone compares MS's behavior with some less controversial criminal behavior, you act like they accused MS of holding people up at gunpoint. Screwing literally millions of consumers and taxpayers and holding entire schools hostage is far worse than

Re: how to write a blog system with Python

2005-11-03 Thread Sybren Stuvel
ice enlightened us with: I am a fresh here , and I have no idea of it. Do you have any comments? Look up turbogears and watch the 20 minute Wiki video tutorial. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we

Class Variable Access and Assignment

2005-11-03 Thread Graham
This has to do with class variables and instances variables. Given the following: code class _class: var = 0 #rest of the class instance_b = _class() _class.var=5 print instance_b.var # - 5 print _class.var # - 5 /code Initially this seems to make sense,

Class Variable Access and Assignment

2005-11-03 Thread Graham
This has to do with class variables and instances variables. Given the following: code class _class: var = 0 #rest of the class instance_b = _class() _class.var=5 print instance_b.var # - 5 print _class.var # - 5 /code Initially this seems to make sense,

typo in the documentation or am I stupid?

2005-11-03 Thread Tommy . Ryding
In the embedding Python manual at Python.org an example is presented that uses the function: PyDict_GetAttrString. Is it possible that this is a typo? I have searched the source code and I can't find it, I have also used google and I only get 4 hits. In for example Programming Python another

Re: Class Variable Access and Assignment

2005-11-03 Thread Eric Nieuwland
Graham wrote: code class _class: var = 0 #rest of the class instance_b = _class() _class.var=5 print instance_b.var # - 5 print _class.var # - 5 /code [...] code instance_b.var = 1000 # - _class.var = 5 _class.var = # - _class.var

Unicode string and metakit database

2005-11-03 Thread Tony
I write a database application with Metakit. My script is like the following: ... vw = db.getas(t1[no:I,ch:S,code1:S,code2:S]) ... *vw.append(no=i,ch=x,code1=y[0],code2=y[1]) ... But errors occured on * and it displayed TypeError: not a Python string. x, y[0], y[1] are unicode strings. Doesn't

Re: Class Variable Access and Assignment

2005-11-03 Thread Steven D'Aprano
On Thu, 03 Nov 2005 01:43:32 -0800, Graham wrote: [snip] print instance_b.var # - 5 print _class.var # - 5 /code Initially this seems to make sense, note the difference between to last two lines, one is refering to the class variable 'var' via the class while the other refers

Re: Class Variable Access and Assignment

2005-11-03 Thread Jorge Godoy
Graham [EMAIL PROTECTED] writes: perhaps this was intended, i was just wondering if anyone else had noticed it, and if so what form would you consider to be 'proper' either referring to class variables via the class itself or via instances of that class. Any response would be greatly

strtok equvialent ?

2005-11-03 Thread [EMAIL PROTECTED]
Hi, are there a strtok equivalent in python ? str.split() only takes single seperator. -- http://mail.python.org/mailman/listinfo/python-list

Re: typo in the documentation or am I stupid?

2005-11-03 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote_ In the embedding Python manual at Python.org an example is presented that uses the function: PyDict_GetAttrString. Is it possible that this is a typo? according to this checkin message (fix stupid typo), the answer is yes:

Re: strtok equvialent ?

2005-11-03 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: are there a strtok equivalent in python ? str.split() only takes single seperator. use a regular expression split with a character group: s = breakfast=spam+egg-bacon import re re.split([-+=], s) ['breakfast', 'spam', 'egg', 'bacon'] to deal with

Anomaly in creating class methods

2005-11-03 Thread venk
Hi, given below is my interaction with the interpreter In one case, i have created the class method using the famous idiom... and in the other, i have tried to create it outside the class definition... why isn't the latter working ? (of course, the presence of decorators is a different

Re: strtok equvialent ?

2005-11-03 Thread [EMAIL PROTECTED]
thanks. Fredrik Lundh wrote: [EMAIL PROTECTED] wrote: are there a strtok equivalent in python ? str.split() only takes single seperator. use a regular expression split with a character group: s = breakfast=spam+egg-bacon import re re.split([-+=], s) ['breakfast',

shared library search path

2005-11-03 Thread Stefan Arentz
Hi. I've wrapped a C++ class with Boost.Python and that works great. But, I am now packaging my application so that it can be distributed. The structure is basically this: .../bin/foo.py .../lib/foo.so .../lib/bar.py In foo.py I do the following:

problem with async_chat

2005-11-03 Thread rix
Hi there, I am writing an application that requires a client-server interaction. Looking up on the internet and working on it I came up with something like this: a class ADFSServer that takes inbound connections and dispatches them to ADFSReceiver. The connection is always initialized by

NTFS reparse points

2005-11-03 Thread Stanislaw Findeisen
I want to create a reparse point on NTFS (any). Here (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/reparse_points.asp) I read: reparse points are used to implement NTFS file system links. Here

Re: Python's website does a great disservice to the language

2005-11-03 Thread Steve Holden
Alex Martelli wrote: The Eternal Squire [EMAIL PROTECTED] wrote: ... 2) Consider what he really wants for a supervisor of software engineers. Ideally such a person should be a software engineer with at least 3 times the experience of the most junior member. Such a I like the

How to read all files in a directory

2005-11-03 Thread hungbichvo
Dear All, My python application is small. It reads data from a file. My code is: fileName = '900128.DAT' dataFile = open(fileName, 'r').readlines() I have to run 100 input files .DAT. Each time I run application, I have to change code fileName to a new one. For example, fileName =

Re: Class Variable Access and Assignment

2005-11-03 Thread Antoon Pardon
Op 2005-11-03, Steven D'Aprano schreef [EMAIL PROTECTED]: There are two possible fixes, either by prohibiting instance variables with the same name as class variables, which would allow any reference to an instance of the class assign/read the value of the variable. Or to only allow class

Re: How to read all files in a directory

2005-11-03 Thread Stefan Arentz
hungbichvo [EMAIL PROTECTED] writes: Dear All, My python application is small. It reads data from a file. My code is: fileName = '900128.DAT' dataFile = open(fileName, 'r').readlines() I have to run 100 input files .DAT. Each time I run application, I have to change code fileName

Re: Class Variable Access and Assignment

2005-11-03 Thread Stefan Arentz
Antoon Pardon [EMAIL PROTECTED] writes: Op 2005-11-03, Steven D'Aprano schreef [EMAIL PROTECTED]: There are two possible fixes, either by prohibiting instance variables with the same name as class variables, which would allow any reference to an instance of the class assign/read the

Getting Python Accepted in my Organisation

2005-11-03 Thread Stuart Turner
Hi Everyone, I'm working hard trying to get Python 'accepted' in the organisation I work for. I'm making some good in-roads. One chap sent me the text below on his views of Python. I wondered if anyone from the group could give me some advice on how to respond / if they had been in a similar

Re: Getting Python Accepted in my Organisation

2005-11-03 Thread Stefan Arentz
Stuart Turner [EMAIL PROTECTED] writes: Hi Everyone, I'm working hard trying to get Python 'accepted' in the organisation I work for. I'm making some good in-roads. One chap sent me the text below on his views of Python. I wondered if anyone from the group could give me some advice on

Re: Getting Python Accepted in my Organisation

2005-11-03 Thread Stuart Turner
I'm already using it for a ton of things - I want to try and get broader acceptance in the organisation for it to be made and 'officially supported product'. Stefan Arentz wrote: Stuart Turner [EMAIL PROTECTED] writes: Hi Everyone, I'm working hard trying to get Python 'accepted' in the

Re: Class Variable Access and Assignment

2005-11-03 Thread Steve Holden
Antoon Pardon wrote: Op 2005-11-03, Steven D'Aprano schreef [EMAIL PROTECTED]: There are two possible fixes, either by prohibiting instance variables with the same name as class variables, which would allow any reference to an instance of the class assign/read the value of the variable. Or to

Re: Getting Python Accepted in my Organisation

2005-11-03 Thread Stefan Arentz
Stuart Turner [EMAIL PROTECTED] writes: I'm already using it for a ton of things - I want to try and get broader acceptance in the organisation for it to be made and 'officially supported product'. IMO that is what you need to communicate: 'already using it for a ton of things' and probably

Re: OT - Re: Microsoft Hatred FAQ

2005-11-03 Thread Steven D'Aprano
On Thu, 03 Nov 2005 04:34:20 -0500, Tim Daneliuk wrote: A) I don't much care if people wander off topic from time to time - that's what filters are for. But as a matter of general courtesy is it too much to ask that the subject line be so marked? Fair enough. B) Rhetoric is not

Re: OT - Re: Microsoft Hatred FAQ

2005-11-03 Thread Jerzy Karczmarczuk
Steven D'Aprano wrote: Jaywalking is a crime. So is littering. So is merely belonging to certain organisations, such as the German Nazi party or any number of allegedly terrorist groups. Walking around naked in public is a crime, and in many places in the world, including the USA, you then

Re: Class Variable Access and Assignment

2005-11-03 Thread Antoon Pardon
Op 2005-11-03, Stefan Arentz schreef [EMAIL PROTECTED]: Antoon Pardon [EMAIL PROTECTED] writes: Op 2005-11-03, Steven D'Aprano schreef [EMAIL PROTECTED]: There are two possible fixes, either by prohibiting instance variables with the same name as class variables, which would allow any

Re: Class Variable Access and Assignment

2005-11-03 Thread Paul Rubin
Steve Holden [EMAIL PROTECTED] writes: class A: a = 1 b = A() b.a += 2 print b.a print A.a Which results in 3 1 I don't suppose you'd care to enlighten us on what you'd regard as the superior outcome? class A: a = [] b = A() b.append(3) print b.a

Re: Class Variable Access and Assignment

2005-11-03 Thread Steven D'Aprano
On Thu, 03 Nov 2005 11:55:06 +, Antoon Pardon wrote: No matter wat the OO model is, I don't think the following code exhibits sane behaviour: class A: a = 1 b = A() b.a += 2 print b.a print A.a Which results in 3 1 Seems perfectly sane to me. What would you expect to

wxGlade will not run on my machine

2005-11-03 Thread LenS
I have installed wxGlade on a MS XP machine. It executed on completion of the install. However, when I try to double click on the wxGlade icon to start nothing happens. I searched the NG and found that this had been report before but no solution was posted. I am running the following

Re: Class Variable Access and Assignment

2005-11-03 Thread Stefan Arentz
Antoon Pardon [EMAIL PROTECTED] writes: ... No matter wat the OO model is, I don't think the following code exhibits sane behaviour: class A: a = 1 b = A() b.a += 2 print b.a print A.a Which results in 3 1 I find it confusing at first, but I do understand

Release of PyPy 0.8.0

2005-11-03 Thread Carl Friedrich Bolz
pypy-0.8.0: Translatable compiler/parser and some more speed == The PyPy development team has been busy working and we've now packaged our latest improvements, completed work and new experiments as version 0.8.0, our third public

Re: how to write a blog system with Python

2005-11-03 Thread ice
Thanks for all your comments. What I wanted is a chance to practise my programming talents with Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: Class Variable Access and Assignment

2005-11-03 Thread Steve Holden
Paul Rubin wrote: Steve Holden [EMAIL PROTECTED] writes: class A: a = 1 b = A() b.a += 2 print b.a print A.a Which results in 3 1 I don't suppose you'd care to enlighten us on what you'd regard as the superior outcome? class A: a = [] b = A() b.append(3) print

Re: Class Variable Access and Assignment

2005-11-03 Thread Antoon Pardon
Op 2005-11-03, Stefan Arentz schreef [EMAIL PROTECTED]: Antoon Pardon [EMAIL PROTECTED] writes: ... No matter wat the OO model is, I don't think the following code exhibits sane behaviour: class A: a = 1 b = A() b.a += 2 print b.a print A.a Which results in 3

Re: Filepath string manipulation help

2005-11-03 Thread mjakowlew
Thanks guys. The os.path method works, but this is for a script for a website upload program on a zope webserver. For some reason even admin access won't let me run the script through the server. The main issue with my script is that Firefox has no problem with the program the way it is, but IE

Re: [OT] Gmane/Tunderbird users: is g.c.p.general too big?

2005-11-03 Thread Steve Holden
Robert Kern wrote: Steve Holden wrote: Sorry about this almost off-topic post, but I am guessing there must be other readers of this group who use Thunderbird (in my case 1.0.2) to access it as gmane.comp.general.python. I'm currently showing 344,548 articles in the group due to the gmane

Re: Class Variable Access and Assignment

2005-11-03 Thread Antoon Pardon
Op 2005-11-03, Steven D'Aprano schreef [EMAIL PROTECTED]: On Thu, 03 Nov 2005 11:55:06 +, Antoon Pardon wrote: No matter wat the OO model is, I don't think the following code exhibits sane behaviour: class A: a = 1 b = A() b.a += 2 print b.a print A.a Which results in 3

Re: XML DOM: XML/XHTML inside a text node

2005-11-03 Thread Paul Boddie
Roman Suzi wrote: On Thu, 2 Nov 2005 [EMAIL PROTECTED] wrote: Is there a better way? What about parsing the input into XML first? Is there any point in including unescaped code into XML document unless it is XML itself? Indeed. My approach would be to parse the user's input using the

Re: Getting Python Accepted in my Organisation

2005-11-03 Thread Kay Schluehr
Stefan Arentz wrote: Stuart Turner [EMAIL PROTECTED] writes: I'm already using it for a ton of things - I want to try and get broader acceptance in the organisation for it to be made and 'officially supported product'. IMO that is what you need to communicate: 'already using it for a

Re: Python for .NET and IronPython

2005-11-03 Thread Luis M. Gonzalez
I just want to clarify that the above mentioned web site (www.ironpython.com) is no longer maintained. If you want to get updated information on IronPython, you should visit this site: www.gotdotnet.com/Workspaces/Workspace. aspx?id=ad7acff7-ab1e-4bcb-99c0-57ac5a3a9742 Or the mailing list here:

Re: Getting Python Accepted in my Organisation

2005-11-03 Thread Steve Holden
Stuart Turner wrote: Hi Everyone, I'm working hard trying to get Python 'accepted' in the organisation I work for. I'm making some good in-roads. One chap sent me the text below on his views of Python. I wondered if anyone from the group could give me some advice on how to respond / if

Re: Class Variable Access and Assignment

2005-11-03 Thread Antoon Pardon
Op 2005-11-03, Steve Holden schreef [EMAIL PROTECTED]: Antoon Pardon wrote: Op 2005-11-03, Steven D'Aprano schreef [EMAIL PROTECTED]: There are two possible fixes, either by prohibiting instance variables with the same name as class variables, which would allow any reference to an instance

__slots__ and class attributes

2005-11-03 Thread Ewald R. de Wit
I'm running into a something unexpected for a new-style class that has both a class attribute and __slots__ defined. If the name of the class attribute also exists in __slots__, Python throws an AttributeError. Is this by design (if so, why)? class A( object ): __slots__ = ( 'value', )

Re: Class Variable Access and Assignment

2005-11-03 Thread Sybren Stuvel
Antoon Pardon enlightened us with: I would expect a result consistent with the fact that both times b.a would refer to the same object. b.a is just a name, not a pointer to a spot in memory. Getting the value associated with that name is something different from assigning a new value to that

Re: Getting Python Accepted in my Organisation

2005-11-03 Thread [EMAIL PROTECTED]
How about, Google use python extensively ? This I believe is a very strong argument for any concern about python. However, policy in organisations can be very funny and many of them may be set long time ago which even though may no longer be relavent are still policy. I would suggest focus on

Re: Class Variable Access and Assignment

2005-11-03 Thread venk
You see, The seen behavior is due to the result of python's name binding,scoping scheme. Let me give you an example, class A: i=0 def t(self): print self.i self.i=4 then a=A() a.i is 0 a.t() then, A.i is 0 a.i is 4 In the function, it first searches

Re: Python for .NET and IronPython

2005-11-03 Thread Gerard Flanagan
John Salerno wrote: Hi all. I'm currently learning C#, and I'm also interested in learning Python In a similar position to yourself - learning both languages - I can definitely recommend Python ( though C# 's curly brackets might annoy you more than they did before!!) so it seems like a

Re: Class Variable Access and Assignment

2005-11-03 Thread Antoon Pardon
Op 2005-11-03, venk schreef [EMAIL PROTECTED]: You see, The seen behavior is due to the result of python's name binding,scoping scheme. I know what causes the behaviour. But I still think it is not sane behaviour. ... the same thing happens in the case of b.a = b.a + 2 search

installing PygreSQL and psychopg2 modules (a newbie question)

2005-11-03 Thread Zlatko Matić
Hello. I was trying to install PygreSQL and psychopg2 in order to use python as front-end for PostgreSQL, on WIndows XP. When I tried to install by calling setup.py from command prompt ("setup.py install"), in both cases I had the same error: "error: Python was built with version 7.1 of

Re: Class Variable Access and Assignment

2005-11-03 Thread Antoon Pardon
Op 2005-11-03, Sybren Stuvel schreef [EMAIL PROTECTED]: Antoon Pardon enlightened us with: I would expect a result consistent with the fact that both times b.a would refer to the same object. b.a is just a name, not a pointer to a spot in memory. Getting the value associated with that name

Re: OT - Re: Microsoft Hatred FAQ

2005-11-03 Thread venk
Hi, Though out of the streamline, I find your post to be one of the most reasonable and well-formed arguments I have read in a long time. Keep it up. Great work. Steven D'Aprano wrote: Real standards, like TCP/IP which is the backbone of the Internet, aren't controlled by any one company. Anyone

Re: Class Variable Access and Assignment

2005-11-03 Thread Stefan Arentz
Antoon Pardon [EMAIL PROTECTED] writes: Op 2005-11-03, venk schreef [EMAIL PROTECTED]: You see, The seen behavior is due to the result of python's name binding,scoping scheme. I know what causes the behaviour. But I still think it is not sane behaviour. ... the same

Re: Most efficient way of storing 1024*1024 bits

2005-11-03 Thread Alex Stapleton
On 3 Nov 2005, at 05:03, Alex Martelli wrote: Brandon K [EMAIL PROTECTED] wrote [inverting his topposting!]: Six megabytes is pretty much nothing on a modern computer. BTW, it'd be 6 megabits or 750kb ;) ...but Mike was proposing using one digit per bit, hence, 6 megabytes. That

Re: Class Variable Access and Assignment

2005-11-03 Thread venk
hey, did u read my reply fully? i too feel that this matter of raising unbound local error in one case and not raising it in the other must be analysed... quoting from the documentation If a name binding operation occurs anywhere within a code block, all uses of the name within the block are

Re: Getting Python Accepted in my Organisation

2005-11-03 Thread Roy Smith
Stuart Turner [EMAIL PROTECTED] wrote: Python is a scripting language like Perl, awk, tcl, Java etc... It is difficult to say whether Python is a scripting language or not until you define what you mean by scripting language. People throw the term scripting language around with wild abandon

Re: Class Variable Access and Assignment

2005-11-03 Thread Eric Nieuwland
Stefan Arentz wrote: It is really simple. When you say b.a then the instance variable 'a' is looked up first. If it does not exist then a class variable lookup is done. This mixing of class and instance variable might be the cause of confusion... I think of it as follows: 1 When the class

sizers in boa constructors

2005-11-03 Thread Ashok
hi, I am trying to build a small gui program in python using boa constructor. i have a few problems. i would be grateful if anyone can help me in this regard. 1. i have four static text controls positioned one below the other. what i want to do is when i change the content of the upper static text

Re: Python and MySQL

2005-11-03 Thread Sion Arrowsmith
Aquarius [EMAIL PROTECTED] wrote: I want to know if there is a way to interface a MySQL database without Python-MySQL or without installing anything that has C files that need to be compiled. The reason for this, is that I want to develop a certain web application, but my hosting provider ([EMAIL

Re: Getting Python Accepted in my Organisation

2005-11-03 Thread Eric Nieuwland
Stuart Turner wrote: Python is a scripting language like Perl, awk, tcl, Java etc...  it is not quite a fully developed OO language, but does support some OO that Perl doesn't.  To be clear, these scripting languages have their place in our environment, but they are not full

Re: Class Variable Access and Assignment

2005-11-03 Thread Antoon Pardon
Op 2005-11-03, Stefan Arentz schreef [EMAIL PROTECTED]: Antoon Pardon [EMAIL PROTECTED] writes: Op 2005-11-03, venk schreef [EMAIL PROTECTED]: You see, The seen behavior is due to the result of python's name binding,scoping scheme. I know what causes the behaviour. But I still

Re: shared library search path

2005-11-03 Thread Neal Becker
Stefan Arentz wrote: Hi. I've wrapped a C++ class with Boost.Python and that works great. But, I am now packaging my application so that it can be distributed. The structure is basically this: .../bin/foo.py .../lib/foo.so .../lib/bar.py In foo.py I do the following:

Re: Class Variable Access and Assignment

2005-11-03 Thread venk
Again (blink) quoting from the docs For targets which are attribute references, the initial value is retrieved with a getattr() and the result is assigned with a setattr(). Notice that the two methods do not necessarily refer to the same variable. When getattr() refers to a class variable,

Re: Forcing the position of scroll bars on a wxTextCtrl

2005-11-03 Thread Magnus Lycka
Clans Of Intrigue wrote: Thanks, that did the trick perfectly :) also got rid of the self._log member so the class is now just: class LogControl: Simple helper to redirect stdout to a panel in the GUI def __init__( self, textCtrl ): self._ctrl = textCtrl

Re: computer programming

2005-11-03 Thread Magnus Lycka
Brandon K wrote: what is .tk? Turkmenistan? or is it just some arbitrary suffix. Nope that's tm. Tokelau has tk. I'm sure you can learn more from Wikipedia etc. See e.g. http://en.wikipedia.org/wiki/ISO_3166-1 www.javaholics.tk == Posted via Newsgroups.com - Usenet Access to

Re: installing PygreSQL and psychopg2 modules (a newbie question)

2005-11-03 Thread Tom Brown
On Wednesday 02 November 2005 14:10, Zlatko Matić wrote: Hello. I was trying to install PygreSQL and psychopg2 in order to use python as front-end for PostgreSQL, on WIndows XP. When I tried to install by calling setup.py from command prompt (setup.py install), in both cases I had the same

Re: Class Variable Access and Assignment

2005-11-03 Thread Stefan Arentz
Antoon Pardon [EMAIL PROTECTED] writes: ... Fine, we have the code: b.a += 2 We found the class variable, because there is no instance variable, then why is the class variable not incremented by two now? Because it really is executed as: b.a = b.a + 2 1. get 't'b.a and store it

Re: Class Variable Access and Assignment

2005-11-03 Thread Stefan Arentz
Stefan Arentz [EMAIL PROTECTED] writes: Antoon Pardon [EMAIL PROTECTED] writes: ... Fine, we have the code: b.a += 2 We found the class variable, because there is no instance variable, then why is the class variable not incremented by two now? Because it really is

Re: Class Variable Access and Assignment

2005-11-03 Thread Antoon Pardon
Op 2005-11-03, venk schreef [EMAIL PROTECTED]: hey, did u read my reply fully? i too feel that this matter of raising unbound local error in one case and not raising it in the other must be analysed... Yes, it seems I didn't respond to your satisfaction, but since you don't provide details

Re: installing PygreSQL and psychopg2 modules (a newbie question)

2005-11-03 Thread Robert Boyd
On 11/2/05, Zlatko Matić [EMAIL PROTECTED] wrote: I was trying to install PygreSQL and psychopg2 in order to use python as front-end for PostgreSQL, on WIndows XP. When I tried to install by calling setup.py from command prompt (setup.py install), in both cases I had the same error:

Re: Class Variable Access and Assignment

2005-11-03 Thread Steven D'Aprano
On Thu, 03 Nov 2005 04:30:09 -0800, Paul Rubin wrote: Steve Holden [EMAIL PROTECTED] writes: class A: a = 1 b = A() b.a += 2 print b.a print A.a Which results in 3 1 I don't suppose you'd care to enlighten us on what you'd regard as the superior outcome? class A:

Learning multiple languages (question for general discussion)

2005-11-03 Thread John Salerno
After my last post, I thought of another question as a result of the following: -- Mike Meyer wrote: John Salerno [EMAIL PROTECTED] writes: [Wants to learn C# and Python simultaneously.] So my question is, is this feasible? Should be. It might be faster

Re: Class Variable Access and Assignment

2005-11-03 Thread Antoon Pardon
Op 2005-11-03, venk schreef [EMAIL PROTECTED]: Again (blink) quoting from the docs For targets which are attribute references, the initial value is retrieved with a getattr() and the result is assigned with a setattr(). Notice that the two methods do not necessarily refer to the same

Re: weakrefs to functions for observer pattern

2005-11-03 Thread Michael Schneider
Alex Martelli wrote: Michael Schneider [EMAIL PROTECTED] wrote: I would like to use weak refs in an observer pattern implementation. The problme that I have seems to be that weakrefs can't manage functions. They can manage just fine functions written in *Python*, just not builtin

Re: how to associate files with application

2005-11-03 Thread Ashok
Thanks Lasse, that was really helpful -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning multiple languages (question for general discussion)

2005-11-03 Thread Thomas Guettler
Am Thu, 03 Nov 2005 14:47:52 + schrieb John Salerno: After my last post, I thought of another question as a result of the following: -- Mike Meyer wrote: John Salerno [EMAIL PROTECTED] writes: [Wants to learn C# and Python simultaneously.] So my

Re: Class Variable Access and Assignment

2005-11-03 Thread Steven D'Aprano
On Thu, 03 Nov 2005 12:50:51 +, Antoon Pardon wrote: I don't care what should be different. But a line with only one referent to an object in it, shouldn't be referring to two different objects. It doesn't. Yes it does. If the b.a refers to the instance variable, then an

Re: another beginner sort of question

2005-11-03 Thread John Salerno
Thanks! Mike Meyer wrote: John Salerno [EMAIL PROTECTED] writes: [Wants to learn C# and Python simultaneously.] So my question is, is this feasible? Should be. It might be faster to do them sequentually. Or does learning Python require (or entail) learning all the details behind it?

Re: Class Variable Access and Assignment

2005-11-03 Thread Steven D'Aprano
On Thu, 03 Nov 2005 12:53:37 +, Antoon Pardon wrote: I don't suppose you'd care to enlighten us on what you'd regard as the superior outcome? No. I don't think a superior outcome is necessary to see that this is not sane behaviour. I don't care that much on how it gets fixed. It isn't

Re: PEP submission broken?

2005-11-03 Thread Magnus Lycka
Steve Holden wrote: Volunteers don't always behave as perfect bureaucrats :-) Neither do typical bureaucrats! -- http://mail.python.org/mailman/listinfo/python-list

Re: How to print random strings

2005-11-03 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: So how would I go about have 5 strings, and running a program that will randomly pick one of those to print? import random text = Perhaps reading the manual is a good idea?.split() random.choice(text) 'is' random.choice(text) 'reading' random.choice(text) 'a'

Re: Class Variable Access and Assignment

2005-11-03 Thread Magnus Lycka
Antoon Pardon wrote: Op 2005-11-03, Steven D'Aprano schreef [EMAIL PROTECTED]: There are two possible fixes, either by prohibiting instance variables with the same name as class variables, which would allow any reference to an instance of the class assign/read the value of the variable. Or to

Re: Class Variable Access and Assignment

2005-11-03 Thread Magnus Lycka
Antoon Pardon wrote: There is no instance variable at that point. How can it add 2, to something that doesn't exist at the moment. Because 'a += 1' is only a shorthand for 'a = a + 1' if a is an immutable object? Anyway, the behaviour is well documented.

Re: Most efficient way of storing 1024*1024 bits

2005-11-03 Thread Alex Martelli
Alex Stapleton [EMAIL PROTECTED] wrote: ... Six megabytes is pretty much nothing on a modern computer. BTW, it'd be 6 megabits or 750kb ;) ...but Mike was proposing using one digit per bit, hence, 6 megabytes. That makes it easy to search for bitpatterns with re or string.find;

Re: Learning multiple languages (question for general discussion)

2005-11-03 Thread infidel
Python has spoiled me. I used to periodically try out new languages just for fun, but since learning Python, it's become a lot less interesting. I find myself preferring to just try new ideas or techniques in Python rather than searching for new languages to dabble in. The last few I've

Re: Getting Python Accepted in my Organisation

2005-11-03 Thread Tommy . Ryding
I have done the same thing in my organisation. Show them concrete examples of when they can benefit from Python to Convince them. My colleagues and bosses has been conviced and therefore my current work task is to integrate the interpreter in a VxWorks environment so everyone at the company can

How can I package a python script and modules into a single script?

2005-11-03 Thread Noah
I would like to package my main script and all the modules it imports into a single script that will run just as the collection would. It should not need to package standard Python lib modules -- just my local modules. This is not the same question that would be answered with py2exe or py2app. I

Re: Python and MySQL

2005-11-03 Thread Thomas Bartkus
Steve Holden [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Thomas Bartkus wrote: Steve Holden [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have a _mysql.c as a part of my distrbution of MySQLdb. Don't you? You made me give that library a good hard stare.

Re: Learning multiple languages (question for general discussion)

2005-11-03 Thread John Salerno
LOL. As weird as it sounds, that's what I *don't* want to happen with C#! I've spent a lot of time with it, and I love it, but I don't want Python to take over! :) infidel wrote: Python has spoiled me. I used to periodically try out new languages just for fun, but since learning Python,

  1   2   3   >