Re: [perl-python] sending email

2005-01-30 Thread Jürgen Exner
Xah Lee wrote: [...] > Here's how the situation stands as of 2001 March: ^^ Well, at least now we know why Mr. Lee is a little bit behind jue -- http://mail.python.org/mailman/listinfo/python-list

Re: Coding style article with interesting section on white space

2005-01-30 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > The recent "Pystone Benchmark" message says that Python is only 75% as > fast on Linux as on Windows. no, it really only says that the Pystone benchmark is 75% as fast as Linux as on Windows, on the poster's hardware, using his configuration, and using different compile

Re: limited python virtual machine

2005-01-30 Thread Alex Martelli
Nick Coghlan <[EMAIL PROTECTED]> wrote: ... > > If you _can_ execute (whatever) in a separate process, then an approach > > based on BSD's "jail" or equivalent features of other OS's may be able > > to give you all you need, without needing other restrictions to be coded > > in the interpreter (

Test of comp.lang.python to python-list to gmane pathway.

2005-01-30 Thread Terry Reedy
Feel free to ignore this. Some system falsely labeled this post (sent via gmane) as possible spam. I am sending it back in the opposite direction to see what transpires that way. Sorry for the disturbance. tjr "Terry Reedy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > "Mi

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

2005-01-30 Thread "Martin v. Löwis"
Paul Rubin wrote: 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 this is either your from-scratch implement

Re: Need programming tip

2005-01-30 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: ... > 1511156 As Requested 2000 adv server -2000AdvSrv.vol001+02.PAR2 (1/4) - > 21/27 > 1511157 As Requested 2000 adv server -2000AdvSrv.vol001+02.PAR2 (2/4) - > 21/27 ... > would be to look for (1/ in the subject string then find the > denominator and l

Re: Coding style article with interesting section on white space

2005-01-30 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > Michael Tobis wrote: > > (unwisely taking the bait...) > > > > If you like your language to look like this > > http://www.cs.rpi.edu/~szymansk/OOF90/bugs.html > > then more power to you. > > Thanks for pointing out that interesting article on Fortran 90 bugs. > How lo

Re: PythonWin (build 203) for Python 2.3 causes Windows 2000 to grind to a halt?

2005-01-30 Thread Martin Bless
[EMAIL PROTECTED] (Chris P.)] >The bug you suggested is exactly the problem that I was having... I >had looked through the bugs being tracked, but the title of that one >didn't jump out at me as something that would help. Thanks! Yes, using Python24 and the latest win32 build on my machine the b

Re: naive doc question

2005-01-30 Thread Duncan Booth
Gabriel B. wrote: > Is it just me that can't find a full reference in the docs? > > I wanted a list of all the methods of dict for example... where can i > find it? > > Thanks, and sorry if this question is just dumb, i really can't find > it If you want to find out about all the methods of d

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

2005-01-30 Thread Nick Craig-Wood
Skip Montanaro <[EMAIL PROTECTED]> wrote: > Fine. Go build a sumo distribution and track the normal CPython. > The problem isn't all that new. (Take a look at scipy.org for one > take on that theme. Of course Linux distros have been doing their > take on this forever.) If I'm writing code

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

2005-01-30 Thread Nick Craig-Wood
Paul Rubin wrote: > "Martin v. Löwis" <[EMAIL PROTECTED]> writes: > > Apparently, people disagree on what precisely the API should be. E.g. > > cryptkit has > > > > obj = aes(key) > > obj.encrypt(data) > > I don't disagree about the API. The cryptkit way is better than ECB > example I gave,

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

2005-01-30 Thread Paul Rubin
Nick Craig-Wood <[EMAIL PROTECTED]> writes: > There is a PEP about this... > > API for Block Encryption Algorithms v1.0 > http://www.python.org/peps/pep-0272.html Yes, I know about that and have been in contact with its author. He and I are in agreement (or at least were in agreement some ti

Re: Python 2.1 - 2.4 differences

2005-01-30 Thread RPM1
"BOOGIEMAN" <[EMAIL PROTECTED]> wrote ... > I found some e-book about Python 2.1, I want to print it but just to check > first if sintax of Python 2.1 is same as 2.4 ? Also does anybody know where > can I download any newer Python related e-book, because there isn't any > published yet in my count

Re: The next Xah-lee post contest

2005-01-30 Thread Arthur
On Sat, 29 Jan 2005 15:41:00 +0100, PA <[EMAIL PROTECTED]> wrote: > >On Jan 29, 2005, at 15:32, rbt wrote: > >> Unix donkey! You not elegant. You have poor design. >> Sloppy Perl monkey! You be lazy! You code very very bad. >> >> Xah know all! > >Follow The True Path, follow The Xah Way To Enlight

Re: [perl-python] sending email

2005-01-30 Thread Tad McClellan
Jürgen Exner <[EMAIL PROTECTED]> wrote: > Xah Lee wrote: > [...] >> Here's how the situation stands as of 2001 March: > ^^ > > Well, at least now we know why Mr. Lee is a little bit behind Mr. Lee is a *big* behind! -- Tad McClellan

test_socket.py failure

2005-01-30 Thread x2164
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: what's OOP's jargons and complexities?

2005-01-30 Thread Pascal Bourguignon
"Larry" <[EMAIL PROTECTED]> writes: > Xah Lee wrote: > > in computer languages, often a function definition looks like this: > > > [EMAIL PROTECTED] > > http://xahlee.org/PageTwo_dir/more.html > > Your ideas are original, insightful and simply reflect incredibly deep > creative genius. I have

Re: limited python virtual machine

2005-01-30 Thread Jack Diederich
On Sun, Jan 30, 2005 at 11:59:39AM +1000, Nick Coghlan wrote: > Alex Martelli wrote: > >It didn't seem to me that Steven's question was so restricted; and since > >he thanked me for my answer (which of course is probably inapplicable to > >some custom interpreter that's not written yet) it appears

ANN: Frog 1.3 released (python 'blog' application)

2005-01-30 Thread Irmen de Jong
I've just uploaded the Frog 1.3 release. Frog is a blog (web log) system written in 100% Python. It is a web application written for Snakelets. It outputs XHTML, is fully unicode compatible, small, and doesn't require a database. You can read about it and download it here: http://snakelets.sourc

Re: [perl-python] sending email

2005-01-30 Thread YYusenet
Xah Lee wrote: [snip] The first two has glaring problems. I'm sorry i forgot what they ^ ^^ are. [snip] How can you complain about *Mail::Mailer* and *Mail::Send* when you don't even know what they are? -- k g a b e r t (at) x

Re: [perl-python] sending email

2005-01-30 Thread Chris Mattern
YYusenet wrote: > Xah Lee wrote: > [snip] >> >> The first two has glaring problems. I'm sorry i forgot what they >^ ^^ >> are. > > [snip] > > How can you complain about *Mail::Mailer* and *Mail::Send* when you > don't even k

Re: naive doc question

2005-01-30 Thread Philippe C. Martin
Gabriel B. wrote: > Is it just me that can't find a full reference in the docs? > > I wanted a list of all the methods of dict for example... where can i > find it? > > Thanks, and sorry if this question is just dumb, i really can't find > it Also if you are using mozilla or firefox, I sugges

Re: Coding style article with interesting section on white space

2005-01-30 Thread beliavsky
Alex Martelli wrote: > > For scientific computation, consider the case of Numeric > > and Numarray. I don't think Numeric binaries are available for Python > > 2.4, > > ? Just > googled and visited the first hit -- I don't currently

Re: Coding style article with interesting section on white space

2005-01-30 Thread Andrew McLean
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> writes You're saying that using a different and better compiler cannot speed the execution of your Fortran program by 25% when you move it from one platform to another...?! This seems totally absurd to me, and yet I see no other wa

Re: Coding style article with interesting section on white space

2005-01-30 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > I had in mind the Polyhedron Fortran 90 benchmarks for Windows and > Linux on Intel x86 at > http://www.polyhedron.co.uk/compare/linux/f90bench_p4.html and > http://www.polyhedron.co.uk/compare/win32/f90bench_p4.html . The speed > differences of Absoft, Intel, and Lahe

Re: Coding style article with interesting section on white space

2005-01-30 Thread Michael Tobis
[EMAIL PROTECTED] wrote: > Michael Tobis wrote: > > (unwisely taking the bait...) > > > > If you like your language to look like this > > http://www.cs.rpi.edu/~szymansk/OOF90/bugs.html > > then more power to you. > > Thanks for pointing out that interesting article on Fortran 90 bugs. > How long w

Re: what's OOP's jargons and complexities?

2005-01-30 Thread Cesar Rabak
Pascal Bourguignon escreveu: "Larry" <[EMAIL PROTECTED]> writes: Xah Lee wrote: in computer languages, often a function definition looks like this: [EMAIL PROTECTED] http://xahlee.org/PageTwo_dir/more.html Your ideas are original, insightful and simply reflect incredibly deep creative genius. I

Disassembling strings and turning them into function parameters

2005-01-30 Thread mercuryprey
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 function like ftp_connect(ip, port, us

Re: Disassembling strings and turning them into function parameters

2005-01-30 Thread Peter Hansen
[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 function like

Re: Disassembling strings and turning them into function parameters

2005-01-30 Thread Fredrik Lundh
<[EMAIL PROTECTED]> wrote: > 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 functi

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

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 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

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

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

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

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: 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: 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

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 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

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

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: Need programming tip

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

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: 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: 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: 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: 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: ==

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: 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

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

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: 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

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: 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

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

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

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

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: 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

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: 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: 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: 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: 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: 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

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: 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=

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

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: 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

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()

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: 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_

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: 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 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: 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: 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: 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

[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: 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

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

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: 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

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: 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: {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: 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: 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

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: 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

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: 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: 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: 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: 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: 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

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

  1   2   >