Re: Problem with "&" charater in xml.

2006-07-13 Thread Stefan Behnel
Kirt wrote: > How do i append characters to a string? I think the normal approach is to store an empty string (or list) in an attribute in startElement(), append to it in characters() and use the result in endElement(). def startElement(self, ...): self.chars = '' def characters(self, s):

Re: Determining if an object is a class?

2006-07-13 Thread Nick Vatamaniuc
Clay, Search Google for it. Here is one good explanation with code examples by Michael Fotsch: http://www.geocities.com/foetsch/python/new_style_classes.htm Nick V. placid wrote: > [EMAIL PROTECTED] wrote: > > I need to find out if an object is a class. Using new style classes > > this is very e

Re: pyExcelerator - Can I read and modify an existing Excel-WorkBook?

2006-07-13 Thread rbsharp
Hello, I agree that it would be nice to use one package to read and modify an Excel Sheet. I have only had to do either one or the other, read a sheet and use the data for something else, or export data to an Excel-Sheet. Perhaps you might like to look at xlrd: http://www.lexicon.net/sjmachin/xlrd

Re: Problem with "&" charater in xml.

2006-07-13 Thread Kirt
thanx stefan ur approach worked. Stefan Behnel wrote: > Kirt wrote: > > How do i append characters to a string? > > I think the normal approach is to store an empty string (or list) in an > attribute in startElement(), append to it in characters() and use the result > in endElement(). > > def star

Re: don't need dictionary's keys - hash table?

2006-07-13 Thread Diez B. Roggisch
> I am a little surprised that hash(hash(s)) == hash(s), is that actually > true? As hashes are integers & the hash of an integer is the integer itself, this isn't to surprising. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: PDF with nonLatin-1 characters

2006-07-13 Thread per9000
Stefan Behnel wrote: > victor wrote: > > I want to generate a report and the PDF fits perfectly. Though there is > > an issue of using different encoding in the doc. I tried PyPS with no > > success. I need a lib that can make PDFs with an arbitrary set of fonts > > (possibly embed them into the do

Re: Generating all ordered substrings of a string

2006-07-13 Thread Thorsten Kampe
* Thorsten Kampe (2006-07-12 19:11 +) > filter(lambda x: len(x) == 2, part(['abcd'])) That's "filter(lambda x: len(x) == 2, part('abcd'))" of course... -- http://mail.python.org/mailman/listinfo/python-list

Too many imports to use a business class library?

2006-07-13 Thread Sanjay
Hi all, I am new to python. Sorry if this is too novice question, but I could not find an answer yet. While coding a business class library, I think it is preferable to have one class per source file, rather than combining all classes into one file, considering multiple developers developing the

Re: Finding Return Code From GPG

2006-07-13 Thread Nomen Nescio
On Sat, 08 Jul 2006 00:26:06 +0200, Piet van Oostrum wrote: > >>NN> What is still not working is the display from gpg. It shows up on the >>NN> monitor screen like this: > >>NN> gpg: Signature made Tue 04 Jul 2006 08:04:10 AM CET using DSA key ID >>NN> 06B09BA4 >>NN> gpg: Good signature from "Bo

Re: don't need dictionary's keys - hash table?

2006-07-13 Thread Peter Otten
Terry Hancock wrote: > Nick Vatamaniuc wrote: >> The original post just said that he wanted to index some values by >> their urls and didn't really care about the urls themselves, so I >> suggested that he just use the hash of the key as the key. The >> dictionary will then take a hash of that

Re: Too many imports to use a business class library?

2006-07-13 Thread bearophileHUGS
Sanjay wrote: > I am new to python. Sorry if this is too novice question, Don't worry and welcome. > While coding a business class library, I think it is preferable to have > one class per source file, rather than combining all classes into one > file, considering multiple developers developing

Re: don't need dictionary's keys - hash table?

2006-07-13 Thread Peter Otten
Terry Hancock wrote: > Nick Vatamaniuc wrote: >> The original post just said that he wanted to index some values by >> their urls and didn't really care about the urls themselves, so I >> suggested that he just use the hash of the key as the key. The >> dictionary will then take a hash of that

Re: Too many imports to use a business class library?

2006-07-13 Thread Diez B. Roggisch
Sanjay schrieb: > Hi all, > > I am new to python. Sorry if this is too novice question, but I could > not find an answer yet. > > While coding a business class library, I think it is preferable to have > one class per source file, rather than combining all classes into one > file, considering mul

Re: Accessors in Python (getters and setters)

2006-07-13 Thread mystilleef
Maric Michaud wrote: > Not python developers. Nonsense! > But that's not python philosophy. Python doesn't have any philosophy with regards to naming identifiers. > But they are in Python and that is the python's philosophy. All attribute or > method not beginning with an '_' *is* API. Right, and

Re: Too many imports to use a business class library?

2006-07-13 Thread Bruno Desthuilliers
Sanjay wrote: > Hi all, > > I am new to python. Sorry if this is too novice question, but I could > not find an answer yet. > > While coding a business class library, I think it is preferable to have > one class per source file, rather than combining all classes into one > file, considering multi

Re: Problem with "&" charater in xml.

2006-07-13 Thread George Bina
A SAX parser can notify a text node by calling any number of times the characters method so you need to accumulate all the information you receive on the characters method and output the text when you get a notification different than characters. Best Regards, George --

Re: Too many imports to use a business class library?

2006-07-13 Thread Peter Otten
Sanjay wrote: > While coding a business class library, I think it is preferable to have > one class per source file, ... but I don't like the consequences :-) > So, as per my study of python, a developer using the business class > library has to write so many imports, one per class. Like: > >

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, mystilleef wrote: > Maric Michaud wrote: >> But that's not python philosophy. > Python doesn't have any philosophy with regards to naming identifiers. But the python community has one. Pythonistas prefer readable source code so they tend to think about good names. As The

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Bruno Desthuilliers
mystilleef wrote: (snip) > Python doesn't have any philosophy with regards to naming identifiers. Yes it does. > >>But they are in Python and that is the python's philosophy. All attribute or >>method not beginning with an '_' *is* API. > > Right, and what if I want to change a private API to a

Re: don't need dictionary's keys - hash table?

2006-07-13 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: >> depending on your application, a bloom filter might be a good enough: >> >> http://en.wikipedia.org/wiki/Bloom_filter >> > > Thanks (everyone) for the comments. I like the idea of the bloom > filter or using an md5 hash, since a rare collision will not be a > show

Re: Accessors in Python (getters and setters)

2006-07-13 Thread mystilleef
Bruno Desthuilliers wrote: > mystilleef wrote: > > Lousy Attribute Name: > > self.tmp > > > > Accessors: > > set_temporary_buffer > > get_temporary_buffer > > > > The attribute name I chose, "tmp" sucks. > > Well, it's surely not as descriptive as 'temporary_buffer' > > > I have used t

Re: Accessors in Python (getters and setters)

2006-07-13 Thread mystilleef
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, mystilleef > wrote: > > > Maric Michaud wrote: > >> But that's not python philosophy. > > Python doesn't have any philosophy with regards to naming identifiers. > > But the python community has one. Pythonistas prefer readable source code

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Fredrik Lundh
"mystilleef" wrote: > Right, and what if I want to change a private API to a public one. How > does that solve my naming issues. if your code is as muddled as your rhetorics, your only solution might be to give up programming. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a type error?

2006-07-13 Thread Andreas Rossberg
Marshall wrote: > > Okay, sure. But for the problem you describe, both imperativeness > and the presence of pointers is each necessary but not sufficient; > it is the two together that causes the problem. So it strikes > me (again, a very minor point) as inaccurate to describe this as > a problem

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Bruno Desthuilliers
Gerhard Fiedler wrote: > On 2006-07-12 06:17:27, mystilleef wrote: > > >>But developers tend to pay more attention to given methods/functions >>less crappy names, at least when compared to data attributes. This >>stems from the fact that in many languages data attributes aren't >>usually part of

Re: Accessors in Python (getters and setters)

2006-07-13 Thread mystilleef
Bruno Desthuilliers wrote: > mystilleef wrote: > (snip) > > Python doesn't have any philosophy with regards to naming identifiers. > > Yes it does. No it doesn't. > > > >>But they are in Python and that is the python's philosophy. All attribute or > >>method not beginning with an '_' *is* API. >

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Bruno Desthuilliers
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, mystilleef > wrote: > > >>Maric Michaud wrote: >> (snip) >>>But they are in Python and that is the python's philosophy. All attribute or >>>method not beginning with an '_' *is* API. >> >>Right, and what if I want to change a private API t

Re: testing array of logicals

2006-07-13 Thread Simon Brunning
On 12 Jul 2006 11:14:43 -0700, John Henry <[EMAIL PROTECTED]> wrote: > Is there a more elagant way of doing this? > > # logflags is an array of logicals > test=True > for x in logflags: >test = test and x > print test min(logflags) I feel dirty now. ;-) -- Cheers, Simon B, [EMAIL PROTECTED]

Re: Accessors in Python (getters and setters)

2006-07-13 Thread mystilleef
Fredrik Lundh wrote: > "mystilleef" wrote: > > > Right, and what if I want to change a private API to a public one. How > > does that solve my naming issues. > > if your code is as muddled as your rhetorics, your only solution might be > to give up programming. > > There's no correlation between

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Bruno Desthuilliers
mystilleef wrote: > Marc 'BlackJack' Rintsch wrote: > >>In <[EMAIL PROTECTED]>, mystilleef >>wrote: >> >> >>>Maric Michaud wrote: (snip) But they are in Python and that is the python's philosophy. All attribute or method not beginning with an '_' *is* API. >>> >>>Right, and what if I want

python logging module problem

2006-07-13 Thread Ritesh Raj Sarraf
import os, sys, logging logger = logging.getLogger("my_app") conerr = logging.StreamHandler(sys.stderr) conerr.setLevel(logging.DEBUG) conerr_formatter = logging.Formatter('%(levelname)s %(message)s') conerr.setFormatter(conerr_formatter) console = logging.StreamHandler(sys.stdout) console.setLe

Re: Accessors in Python (getters and setters)

2006-07-13 Thread mystilleef
Bruno Desthuilliers wrote: > mystilleef wrote: > > Marc 'BlackJack' Rintsch wrote: > > > >>In <[EMAIL PROTECTED]>, mystilleef > >>wrote: > >> > >> > >>>Maric Michaud wrote: > (snip) > > But they are in Python and that is the python's philosophy. All attribute > or > method not beginni

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Fredrik Lundh
"mystilleef" wrote: >> if your code is as muddled as your rhetorics, your only solution might be >> to give up programming. > > There's no correlation between rhetorics and programming. That's like > me saying if you are trying to be sarcastic your only solution might be > to give up programming.

Micro-pump is cool idea for future computer chips

2006-07-13 Thread studyandtelecom
Micro-pump is cool idea for future computer chips http://www.studyandjobs.com/Micro_pump.html or visit http://www.studyandjobs.com/IT_study.htm Regards -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessors in Python (getters and setters)

2006-07-13 Thread mystilleef
Fredrik Lundh wrote: > "mystilleef" wrote: > > >> if your code is as muddled as your rhetorics, your only solution might be > >> to give up programming. > > > > There's no correlation between rhetorics and programming. That's like > > me saying if you are trying to be sarcastic your only solution

Re: Data access from multiple code modules

2006-07-13 Thread simon . hibbs
Bruno Desthuilliers wrote: > Do you mean the code effectively doing these operations is in the gui ? > If yes, it would be better to factor it out IMHO. The GUI has to be able to acces the data object, otherwise how does the user affect any changes to the application data? If I modify a value in

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Fredrik Lundh
"mystilleef" wrote: > Pretending to be intelligent does, however. so the real reason you've written a few hundred posts saying basically "I pick bad names, which proves... uh... whatever" is to impress people by pretending to be something you're not ? -- http://mail.python.org/mailman/list

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Bruno Desthuilliers
mystilleef wrote: > Bruno Desthuilliers wrote: > >>mystilleef wrote: >> >>>Lousy Attribute Name: >>> self.tmp >>> >>>Accessors: >>> set_temporary_buffer >>> get_temporary_buffer >>> >>>The attribute name I chose, "tmp" sucks. >> >>Well, it's surely not as descriptive as 'temporary_buff

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Bruno Desthuilliers
mystilleef wrote: > Bruno Desthuilliers wrote: > >>mystilleef wrote: >> >>>Marc 'BlackJack' Rintsch wrote: >>> >>> In <[EMAIL PROTECTED]>, mystilleef wrote: >Maric Michaud wrote: >> >>(snip) >> >> >>But they are in Python and that is the python's philosophy. All attr

Python strings outside the 128 range

2006-07-13 Thread Sébastien Boisgérault
Hi, Could anyone explain me how the python string "é" is mapped to the binary code "\xe9" in my python interpreter ? "é" is not present in the 7-bit ASCII table that is the default encoding, right ? So is the mapping "é" -> "\xe9" portable ? (site-)configuration dependent ? Can anyone have somet

Re: How to delete a Python package

2006-07-13 Thread Nick Craig-Wood
Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2006-07-12, Nick Vatamaniuc <[EMAIL PROTECTED]> wrote: > > As a rule, if you use a Linux distribution, you should just install > > the package and then remove the package using the package manager. > > That's fine except a lot of python packages are

Re: Accessors in Python (getters and setters)

2006-07-13 Thread mystilleef
Fredrik Lundh wrote: > "mystilleef" wrote: > > > Pretending to be intelligent does, however. > > so the real reason you've written a few hundred posts saying basically "I pick > bad names, which proves... uh... whatever" is to impress people by pretending > to be something you're not ? > > Choos

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Bruno Desthuilliers
mystilleef wrote: > Bruno Desthuilliers wrote: > >>mystilleef wrote: >>(snip) >> >>>Python doesn't have any philosophy with regards to naming identifiers. >> >>Yes it does. > > > No it doesn't. > > But they are in Python and that is the python's philosophy. All attribute or method not

Re: Python strings outside the 128 range

2006-07-13 Thread Diez B. Roggisch
Sébastien Boisgérault schrieb: > Hi, > > Could anyone explain me how the python string "é" is mapped to > the binary code "\xe9" in my python interpreter ? > > "é" is not present in the 7-bit ASCII table that is the default > encoding, right ? So is the mapping "é" -> "\xe9" portable ? > (site-)c

Re: What is a type error?

2006-07-13 Thread Joachim Durchholz
Marshall schrieb: > Joachim Durchholz wrote: >> Marshall schrieb: >>> Joachim Durchholz wrote: Marshall schrieb: > I can see the lack of a formal model being an issue, but is the > imperative bit really all that much of an obstacle? How hard > is it really to deal with assignment?

help in xml and python

2006-07-13 Thread Kirt
i have a List modifiedfiles= [['/home/moq/buc/2/mod2.py', '200607131001'], ['/home/moq/buc/1/mod2.py', '200607131000'], ['/home/moq/buc/1/mod3.py', '200607131001'], ['/home/moq/buc/1+mod1.py', '200607131001']] i have to put them in am xml format like the follg. /home/moq/buc/2

Re: What is a type error?

2006-07-13 Thread Joachim Durchholz
Darren New schrieb: > Joachim Durchholz wrote: >> Actually, in a functional programming language (FPL), you write just >> the postconditions and let the compiler generate the code for you. > > Certainly. And my point is that the postcondition describing "all valid > chess boards reachable from t

Re: python logging module problem

2006-07-13 Thread Ritesh Raj Sarraf
Ritesh Raj Sarraf wrote: > import os, sys, logging > > logger = logging.getLogger("my_app") > I tried this code: import logging, sys # set up logging to file - see previous section for more details logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(name)-12s %(le

Re: Python strings outside the 128 range

2006-07-13 Thread Fredrik Lundh
Sébastien Boisgérault wrote: > Could anyone explain me how the python string "é" is mapped to > the binary code "\xe9" in my python interpreter ? in the iso-8859-1 character set, the character é is represented by the code 0xE9 (233 in decimal). there's no mapping going on here; there's only one

Re: Execute Commands on Remote Computers over Network

2006-07-13 Thread Ben Sizer
dylpkls91 wrote: > I have been researching this topic and come up with some code to make > it work. It uses SSL and requires the 3rd party package Paramiko (which > requires PyCrypto). However, at this moment I have no network to test > the code on! Trying to connect to localhost (127.0.0.1) fails.

Re: don't need dictionary's keys - hash table?

2006-07-13 Thread Paul Rubin
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > btw, since my brain is on vacation, could anyone who already has all > the necessary background information in their head (Paul?) tell me > if using a chopped-up MD5 or SHA-1 (or whatever) digest as the hash > functions for a bloom filter is a good idea

PSU alert: Watch out for the anti-effbot

2006-07-13 Thread skip
The PSU warns you to keep on the lookout for posts from the anti-effbot. It's rumored that he recently turned up in this quadrant of the galaxy. His posts tend to be somewhat illogical, suggest a poor mastery of software engineering in general and Python in particular, and seem unnervingly friend

Re: What is a type error?

2006-07-13 Thread Joachim Durchholz
Marshall schrieb: > David Hopwood wrote: >> This property is, after all, not something that the program should depend on. >> It is determined by how good the static checker currently is, and we want to >> be >> able to improve checkers (and perhaps even allow them to regress slightly in >> order t

Re: help in xml and python

2006-07-13 Thread Fredrik Lundh
"Kirt" wrote: >i have a List > > modifiedfiles= [['/home/moq/buc/2/mod2.py', '200607131001'], > ['/home/moq/buc/1/mod2.py', '200607131000'], > ['/home/moq/buc/1/mod3.py', '200607131001'], > ['/home/moq/buc/1+mod1.py', '200607131001']] > > i have to put them in am xml format like the follg. not ve

Re: help in xml and python

2006-07-13 Thread Maric Michaud
Le jeudi 13 juillet 2006 12:50, Kirt a écrit : >     >     /home/moq/buc/2 >     >      mod2.py >      200607131001 >     >     In [109]: xmldir = """ .: %(dir)s .: .: %(file)s .: %(time)s .: .:""" In [116]: xmloutput = '

Re: Accessors in Python (getters and setters)

2006-07-13 Thread mystilleef
Bruno Desthuilliers wrote: > mystilleef wrote: > > Bruno Desthuilliers wrote: > > > >>mystilleef wrote: > >> > >>>Lousy Attribute Name: > >>> self.tmp > >>> > >>>Accessors: > >>> set_temporary_buffer > >>> get_temporary_buffer > >>> > >>>The attribute name I chose, "tmp" sucks. > >> > >>Well

Re: Data access from multiple code modules

2006-07-13 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: > Bruno Desthuilliers wrote: > > >>Do you mean the code effectively doing these operations is in the gui ? >>If yes, it would be better to factor it out IMHO. > > The GUI has to be able to acces the data object, otherwise how does the > user affect any changes to the ap

Re: Accessors in Python (getters and setters)

2006-07-13 Thread mystilleef
Bruno Desthuilliers wrote: > mystilleef wrote: > > Bruno Desthuilliers wrote: > > > >>mystilleef wrote: > >>(snip) > >> > >>>Python doesn't have any philosophy with regards to naming identifiers. > >> > >>Yes it does. > > > > > > No it doesn't. > > > > > But they are in Python and that is the

Re: help in xml and python

2006-07-13 Thread Diez B. Roggisch
> can someone please with the code for this. Show us your efforts, and we'd be glad to help you correcting/enhancing them. Or use PayPal and pay one of the guys here - my hourly fee is 50€, and less than one hour work can't be booked. Diez -- http://mail.python.org/mailman/listinfo/python-lis

Re: help in xml and python

2006-07-13 Thread Stefan Behnel
Diez B. Roggisch wrote: > Or use PayPal and pay one of the guys here - my hourly fee is 50€, and > less than one hour work can't be booked. He! Don't tell people in public that you're working at 50€/hour! That's gonna destruct the market. It's better if they believe there's nothing below 80€, the

Re: Newbie

2006-07-13 Thread Gueorgui Vaskes
Could anyone feel me in what do you mostly use python for? ___ The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html -- http://mail.pyt

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Ant
We seem to be flogging a dead horse now. Is the following a fair summary: Q. What is the Pythonic way of implementing getters and setters? A. Use attributes. Quote: "I put a lot more effort into choosing method and function names" Wisdom: Python is a different paradigm from (e.g.) Java w.r.t. a

Re: don't need dictionary's keys - hash table?

2006-07-13 Thread Paul Rubin
Paul Rubin writes: > Finally, I think to use Bloom filters effectively you have to choose > nlayers and layersize carefully, according to the number of keys you > expect to see, the amount of memory you have available, and/or the > probability of false matches that you're

ctypes wrapping libpam.so on FreeBSD 6.1 - Python Bus Error

2006-07-13 Thread Martin P. Hellwig
Hey all, I'd like to wrap libpam so that I can use that for authentication and password management. I build ctypes (0.9.9.6) on my platform via ports. Now according to OpenPAM documentation all sessions start with pam_start(). According to the man page it should contain this: pam_start(const cha

Re: stderr, stdout, and errno 24

2006-07-13 Thread Wesley Henwood
I've checked and double checked my code and I am closing all files explicitly after opening them. The only possibliy I can think of is Python opening files each time I run a script, or each time imput to stderr or stdout is redirected. Here's a link that is perhaps related to my problem:

Re: Data access from multiple code modules

2006-07-13 Thread simon . hibbs
Bruno Desthuilliers wrote: > Separating operations on data (model/controler) from GUI code (view). > The controler(s) have a reference on the model. The views have a > reference on the controler(s), and call on the controller to get data to > display or act on data. So I instantiate a Model obje

Re: ctypes wrapping libpam.so on FreeBSD 6.1 - Python Bus Error

2006-07-13 Thread Fredrik Lundh
Martin P. Hellwig wrote: > I'd like to wrap libpam so that I can use that for authentication and > password management. I build ctypes (0.9.9.6) on my platform via ports. > > Now according to OpenPAM documentation all sessions start with pam_start(). > According to the man page it should contain t

Re: Newbie

2006-07-13 Thread simon . hibbs
So far I've mostly used it for writing short text file re-formatting scripts. Previously I would have used Perl, but I find Python much more readable and maintainable for this sort of thing, and only very slightly more verbose. I'm currently writing a play-by-mail game turn processing engine usin

Re: Accessors in Python (getters and setters)

2006-07-13 Thread mystilleef
Ant wrote: > We seem to be flogging a dead horse now. Is the following a fair > summary: > > Q. What is the Pythonic way of implementing getters and setters? > > A. Use attributes. > > Quote: "I put a lot more effort into choosing method and function > names" > > Wisdom: Python is a different para

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Simon Brunning
On 10 Jul 2006 05:51:02 -0700, mystilleef <[EMAIL PROTECTED]> wrote: > I decided to change the name of an attribute. Problem is I've used the > attribute in several places spanning thousands of lines of code. If I > had encapsulated the attribute via an accessor, I wouldn't need to do > an unreliab

Re: Data access from multiple code modules

2006-07-13 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > So I instantiate a Model object that handles all IO to the database. > Next I instantiate a Controller object, passing it a reference to the > Data/IO model object. Next I instantiate the display panel objects for > the GUI, passing them references to the Controller obje

Re: ctypes wrapping libpam.so on FreeBSD 6.1 - Python Bus Error

2006-07-13 Thread Ganesan Rajagopal
> "Martin" == Martin P Hellwig <[EMAIL PROTECTED]> writes: > Now according to OpenPAM documentation all sessions start with pam_start(). > According to the man page it should contain this: > pam_start(const char *service, const char *user, >const struct pam_conv *pam_conv, pam_handle_t

Re: Newbie

2006-07-13 Thread rony steelandt
Le Thu, 13 Jul 2006 12:45:44 +0100, Gueorgui Vaskes a écrit : > Could anyone feel me in what do you mostly use python for? > > > > ___ > The all-new Yahoo! Mail goes wherever you go - free your email address from your Inter

Re: testing array of logicals

2006-07-13 Thread John Henry
Simon Brunning wrote: > On 12 Jul 2006 11:14:43 -0700, John Henry <[EMAIL PROTECTED]> wrote: > > Is there a more elagant way of doing this? > > > > # logflags is an array of logicals > > test=True > > for x in logflags: > >test = test and x > > print test > > min(logflags) > !!! > I feel di

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Antoon Pardon
On 2006-07-13, mystilleef <[EMAIL PROTECTED]> wrote: > >> What do you hope ? Something that cures cancer ? Please enlighten us and >> explain how explicit getters/setters would have solved the problem of >> badly named getters/setters ? >> > I did already. If I had used Java, Eiffel, Smalltalk or C

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Bruno Desthuilliers
mystilleef wrote: > Bruno Desthuilliers wrote: > >>mystilleef wrote: >> (snip) >I have used that name in >dozens of places spanning over 27000 LOC. Too bad for you. >>> >>> >>>Thank you, that was helpful. >> >>What am I supposed to say ? You choose a bad name for a public sym

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Simon Brunning
On 7/13/06, Simon Brunning <[EMAIL PROTECTED]> wrote: > Something like this any use to you? Or this, about a squillion times cleaner: class MyClass(object): def _get_bad_name(self): warn('"bad_name" deprecated. Please refer to "good_name"', stacklevel=2) return self.good_name

Re: hash() yields different results for different platforms

2006-07-13 Thread Piet van Oostrum
> "Kerry, Richard" <[EMAIL PROTECTED]> (KR) wrote: >KR> The hash is not expected to be unique, it just provides a starting point >KR> for another search (usually linear ?). >KR> See http://en.wikipedia.org/wiki/Hash_function That only contains a definition of a hash function. I know what a

Re: Python strings outside the 128 range

2006-07-13 Thread Sébastien Boisgérault
Fredrik Lundh wrote: > in the iso-8859-1 character set, the character é is represented by the code > 0xE9 (233 in decimal). there's no mapping going on here; there's only one > character in the string. how it appears on your screen depends on how you > print it, and what encoding your terminal

Re: Too many imports to use a business class library?

2006-07-13 Thread Sanjay
Thanks a lot to all for the to-the-point info, quite vital to me... Sanjay -- http://mail.python.org/mailman/listinfo/python-list

bay area based - python guru..

2006-07-13 Thread bruce
hi... is there a bay area based guru, or someone who's into mentoring that i'we can talk to... specifically someone who's experienced using mechanize/browser/urllib/urllib2/cookies/etc... we're running into small situations that are taking an inordinate amount of time to resolve, so we thought we

Re: Python strings outside the 128 range

2006-07-13 Thread Piet van Oostrum
> "Sébastien Boisgérault" <[EMAIL PROTECTED]> (SB) wrote: >SB> Hi, >SB> Could anyone explain me how the python string "é" is mapped to >SB> the binary code "\xe9" in my python interpreter ? That is not done in the python interpreter. It is done in the editor in which you prepare your python

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Gerhard Fiedler
On 2006-07-13 06:03:40, Bruno Desthuilliers wrote: >> [...] the underscore way to mark private entities. Maybe this doesn't >> work as I think it does > > If you think that single leading underscores have a special meaning for > the compiler/interpreter, then you got it wrong. It's a convention.

Re: testing array of logicals

2006-07-13 Thread Simon Brunning
On 13 Jul 2006 05:45:21 -0700, John Henry <[EMAIL PROTECTED]> wrote: > > Simon Brunning wrote: > > > > min(logflags) > > > > !!! Be aware that not only is this an outrageous misuse of min(), it's also almost certainly much less efficient than /F's suggestion, 'cos it always iterates through the en

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Gerhard Fiedler
On 2006-07-13 01:50:18, Alex Martelli wrote: >> I'm not sure about which languages you are talking (pretty much all that >> allow public methods also allow public attributes), [...] > > Smalltalk is a very well known object-oriented language that behaves > otherwise, just as one example. I didn'

running python from a memory stick?

2006-07-13 Thread John Salerno
Is there a way to 'install' and use Python on a memory stick, just as you would on any computer? I use Windows, and I know the installation does things with the registry, so probably I couldn't use the executable file to install it. But is it possible to do it some other way, such as how you mi

Re: don't need dictionary's keys - hash table?

2006-07-13 Thread Piet van Oostrum
> [EMAIL PROTECTED] (k) wrote: >k> Hello, >k> I am using some very large dictionaries with keys that are long strings >k> (urls). For a large dictionary these keys start to take up a >k> significant amount of memory. I do not need access to these keys -- I >k> only need to be able to retriev

Re: bay area based - python guru..

2006-07-13 Thread Stefan Behnel
bruce wrote: > is there a bay area based guru, or someone who's into mentoring that i'we > can talk to... specifically someone who's experienced using > mechanize/browser/urllib/urllib2/cookies/etc... > > we're running into small situations that are taking an inordinate amount of > time to resolve

Re: running python from a memory stick?

2006-07-13 Thread Fredrik Lundh
John Salerno wrote: > Is there a way to 'install' and use Python on a memory stick, just as > you would on any computer? I use Windows, and I know the installation > does things with the registry, so probably I couldn't use the executable > file to install it. just install it as usual on C:, and

Re: running python from a memory stick?

2006-07-13 Thread Simon Brunning
On 7/13/06, John Salerno <[EMAIL PROTECTED]> wrote: > Is there a way to 'install' and use Python on a memory stick, just as > you would on any computer? I use Windows, and I know the installation > does things with the registry, so probably I couldn't use the executable > file to install it. But is

Re: bay area based - python guru..

2006-07-13 Thread Simon Brunning
On 7/13/06, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Maybe the right thing to ask back is: how much do you pay? And possibly; *which* bay? ;-) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: running python from a memory stick?

2006-07-13 Thread John Salerno
Simon Brunning wrote: > On 7/13/06, John Salerno <[EMAIL PROTECTED]> wrote: >> Is there a way to 'install' and use Python on a memory stick, just as >> you would on any computer? I use Windows, and I know the installation >> does things with the registry, so probably I couldn't use the executable >

Re: running python from a memory stick?

2006-07-13 Thread John Salerno
Fredrik Lundh wrote: > John Salerno wrote: > >> Is there a way to 'install' and use Python on a memory stick, just as >> you would on any computer? I use Windows, and I know the installation >> does things with the registry, so probably I couldn't use the executable >> file to install it. > > jus

How to have application-wide global objects

2006-07-13 Thread Sanjay
Probably a newcomer question, but I could not find a solution. I am trying to have some singleton global objects like "database connection" or "session" shared application wide. Trying hard, I am not even being able to figure out how to create an object in one module and refer the same in another

problem in executing a file

2006-07-13 Thread ciccio
Dear all, I'm using python to manage a web-site. In particular, a user insert specific parameters in a form and, then, I recover all parameters and run an executable file according to the user parameters. The output is finally showed in a new web-page. The problem is when I need to run the execu

Re: How to delete a Python package

2006-07-13 Thread zarrg
Nick Vatamaniuc wrote: > Skip, > I agree. Some kind of a manifest or log file would be great and > probably not that hard to implement. > Nick What's wrong with the "record" option of install: python setup.py install --record installed_files Then it's pretty easy to do: rm -rf `cat installe

Re: running python from a memory stick?

2006-07-13 Thread Fredrik Lundh
John Salerno wrote: > Interesting. I didn't think it would be that easy. But I don't think I > fully understand what exemaker does. Another question I had was since I > won't be using a Windows registry, would I have to put the #! line on my > scripts like in Linux? windows doesn't care about the

Re: Accessors in Python (getters and setters)

2006-07-13 Thread mystilleef
Bruno Desthuilliers wrote: > mystilleef wrote: > > Bruno Desthuilliers wrote: > > > >>mystilleef wrote: > >> > (snip) > > >I have used that name in > >dozens of places spanning over 27000 LOC. > > Too bad for you. > >>> > >>> > >>>Thank you, that was helpful. > >> > >>What am

Re: Python strings outside the 128 range

2006-07-13 Thread Gerhard Fiedler
On 2006-07-13 07:42:51, Fredrik Lundh wrote: >> Could anyone explain me how the python string "é" is mapped to >> the binary code "\xe9" in my python interpreter ? > > in the iso-8859-1 character set, the character é is represented by the code > 0xE9 (233 in decimal). there's no mapping going on

Re: Compiling Python using the Portland Group compiler

2006-07-13 Thread Konrad Hinsen
Nick, > I would try to find out if pgcc has any compatibility switches. I saw > you turned optimization "off" but sometimes there is more you can do > disable some of the advanced behind the scenes magic. So apply all > those switches, run the tests and then try them one by one to find out > how

  1   2   3   >