Re: Regarding exception handling

2005-01-30 Thread Aggelos I. Orfanakos
Coming from C, I think that it's generally a good programming practice to make sure everything you create, closes; whether it's about a socket or a file. This may not be the case with Python though. To be honest, leaving this task to the garbage collector doesn't sound like a good idea to me (since

Re: a Python bug in processing __del__ method ??

2005-01-30 Thread Baoqiu Cui
Fredrik and Steve, Thank you so much for the help. Now I know more about Python. :-) Steve's test does explain why 'peter1' is OK while 'peter' is not: 'peter1' appears before 'Person' in the globals while 'peter' is after. The error message is just a little confusing to a Python newbie, I thin

Re: Regarding exception handling

2005-01-30 Thread Bryan
Fredrik Lundh wrote: "Bryan" wrote the above is not the same. make the a = ... raise an exception and you'll see the difference. s = ... # a = 1/0 s.close() as you can see, s.close() will never be called. also, in this example, i intentionally didn't put the extra try/except around the try/fina

Re: Image stats - going from Matlab to Python

2005-01-30 Thread Fernando Perez
[EMAIL PROTECTED] wrote: > Hi all, > I am working with images in python using PIL. I come from a MATLAB > background so I am finding it to be sometimes frustrating to do things > correctly and quickly. All I need to do is load an image and store a > list of pixel coordinates at which the alpha cha

Re: variable declaration

2005-01-30 Thread EP
> Original Message > From: [EMAIL PROTECTED] (Alexander Zatvornitskiy) > > Hello All! > > I'am novice in python, and I find one very bad thing (from my point of > view) in > language. There is no keyword or syntax to declare variable, like 'var' > in > Pascal, or special

Re: Image stats - going from Matlab to Python

2005-01-30 Thread Robert Kern
[EMAIL PROTECTED] wrote: Hi all, I am working with images in python using PIL. I come from a MATLAB background so I am finding it to be sometimes frustrating to do things correctly and quickly. Yup. That's the curse of changing toolsets. All I need to do is load an image and store a list of pixel c

Re: a Python bug in processing __del__ method ??

2005-01-30 Thread Steven Bethard
Fredrik Lundh wrote: Baoqiu Cui wrote: The error returned is this: $ python bug.py Exception exceptions.AttributeError: "'NoneType' object has no attribute 'population'" in > ignored However, if I rename variable name 'peter' to something like 'peter1' or 'david', the error is gone. Looks to me th

Re: Regarding exception handling

2005-01-30 Thread Fredrik Lundh
"Bryan" wrote > the above is not the same. make the a = ... raise an exception and you'll see > the difference. > > s = ... # > a = 1/0 > s.close() > > as you can see, s.close() will never be called. also, in this example, i > intentionally didn't put > the extra try/except around the try/fina

Re: a Python bug in processing __del__ method ??

2005-01-30 Thread Steven Bethard
Baoqiu Cui wrote: Today I was playing with a small Python program using Python 2.4 on Cygwin (up-to-date version, on Windows XP), but ran into a strange error on the following small program (named bug.py): --- #!/usr/bin/python class Person: population = 0 def __del__(se

Re: a Python bug in processing __del__ method ??

2005-01-30 Thread Fredrik Lundh
Baoqiu Cui wrote: > The error returned is this: > > $ python bug.py > Exception exceptions.AttributeError: "'NoneType' object has no > attribute 'population'" in <__main__.Person instance at 0xa0c9fec>> ignored > > However, if I rename variable name 'peter' to something like 'peter1' > or 'david'

Nested scopes and class variables

2005-01-30 Thread Dave Benjamin
I ran into an odd little edge case while experimenting with functions that create classes on the fly (don't ask me why): >>> def f(x): ... class C(object): ... x = x ... print C.x ... >>> f(5) Traceback (most recent call last): File "", line 1, in ? File "", line 2, i

Re: Regarding exception handling

2005-01-30 Thread Bryan
Dan Perl wrote: "Bryan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] IMO, that is not the reason for the try/finally statement and it is not redundant. the try/finally statement guarantees the resource is closed and the try/finally statement only gets executed if and only if the

a Python bug in processing __del__ method ??

2005-01-30 Thread Baoqiu Cui
Today I was playing with a small Python program using Python 2.4 on Cygwin (up-to-date version, on Windows XP), but ran into a strange error on the following small program (named bug.py): --- #!/usr/bin/python class Person: population = 0 def __del__(self): Person.popu

Image stats - going from Matlab to Python

2005-01-30 Thread tjv
Hi all, I am working with images in python using PIL. I come from a MATLAB background so I am finding it to be sometimes frustrating to do things correctly and quickly. All I need to do is load an image and store a list of pixel coordinates at which the alpha channel is set to 1. In Matlab this wou

Re: PyGame not working(?)

2005-01-30 Thread Robert Kern
Chris Weisiger wrote: Thanks; I've now successfully installed Numeric, as well as all of the other dependencies listed for PyGame. However, PyGame appears to still not be working. When I try to run the program at the top of this page: http://www.pygame.org/docs/tut/tom/games2.html I get the foll

Re: Problem with loading textfiles into dictionaries.

2005-01-30 Thread Steven Bethard
Kartic wrote: [EMAIL PROTECTED] said the following on 1/30/2005 7:43 PM: Hello, I want to do the following: def do_load(self, arg): sitefile = file('sitelist', 'r+', 1) while True: siteline = sitefile.readline() site_rawlist = siteline.split() sitelist[site_rawlist[0]] = site_rawlist[1:] if len(sit

Re: Regarding exception handling

2005-01-30 Thread Dan Perl
"Aggelos I. Orfanakos" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Good point, but with your way, if "s = ... # socket opens" fails, then > nothing will catch it. What I usually do is what I wrote above (place > it below the 2nd try), and when attempting to close it, first use a

Re: Redirecting stdout/err under win32 platform

2005-01-30 Thread yaipa
David, Googling comp.lang.python /w this string "stderr win32" yielded 109 results. So I think if you poke around a bit you will find your answer in the archives. Sorry for no direct help tonight... Cheers, --Alan David Douard wrote: > Hi everybody, > > let me explain by problem: > I am working

RE: variable declaration

2005-01-30 Thread Robert Brewer
AlexanderZatvornitskiy wrote: > I'am novice in python, and I find one very bad thing (from my > point of view) in > language. There is no keyword or syntax to declare variable, > like 'var' in > Pascal, or special syntax in C. It can cause very ugly > errors,like this: > > epsilon=0 > S=0 > whi

Re: python and gpl

2005-01-30 Thread Paul Rubin
John Hunter <[EMAIL PROTECTED]> writes: > The question is: does shipping a backend which imports a module that > links with GPL code make some or all of the library GPL. Literally speaking, no, not automatically, any more than driving a car makes you into a licensed driver if you weren't one alrea

Re: Problem with loading textfiles into dictionaries.

2005-01-30 Thread mercuryprey
Yeah I kind of want to 'reinvent' the pickle and I am aware of that. The problem for me is that the output that pickle dumps to a file is too 'cryptic' as I want the ability to edit the corresponding textfile directly and easily, so I'm going for an own way. But yes, Kartic and you were basically

Re: python and gpl

2005-01-30 Thread Robert Kern
John Hunter wrote: I have a question about what it takes to trigger GPL restrictions in python code which conditionally uses a GPL library. Here is the context of my question. matplotlib, which I develop, is a plotting module which is distributed under a PSF compatible license, and hence we avoid

Re: future of computing languages

2005-01-30 Thread Michele Simionato
I found that page very shallow and superficial. What they call "the language of the future" is actually the language of the present. Python (but also, Ruby, Perl, Smalltalk, Lisp, Scheme, ...) have already most of the features they list. Then they claim "the language of the future will be so diffe

Re: how to find number of processors in python

2005-01-30 Thread Ganesan R
> "muttu" == muttu <[EMAIL PROTECTED]> writes: > hello everybody > am writing a scanner using python which has to get the information for > sun's dual processors, so could any one of you please tell me how to > find the number of processors . is there any api's for this You can run /usr/sbin

Re: Fortran pros and cons (was Re: Coding style article with interesting section on white space)

2005-01-30 Thread beliavsky
Michael Tobis wrote: > [EMAIL PROTECTED] wrote: > > Michael Tobis wrote: > > > Fortran 90/95 is more expressive than Fortran 77 in many ways, as > > described in ... > > http://www.nr.com/CiP97.pdf . > > > > > ... expresses more science per > > line of code and per programming workday. > > The exam

how to find number of processors in python

2005-01-30 Thread muttu
hello everybody am writing a scanner using python which has to get the information for sun's dual processors, so could any one of you please tell me how to find the number of processors . is there any api's for this , and also lemme know how exactly i can write the scannerapi for this, so that it c

variable declaration

2005-01-30 Thread Alexander Zatvornitskiy
Hello All! I'am novice in python, and I find one very bad thing (from my point of view) in language. There is no keyword or syntax to declare variable, like 'var' in Pascal, or special syntax in C. It can cause very ugly errors,like this: epsilon=0 S=0 while epsilon<10: S=S+epsilon epselon=ep

Re: Regarding exception handling

2005-01-30 Thread Dan Perl
"Bryan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > IMO, that is not the reason for the try/finally statement and it is not > redundant. the try/finally statement guarantees the resource is closed > and the try/finally statement only gets executed if and only if the > openin

Re: python and gpl

2005-01-30 Thread Jeremy Bowers
On Sun, 30 Jan 2005 22:25:10 -0600, John Hunter wrote: > The question is: does shipping a backend which imports a module that > links with GPL code make some or all of the library GPL. This > question is complicated, in my mind at least, by several factors. I believe the best and most honest answ

Re: next line, new line

2005-01-30 Thread Jeremy Bowers
On Sun, 30 Jan 2005 20:21:49 -0800, rasdj wrote: > Thanks Jeremy, something like this would work: > > try: > lines = [ line.replace(",\n;", ")\n;") for line in input ] > > If I could figgure out how to: > > IF ':' in line > READ next line in > lines = [ line.replace(",\n;", ")\n;") for line in

python and gpl

2005-01-30 Thread John Hunter
I have a question about what it takes to trigger GPL restrictions in python code which conditionally uses a GPL library. Here is the context of my question. matplotlib, which I develop, is a plotting module which is distributed under a PSF compatible license, and hence we avoid using GPLd code s

Re: next line, new line

2005-01-30 Thread rasdj
Thanks Jeremy, something like this would work: try: lines = [ line.replace(",\n;", ")\n;") for line in input ] If I could figgure out how to: IF ':' in line READ next line in lines = [ line.replace(",\n;", ")\n;") for line in input ] output.write(str.join('', lines)) because there are lots of

Re: gmail access with python!

2005-01-30 Thread Daniel Bickett
On Jeremy Bowers wrote: > Can you expand on that for us non-GMail users? A login is required to view > that page. I apologize, I wasn't aware :) It simply outlines all of the credentials to use gmail with pop3, I'll list it all here: Incoming server: pop.gmail.com Outgoing server: smtp.gmail.com

Re: test_socket.py failure

2005-01-30 Thread x2164
Steve Holden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > hi all, > > > > Linux 2.4.28 > > Glibc 2.2.5 > > gcc 2.95.3 > > > > > > I'm new to Python. > > > > I've compiled Python 2.4 from tar file. > > > > When running 'make test' i'm getting a

Re: Fortran pros and cons (was Re: Coding style article with interesting section on white space)

2005-01-30 Thread Michael Tobis
[EMAIL PROTECTED] wrote: > Michael Tobis wrote: > Fortran 90/95 is more expressive than Fortran 77 in many ways, as > described in ... > http://www.nr.com/CiP97.pdf . > > ... expresses more science per > line of code and per programming workday. The example shown on p 10 illustrates a shorter pi

Re: next line, new line

2005-01-30 Thread Jeremy Bowers
On Sun, 30 Jan 2005 19:42:22 -0800, rasdj wrote: > I have a lot of SQL to convert to postgres from oracle. I have most of the > problems worked out except for this last bit. Many of my tables need the > last comma replaced with a close parenthesis - they look like this: > > create table schema.ta

Re: gmail access with python!

2005-01-30 Thread Jeremy Bowers
On Sun, 30 Jan 2005 21:54:46 -0500, Daniel Bickett wrote: > Indeed, here is a detailed help document on GMail POP3 access: > > http://gmail.google.com/support/bin/answer.py?answer=12103 > > huh...look at that, they're using python :) Never noticed that before. Can you expand on that for us non-

Re: What's so funny? WAS Re: rotor replacement

2005-01-30 Thread Paul Rubin
Skip Montanaro <[EMAIL PROTECTED]> writes: > While it might be convenient to not have to distribute some third > party library in addition to Python, there is a fundamental problem > implementing a crypto algorithm from scratch for inclusion into > Python. There is always the problem that the new

next line, new line

2005-01-30 Thread rasdj
I have a lot of SQL to convert to postgres from oracle. I have most of the problems worked out except for this last bit. Many of my tables need the last comma replaced with a close parenthesis - they look like this: create table schema.table ( FLD000 NUMERIC(10,0) NOT NULL, FLD001 CHAR(3) NOT NULL

Re: gmail access with python!

2005-01-30 Thread Mr Follower
Did you try the CVS version of libgmail? While none of the "release versions" (i.e. up 0.0.8) currently work, as of a week ago the CVS version handled the two recent modifications to Gmail. --Phil. (Author libgmail) -- http://mail.python.org/mailman/listinfo/python-list

Re: What's so funny? WAS Re: rotor replacement

2005-01-30 Thread Skip Montanaro
Nick> I think one of the special things about Python is its batteries Nick> included approach, and a crypto library would seem to be an Nick> obvious battery to install since it doesn't (or needn't) depend on Nick> any other library or application. Obvious for some I suppose (I've

Re: {Spam?} Re: naive doc question

2005-01-30 Thread Skip Montanaro
>> I wanted a list of all the methods of dict for example... where can i >> find it? Terry> Lib Ref 2.3.8 Mapping Types. Do browse chapter 2 so you know Terry> what is there. I think the best doc page to bookmark is the global module index: http://docs.python.org/lib/modind

Re: Regarding exception handling

2005-01-30 Thread Aggelos I. Orfanakos
Good point, but with your way, if "s = ... # socket opens" fails, then nothing will catch it. What I usually do is what I wrote above (place it below the 2nd try), and when attempting to close it, first use an if like: "if locals().has_key('s'):". -- http://mail.python.org/mailman/listinfo/python

Re: Regarding exception handling

2005-01-30 Thread Aggelos I. Orfanakos
I need it because the "various code" may raise other exceptions (not related to sockets). In such case, the "except socket.error, x:" won't catch it, but thanks to the "finally:", it is sure that the socket will close. -- http://mail.python.org/mailman/listinfo/python-list

Re: gmail access with python!

2005-01-30 Thread Daniel Bickett
Indeed, here is a detailed help document on GMail POP3 access: http://gmail.google.com/support/bin/answer.py?answer=12103 huh...look at that, they're using python :) Never noticed that before. Anyway, after that you can simply use a standard POP3 module. There's no need to get fancy and use gmai

tkSnack pitch() for frequency estimation

2005-01-30 Thread Justin Shaw
I am using the tkSnack library to estimate the frequency from a sound file. The pitch seems to drop down an octave at 400 Hertz. For example A~440 Hertz comes out at 220 Hertz. When I use the maxpitch and minpitch options to limit the response to say 380 - 460 the result is all zeros. Any ideas

Re: Regarding exception handling

2005-01-30 Thread Bryan
Dan Perl wrote: "Aggelos I. Orfanakos" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Thanks. This should now be OK: #try: #try: #s = ... # socket opens # ## various code ... #except socket.error, x: ## exception handling #finally: #s.close() # soc

Re: The next Xah-lee post contest

2005-01-30 Thread gene . tani
Tragi-comic. really. BTW you forgot cross-post to c.l.scheme, C, smalltalk and C++ -- http://mail.python.org/mailman/listinfo/python-list

[Python-Announce] cfgparse v01_00 released

2005-01-30 Thread Dan Gass
I'm pleased to announce the initial release of cfgparse (V01_00) Background - cfgparse is a more convenient, flexible, and powerful module for parsing configuration files than the standard library ConfigParser module. cfgparse uses a mor

Re: What's so funny? WAS Re: rotor replacement

2005-01-30 Thread Paul Rubin
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: > > Oh, ok. Earlier you said you wanted user feedback before you could > > conclude that there was reason to want an AES module at all. > > I believe I never said that. I said that I wanted user feedback to > determine whether *this* AES module (where

Re: Help! Host is reluctant to install Python

2005-01-30 Thread gene . tani
Based on discusses with these guys, who know LAMP, python, ruby inside and out, and support it well: http://textdrive.com/ I'm guessing you'd have a hard time finding mod_python / apache hosting unless you get a dedicated server. It's pretty labor-intensive setup and admin-wise. linux shell /

Re: Problem with loading textfiles into dictionaries.

2005-01-30 Thread Kartic
Kartic said the following on 1/30/2005 8:21 PM: [EMAIL PROTECTED] said the following on 1/30/2005 7:43 PM: Hi - It looks like your code encountered a blank line when you got this error. You should move "if len(siteline) == 0" part right after your readline. The way you have done it really does

Re: Problem with loading textfiles into dictionaries.

2005-01-30 Thread Kartic
[EMAIL PROTECTED] said the following on 1/30/2005 7:43 PM: Hello, I want to do the following: def do_load(self, arg): sitefile = file('sitelist', 'r+', 1) while True: siteline = sitefile.readline() site_rawlist = siteline.split() sitelist[site_rawlist[0]] = site_rawlist[1:] if len(siteline) == 0: b

Re: a sequence question

2005-01-30 Thread gene . tani
cookbook's not an easy grep but: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303060 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303279 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/347689 -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with loading textfiles into dictionaries.

2005-01-30 Thread M.E.Farmer
[EMAIL PROTECTED] wrote: > Hello, > I want to do the following: > > def do_load(self, arg): > sitefile = file('sitelist', 'r+', 1) > while True: > siteline = sitefile.readline() > site_rawlist = siteline.split() > sitelist[site_rawlist[0]] = site_rawlist[1:] > if len(siteline) == 0: > break > > I w

Re: Problem with loading textfiles into dictionaries.

2005-01-30 Thread Stephen Thorne
On 30 Jan 2005 16:43:26 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello, > I want to do the following: > > def do_load(self, arg): > sitefile = file('sitelist', 'r+', 1) > while True: > siteline = sitefile.readline() > site_rawlist = siteline.split() > sitelist[site_rawlist[0]] = site_

Problem with loading textfiles into dictionaries.

2005-01-30 Thread mercuryprey
Hello, I want to do the following: def do_load(self, arg): sitefile = file('sitelist', 'r+', 1) while True: siteline = sitefile.readline() site_rawlist = siteline.split() sitelist[site_rawlist[0]] = site_rawlist[1:] if len(siteline) == 0: break I want to load a textfile into a dictionaries and us

Re: Regarding exception handling

2005-01-30 Thread Dan Perl
"Aggelos I. Orfanakos" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thanks. This should now be OK: > > #try: > #try: > #s = ... # socket opens > # > ## various code ... > #except socket.error, x: > ## exception handling > #finally: > #s.close()

Re: type() takes one or *three* arguments!?

2005-01-30 Thread jamesthiele . usenet
Thank you - that explains everything quite nicely. -- http://mail.python.org/mailman/listinfo/python-list

PyGame not working(?) (was: trouble installing numeric)

2005-01-30 Thread Chris Weisiger
On 1/29/05 11:38 PM, Robert Kern wrote: > Chris Weisiger wrote: >> I'm trying to install numeric on my MacOS X box using Darwin, with >> the eventual goal of satisfying all of PyGame's dependencies so I >> can finally start working on my semester project. I would be using >> MacPython,

Re: Regarding exception handling

2005-01-30 Thread Aggelos I. Orfanakos
Thanks. This should now be OK: #try: #try: #s = ... # socket opens # ## various code ... #except socket.error, x: ## exception handling #finally: #s.close() # socket closes -- http://mail.python.org/mailman/listinfo/python-list

Re: is this sort method the same as the one in python 2.4

2005-01-30 Thread Raymond Hettinger
"Pedro Werneck" > > What about this ? > > > # > if sys.version_info >= (2,4): > def sorted(iterable, *args, **kwds): > seq = list(iterable) > seq.sort(*args, **kwds) > return seq > # > > It worked against the TestSorted in lib/test/test_builtins.py The key= and reverse=

Microsoft Visual C++ and pyton

2005-01-30 Thread mike
Hi, I am new with python. Is it possible to have an MFC application and develop some module using python? what are the steps in doing this? can anybody give me a url or some documentation for this.. thanks.. mike -- http://mail.python.org/mailman/listinfo/python-list

Re: ANNOUNCE: KirbyBase 1.7

2005-01-30 Thread Jamey Cribbs
Paul Rubin wrote: That's cute, especially the part about using Python expressions instead of SQL to express queries. I don't see anything in the info page about what happens when you have multiple clients updating the db concurrently. Do you make any attempt to handle that? Yep. There are two se

Re: is this sort method the same as the one in python 2.4

2005-01-30 Thread Raymond Hettinger
"Lowell Kirsh" > How come you reverse the list twice? And why does this preserve stability? It's easy to see if you trace through the steps: Given sample the following dataset and a desire to sort on the first field: >>> data = [('a', 1), ('a', 2), ('b', 3)] Here are the step: >>> data.reverse()

RE: Pystone benchmark: Win vs. Linux (again)

2005-01-30 Thread Delaney, Timothy C (Timothy)
Franco Fiorese wrote: > * Windows XP Pro: 16566.7 pystones/second > * Linux (kernel 2.6.9 NPTL): 12346.2 pystones/second First of all, realise that pystone is not meant to be a general-purpose benchmarking program. It test a specific, *small* subset of the functionality available in Python.

Re: pickle, cPickle, & HIGHEST_PROTOCOL

2005-01-30 Thread Tim Peters
[A.B., Khalid] > I wonder if someone can explain what is wrong here. I am pickling a > list of dictionaries (see code attached) and unpickling it back using > the HIGHEST_PROTOCOL of pickle and cPickle. ... > ... on Win98. Pickles are binary data. Therefore you should open pickle files in binary

Re: how do i create such a thing?

2005-01-30 Thread Steven Bethard
Pedro Werneck wrote: If you need direct access to some atribute, use object.__getattribute__. class DefaultAttr(object): ... def __init__(self, default): ... self.default = default ... def __getattribute__(self, name): ... try: ... value = object.__getattribute_

Re: ANNOUNCE: KirbyBase 1.7

2005-01-30 Thread Paul Rubin
Jamey Cribbs <[EMAIL PROTECTED]> writes: > KirbyBase is a simple, plain-text, database management system written > in Python. It can be used either embedded in a python script or in a > client/server, multi-user mode. You use python code to express your > queries instead of having to use another

Re: is this sort method the same as the one in python 2.4

2005-01-30 Thread Pedro Werneck
What about this ? # if sys.version_info >= (2,4): def sorted(iterable, *args, **kwds): seq = list(iterable) seq.sort(*args, **kwds) return seq # It worked against the TestSorted in lib/test/test_builtins.py On Sun, 30 Jan 2005 08:30:17 +0100 "Fredrik Lundh" <[EM

Fortran pros and cons (was Re: Coding style article with interesting section on white space)

2005-01-30 Thread beliavsky
Michael Tobis wrote: > > Fortran programmers are generally happy with the portability of the > > language. > > Until they try to port something...? Honestly, I can't imagine where > anyone would get this impression. >From the fact that Fortran has been used on hundreds of platforms and that many

RE: gmail access with python!

2005-01-30 Thread Tony Meyer
> i want to write a python program which will grab all my gmail > msgs and store them on my hard drive. [...] > my question is: does anyone have a working script which can > grab msgs from a gmail inbox ? Possibly not of use, but if you're not using POP3 access to your gmail account for anything

ANNOUNCE: KirbyBase 1.7

2005-01-30 Thread Jamey Cribbs
KirbyBase is a simple, plain-text, database management system written in Python. It can be used either embedded in a python script or in a client/server, multi-user mode. You use python code to express your queries instead of having to use another language such as SQL. KirbyBase is disk-base

gmail access with python!

2005-01-30 Thread int
hi, i want to write a python program which will grab all my gmail msgs and store them on my hard drive. i've done an extensive google search and tried _every_ possible gmail python script i could find (including of course libgmail) and none of them seem to work, even on trivial example code. (perha

Re: search engine

2005-01-30 Thread BJörn Lindqvist
> hi all, i´m doing a search engine using python for the spider and php > to make a web for the search. The Database i have choosen is > postgreSQL. Do you think it is a good choosen? Any suggestion? "Databases are implementation details! Considering the database should be deferred as long as poss

pickle, cPickle, & HIGHEST_PROTOCOL

2005-01-30 Thread A.B., Khalid
I wonder if someone can explain what is wrong here. I am pickling a list of dictionaries (see code attached) and unpickling it back using the HIGHEST_PROTOCOL of pickle and cPickle. I am getting an error message and trace backs if the list exceeds eight items. Whether I use pickle or cPickle does n

Re: how do i create such a thing?

2005-01-30 Thread Pedro Werneck
Hi, If you need direct access to some atribute, use object.__getattribute__. >>> class DefaultAttr(object): ... def __init__(self, default): ... self.default = default ... def __getattribute__(self, name): ... try: ... value = object.__getattribute__(self, na

RFC 2965 cookies, cookielib, and mailman.

2005-01-30 Thread John J Lee
Just noticed your c.l.py post quoted below. Nobody but me knows or cares about this obscure stuff ;-) so I'm not surprised you got no answer... C. Titus Brown Dec 27 2004, 12:41 pm wrote: [...] > The issue turned out to be that mailman sends out RFC 2965 [1] cookies, > which are by defa

Re: Help! Host is reluctant to install Python

2005-01-30 Thread Ian
On Wed, 26 Jan 2005 01:40:39 GMT, [EMAIL PROTECTED] wrote: ... >I think you should look into some type of virtual hosting that gives >you more ability to install your own software. Typing "uml hosting" >(UML is user-mode Linux) into Google finds a lot of such services. If >you find one that you

Re: is this sort method the same as the one in python 2.4

2005-01-30 Thread Lowell Kirsh
How come you reverse the list twice? And why does this preserve stability? Raymond Hettinger wrote: "Lowell Kirsh" I'm trying to emulate the sorted() method introduced in python 2.4. The only difference is that it takes a sequence as one of its arguments rather than being a method of the sequence c

how do i create such a thing?

2005-01-30 Thread Lowell Kirsh
I want to create a class called DefaultAttr which returns a default value for all attributes which haven't been given values yet. It will work like this: >> x = DefaultAttr(99) >> print x.foo 99 >> print x.bar 99 >> x.foo = 7 >> print x.foo 7 I already have a similar class called DefaultDict whi

Re: test_socket.py failure

2005-01-30 Thread Steve Holden
[EMAIL PROTECTED] wrote: hi all, Linux 2.4.28 Glibc 2.2.5 gcc 2.95.3 I'm new to Python. I've compiled Python 2.4 from tar file. When running 'make test' i'm getting a failure in test_socket. Running './python Lib/test/test_socket.py' yields: ==

Re: Regarding exception handling

2005-01-30 Thread beliavsky
Aggelos I. Orfanakos wrote: > (I don't know why, but indentation was not preserved once I posted.) This problem and its possible solutions was discussed here in the thread "OT: spacing of code in Google Groups". -- http://mail.python.org/mailman/listinfo/python-list

Re: Need programming tip

2005-01-30 Thread beliavsky
A Usenet tip is that one should never use such a generic subject as "need programming tip" or the ever-popular "newbie question". In this case, "create a database of posts made to binary groups" could have been a better title, so that people unable to answer to the question and not interested in th

Re: limited python virtual machine

2005-01-30 Thread Nick Craig-Wood
Jack Diederich <[EMAIL PROTECTED]> wrote: > The Xen virtual server[1] was recently metnioned on slashdot[2]. > It is more lightweight and faster than full scale machine emulators because > it uses a modified system kernel (so it only works on *nixes it has been > ported to). ...it also uses py

Re: type() takes one or *three* arguments!?

2005-01-30 Thread Pedro Werneck
Hi, Up to Python 2.2, type() was just a function to return an object type. >From 2.2 on, type have this behavior when called with only one argument and is used to create a new type when called with 3 arguments. >From http://www.python.org/2.2/descrintro.html : "The signature of type() requires

Re: Need programming tip

2005-01-30 Thread ssaeed1973
Alex, Thanks, I will try this. Salman -- http://mail.python.org/mailman/listinfo/python-list

type() takes one or *three* arguments!?

2005-01-30 Thread jamesthiele . usenet
I was looking at Simon Burton's Povray.py code (part of pypov) and saw this line: globals()[name] = type( name, (KWItem,), {} ) # nifty :) where 'KWItem' was a class. It did seem nifty, but it was unclear to me what was happening. I went to python.org's online documentation which said that type()

Re: Regarding exception handling

2005-01-30 Thread Aggelos I. Orfanakos
(I don't know why, but indentation was not preserved once I posted.) -- http://mail.python.org/mailman/listinfo/python-list

Re: The next Xah-lee post contest

2005-01-30 Thread Bryan
Eric Pederson wrote: From: Arthur <[EMAIL PROTECTED]> Not sure how Xah got himself into all this. One can easily see that Java programmers are geeks who secretly wanted to make the football team and are now trying to conform, ignoring their language's critical lack of Prolog syntax. Python c

Regarding exception handling

2005-01-30 Thread Aggelos I. Orfanakos
Hello. In a program, I want to ensure that a socket closes (so I use try ... finally), but I also want to catch/handle a socket exception. This is what I have done: try: try: s = ... # socket opens # various code ... except socket.error, x: # exception handling finally: s.close() # socket closes

Re: The next Xah-lee post contest

2005-01-30 Thread Eric Pederson
> From: Arthur <[EMAIL PROTECTED]> > Not sure how Xah got himself into all this. One can easily see that Java programmers are geeks who secretly wanted to make the football team and are now trying to conform, ignoring their language's critical lack of Prolog syntax. Python coders, similarly

Re: An mysql-python tutorial?

2005-01-30 Thread Andy Dustman
It definitely looks like an access control problem; recheck your grants. -- http://mail.python.org/mailman/listinfo/python-list

Re: search engine

2005-01-30 Thread Premshree Pillai
On 30 Jan 2005 11:19:30 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > hi all, i´m doing a search engine using python for the spider and php > to make a web for the search. The Database i have choosen is Just curious: is there any particular reason you want to use PHP for building the web i

Re: Coding style article with interesting section on white space

2005-01-30 Thread Michael Sparks
On 30 Jan 2005 [EMAIL PROTECTED] wrote: > Sparring > with Alex Martelli is like boxing Mike Tyson, except that one > experiences brain enhancement rather than brain damage :). +1 QOTW :-) Michael. -- http://mail.python.org/mailman/listinfo/python-list

search engine

2005-01-30 Thread jlrodilla
hi all, i´m doing a search engine using python for the spider and php to make a web for the search. The Database i have choosen is postgreSQL. Do you think it is a good choosen? Any suggestion? if anybody in interested in colaborate please send an e-mail to [EMAIL PROTECTED] In a few weeks i will

Exception from bsddb module

2005-01-30 Thread jalil
I am using Python 2.4 and get this exception when running my mod_python application. This used to work in my older environment. Any ideas on how I can debug this issue? -Jalil Mod_python error: "PythonHandler mod_python.psp" Traceback (most recent call last): File "/usr/local/lib/python2.4/si

Re: Disassembling strings and turning them into function parameters

2005-01-30 Thread mercuryprey
Hey, that's exactly what I need! Thanks for your help, the others too of course :) Didn't expect to get answers so quickly.. -- http://mail.python.org/mailman/listinfo/python-list

Re: installing tkiner

2005-01-30 Thread rccharles
Robert wrote: > I am trying to use tkinter on macos 10.2.6. There is a documented restriction that you cannot run gui programs from the ide. re-installed TclTkAquaBI-8.4.6.1-Jaguar.dmg used the pythonw command. Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Disassembling strings and turning them into function parameters

2005-01-30 Thread M.E.Farmer
[EMAIL PROTECTED] wrote: > Hi, > I'm pretty new to Python, to programming overall...so how would I make > something where the user inputs multiple words in a string - like > "connect 123.123.123.123 21 user password" or similar, and then I can > split this string up to pass these arguments to a fun

  1   2   >