Re: Convert from unicode chars to HTML entities

2007-01-28 Thread Leif K-Brooks
Steven D'Aprano wrote: > A few issues: > > (1) It doesn't seem to be reversible: > '© and many more...'.decode('latin-1') > u'© and many more...' > > What should I do instead? Unfortunately, there's nothing in the standard library that can do that, as far as I know. You'll have to write y

Re: HTMLParser's start_tag method never called ?

2007-02-06 Thread Leif K-Brooks
ychaouche wrote: > class ParseurHTML(HTMLParser): > def __init__(self): > HTMLParser.__init__(self) > > def start_body(self,attrs): > print "this is my body" def start_tag(self, name, attrs): if name == 'body': print "this is my body" -- http://mail.python.o

Re: 'IF' Syntax For Alternative Conditions

2007-02-07 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote: > However, I cannot find, nor create by trial-and-error, the syntax for > alternative conditions that are ORed; e.g., > > if cond1 OR if cond2: > do_something. if cond1 or cond2: do_something() -- http://mail.python.org/mailman/listinfo/python-list

Re: begin to parse a web page not entirely downloaded

2007-02-08 Thread Leif K-Brooks
k0mp wrote: > Is there a way to retrieve a web page and before it is entirely > downloaded, begin to test if a specific string is present and if yes > stop the download ? > I believe that urllib.openurl(url) will retrieve the whole page before > the program goes to the next statement. Use urllib.u

Re: begin to parse a web page not entirely downloaded

2007-02-08 Thread Leif K-Brooks
k0mp wrote: > It seems to take more time when I use read(size) than just read. > I think in both case urllib.openurl retrieve the whole page. Google's home page is very small, so it's not really a great test of that. Here's a test downloading the first 512 bytes of an Ubuntu ISO (beware of wrap)

Re: default mutable arguments

2007-02-08 Thread Leif K-Brooks
Gigs_ wrote: > I read that this is not the same: > def functionF(argString="abc", argList = None): > if argList is None: argList = [] # < this > ... > def functionF(argString="abc", argList=None): > argList = argList or [] # and this > ... > > Why

Re: def obj()

2007-02-08 Thread Leif K-Brooks
Gert Cuykens wrote: > def obj(): >return {'data':'hello', >'add':add(v)} > > def add(v): >data=data+v > > if __name__ == '__main__': >test=obj() >test.add('world') >print test.data > > I don't know why but i have one of does none class c programing style > mo

Re: About getattr()

2007-02-11 Thread Leif K-Brooks
Jm lists wrote: > Since I can write the statement like: > print os.path.isdir.__doc__ > Test whether a path is a directory > > Why do I still need the getattr() func as below? > print getattr(os.path,"isdir").__doc__ > Test whether a path is a directory You don't. getattr() is only us

Pep 3105: the end of print?

2007-02-15 Thread Edward K Ream
name 'print' in all programs that aim to support Python 2.x and Python 3.x. EKR Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Pep 3105: the end of print?

2007-02-15 Thread Edward K Ream
Precisely my point: pep 3105 will force the elimination of the name 'print'. Edward ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.

Re: Pep 3105: the end of print?

2007-02-15 Thread Edward K Ream
mistaken :-) Edward ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
It will be interesting to see how this plays out. Users, not developers, will determine when Python 2.x becomes extinct. Edward ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
foo' to 'print2(foo)'. Edward ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
ido wanted to improve print in such a way that *more* people would use it. But the effect of the pep is that *less* people will be able to use print, *regardless* of how backward compatible Python 3.x is 'allowed' to be. Edward ----

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
ed way, with a change in major > version number, it's a reasonable way (probably the *only* reasonable way) > to remove particular kinds of cruft from any application. Agreed. Edward ---- Edward K. Ream ema

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
oof that the converter must change print to print2 (or some other name) in order to maintain a common code base. How much clearer can I be? If a common code base is desired, it *is* the end of print Edward Edward K. Ream em

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
> There could be something like from __future__ import print_function To repeat: this would be compatible only with Python 2.6. Edward Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edream

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
27;line',)\nafter"). print ('line',) print ('after') 3. print ('line',end='') produces a syntax error in Python 2.x: print ('line',end='') ^ SyntaxError: invalid syntax That&#x

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
> print is only a problem if you expect your code to work under both Python > 2.x and 3.x. Exactly. Edward Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/fron

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
ess pain. Edward ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
f the Python 3.0 code were considered the 'master' code, the developer would need a 3to2 translater. Either disprove the theorum or give up the notion of having a common code base that uses print. Edward ---- Edwa

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
than two characters, that does not conflict with either an existing global function or module. Edward ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html ---

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
eed, Leo's startup code already runs unchanged under CPython and IronPython. I expect minimal changes will be needed to run Leo's core under Jython. And I *am* talking about a single code base: no translator needed. Edward ----

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
se no needless problems for anyone. Having an official print function is a *good* idea, provided it isn't called print :-) Edward ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/e

Re: Pep 3105: the end of print?

2007-02-16 Thread Edward K Ream
ith dbgclr, but that's another story... Edward ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Lists: Converting Double to Single

2007-02-26 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote: > So I have lists that look like this: [1, 2, 3, 4, 5]. When I > concatenate lists, I end up with a list of lists that looks like > this: [[1, 2, 3. 4, 5]. [6, 7. 8, 9. 10]]. Really? >>> [1, 2, 3, 4, 5] + [6, 7, 8, 9, 10] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] > Then, I aver

Re: How to Read Bytes from a file

2007-03-01 Thread Leif K-Brooks
Alex Martelli wrote: > You should probaby prepare before the loop a mapping from char to number > of 1 bits in that char: > > m = {} > for c in range(256): > m[c] = countones(c) Wouldn't a list be more efficient? m = [countones(c) for c in xrange(256)] -- http://mail.python.org/mailman/listin

Leo 4.4.5 beta 1 released

2007-11-16 Thread Edward K Ream
edreamleo/testimonials.html ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http://mail.python.org/mailman

Leo 4.4.5 beta 2 released

2007-12-07 Thread Edward K Ream
oad: http://sourceforge.net/project/showfiles.php?group_id=3458 CVS: http://leo.tigris.org/source/browse/leo/ Quotes: http://webpages.charter.net/edreamleo/testimonials.html ---- Edward K. Ream email: [EMAIL PROTECTED]

Leo 4.4.5 final released

2007-12-11 Thread Edward K Ream
s: http://webpages.charter.net/edreamleo/testimonials.html ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http://mail.p

ANN: Leo 4.4.6 beta 1 released

2007-12-17 Thread Edward K Ream
.net/projects/leo/ Download: http://sourceforge.net/project/showfiles.php?group_id=3458 CVS: http://leo.tigris.org/source/browse/leo/ Quotes: http://webpages.charter.net/edreamleo/testimonials.html Edward K. Ream email: [E

Bug writing/reading to file.

2007-12-24 Thread arne . k . h
Hi! :) Im new to python, and I have made a electronic diary - its just a task. Here is the code: http://pastebin.com/m49391798 The bug is (feel free to download and test it) that i can't see what i wrote in the diary without restarting the program. Here is an example: 1: I start the program 2: (

ANN: Leo 4.4 b4 released

2006-04-21 Thread Edward K. Ream
ward Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Leo 4.4 b4 released

2006-04-21 Thread Edward K. Ream
Correction: Leo's cvs repository has been moved to tigris: http://leo.tigris.org/source/browse/leo/ Edward Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front

Re: Inexplicable behaviour of

2006-04-23 Thread Leif K-Brooks
Fabiano Sidler wrote: > Have a look to the following lines of code: > --- snip --- > class Foo: pass > def bar(): pass > Foo.bar = bar > --- snap --- > > Why does 'bar.__get__(Foo) is Foo.bar' evaluate to False here? Did I > misunderstand the descriptor protocol? bar.__get__(None, Bar) is what yo

Re: modifying iterator value.

2006-04-26 Thread Leif K-Brooks
chun ping wang wrote: > i want to modify an iterator value. > > for x in someList >x = 1 for index, value in enumerate(someList): someList[index] = 1 -- http://mail.python.org/mailman/listinfo/python-list

ANN: Leo 4.4 rc1 released

2006-04-28 Thread Edward K. Ream
.net/edreamleo/testimonials.html Edward Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html --

Re: scope of variables

2006-05-03 Thread Leif K-Brooks
Gary Wessle wrote: > the example was an in-accuretlly representation of a the problem I am > having. my apologies. > > a = [] > def prnt(): >print len(a) > prnt > > > I expect to get 0 "the length of list a" Python requires parenthesis to call a function. >>> a = [] >>> def prnt(

Re: which is better, string concatentation or substitution?

2006-05-07 Thread Leif K-Brooks
John Salerno wrote: > My initial feeling is that concatenation might take longer than > substitution Doesn't look that way: [EMAIL PROTECTED]:~$ python -m timeit "'%s\n\n' % 'foobar'" 100 loops, best of 3: 0.6 usec per loop [EMAIL PROTECTED]:~$ python -m timeit "'' + 'foobar' + '\n\n'" 1

Re: which is better, string concatentation or substitution?

2006-05-07 Thread Leif K-Brooks
fuzzylollipop wrote: > niether .join() is the fastest Please quote what you're replying to. No, it's the slowest: [EMAIL PROTECTED]:~$ python -m timeit "'%s\n\n' % 'foobar'" 100 loops, best of 3: 0.607 usec per loop [EMAIL PROTECTED]:~$ python -m timeit "'' + 'foobar' + '\n\n'" 100 loops

Re: Multi-line lambda proposal.

2006-05-08 Thread Leif K-Brooks
Kaz Kylheku wrote: > But suppose that the expression and the multi-line lambda body are > reordered? That is to say, the expression is written normally, and the > mlambda expressions in it serve as /markers/ indicating that body > material follows. This results in the most Python-like solution. I

ANN: Leo 4.4 Final released

2006-05-11 Thread Edward K. Ream
html Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http://mail.python.org/mailman/listinfo/python-list

Re: enumerate() question

2006-05-22 Thread Leif K-Brooks
Gregory Petrosyan wrote: > Hello! > I have a question for the developer[s] of enumerate(). Consider the > following code: > > for x,y in coords(dots): > print x, y > > When I want to iterate over enumerated sequence I expect this to work: > > for i,x,y in enumerate(coords(dots)): > print

Two idle questions

2006-05-25 Thread Edward K. Ream
these tasks easier. Or maybe they already exist? EKR ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http

Safe eval critique (homework done)

2006-05-26 Thread Babar K. Zafar
ment passed to 'exec' can't contain modules or builtins Is there some obvious security hole I'm missing? How easily could one compromise the restricted enviroment? Thanks, Babar K. Zafar PS. Here are some simple unittests to give you a feel for the module: class Tes

Leo 4.4.6 beta 2 released

2008-01-15 Thread Edward K Ream
.net/projects/leo/ Download: http://sourceforge.net/project/showfiles.php?group_id=3458 CVS: http://leo.tigris.org/source/browse/leo/ Quotes: http://webpages.charter.net/edreamleo/testimonials.html Edward K. Ream email: [E

ANN: Leo 4.4.6 final released

2008-01-27 Thread Edward K Ream
.net/projects/leo/ Download: http://sourceforge.net/project/showfiles.php?group_id=3458 CVS: http://leo.tigris.org/source/browse/leo/ Quotes: http://webpages.charter.net/edreamleo/testimonials.html Edward K. Ream email: [E

ANN: Leo 4.4.7 beta 1 released

2008-02-13 Thread Edward K Ream
ials.html ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http://mail.python.org/mailman/listinfo/python-list

Re: ILeo (IPython-Leo bridge); a marriage made in heaven?

2008-02-23 Thread Edward K Ream
Your ideas are destined to be of great importance to both the IPython and Leo communities. I shall continue this discussion at: http://groups.google.com/group/leo-editor/browse_thread/thread/3747a122f913cd7f Edward Edward K

ANN: Leo 4.4.8 beta 2 released

2008-03-14 Thread Edward K Ream
p://sourceforge.net/project/showfiles.php?group_id=3458 Bzr: http://code.launchpad.net/leo-editor/ Quotes: http://webpages.charter.net/edreamleo/testimonials.html ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://w

ANN: Leo 4.4.8 b3 released

2008-03-28 Thread Edward K Ream
net/leo-editor/ Quotes: http://webpages.charter.net/edreamleo/testimonials.html ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edream

Re: is python Object oriented??

2009-01-31 Thread thmpsn . m . k
On Jan 30, 12:15 am, Chris Rebert wrote: > - Python supports encapsulation. Prefixing an attribute/method with an > underscore indicates that other programmers should treat it as > 'private'. However, unlike B&D languages, Python itself does nothing > to enforce this privacy, leaving it instead to

Re: is python Object oriented??

2009-01-31 Thread thmpsn . m . k
On Jan 30, 2:32 pm, Michael Torrie wrote: > Veerendra Ganiger wrote: > > Python is not purely object oriented programming, because we can write > > functions without any class. > > You are right, predefined class attributes are available when we write or > > execute a piece of python code without

Re: is python Object oriented??

2009-01-31 Thread thmpsn . m . k
On Jan 31, 2:27 pm, Christian Heimes wrote: > thmpsn@gmail.com schrieb: > > > But it's only a faking, and things such as inheritance and > > polymorphism are implemented clumsily (actually I'm not even sure > > about polymorphism). And of course, there are still no private > > members. > > Do

Re: is python Object oriented??

2009-02-01 Thread thmpsn . m . k
On Feb 1, 1:50 am, Marc 'BlackJack' Rintsch wrote: > On Sat, 31 Jan 2009 15:28:14 -0800, thmpsn.m.k wrote: > > On Jan 31, 2:27 pm, Christian Heimes wrote: > >> Do you honestly believe that C++'s private members are really private? > >> Privateness is only enforced during parsing time. Nobody can

Re: is python Object oriented??

2009-02-02 Thread thmpsn . m . k
On Feb 2, 2:55 am, Stephen Hansen wrote: > > This is proven > > by your statement above, whereby you are driving a user away, > > simply because the language, in one small aspect, does not > > give him what he wants, and the tenor of this thread has been > > very much: "That's how it is - like it

Re: is python Object oriented??

2009-02-03 Thread thmpsn . m . k
On Feb 3, 1:14 am, David Cournapeau wrote: > On Tue, Feb 3, 2009 at 2:37 PM, Russ P. wrote: > > On Feb 2, 7:48 pm, "Rhodri James" wrote: > >> On Tue, 03 Feb 2009 02:16:01 -, Russ P. wrote: > >> > Here we go again. If you have access to the source code (as you nearly > >> > always do with Py

Re: is python Object oriented??

2009-02-03 Thread thmpsn . m . k
On Feb 3, 12:05 pm, David Cournapeau wrote: > On Wed, Feb 4, 2009 at 2:36 AM,   wrote: > > On Feb 3, 1:14 am, David Cournapeau wrote: > >> On Tue, Feb 3, 2009 at 2:37 PM, Russ P. wrote: > >> > On Feb 2, 7:48 pm, "Rhodri James" wrote: > >> >> On Tue, 03 Feb 2009 02:16:01 -, Russ P. > >> >>

Re: is python Object oriented??

2009-02-04 Thread thmpsn . m . k
On Feb 4, 3:11 am, Bruno Desthuilliers wrote: > thmpsn@gmail.com a écrit : > > > > > On Feb 3, 1:14 am, David Cournapeau wrote: > (snip) > >> after all, we have used FILE* for years and I have no idea about the FILE > >> structure. > > > Your lack of knowledge about it doesn't mean that it ha

Re: what's so difficult about namespace?

2008-11-26 Thread Tamas K Papp
On Wed, 26 Nov 2008 21:32:24 +, Kaz Kylheku wrote: > See: > http://arcfn.com/2008/07/why-your-favorite-programming-language-is- unpopular.html That was 404 for me, but http://arcfn.com/2008/07/why-your-favorite-language-is-unpopular.html works. Interesting, thanks for mentioning it. Tamas

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Tamas K Papp
On Tue, 02 Dec 2008 13:57:35 -0800, Lew wrote: > Xah Lee wrote: >> If [yo]u would like to learn [the] [E]nglish lang[uage] and writing >> insights from me, peruse: > > /Au contraire/, I was suggesting a higher standard for your posts. Hi Lew, It is no use. Xah has been posting irrelevant rants

Python in C

2008-12-29 Thread thmpsn . m . k
I've just downloaded Python's mainstream implementation (CPython), which is written in C. Not to my surprise, I feel like I'm looking at unstructured spaghetti, and I'm having trouble figuring out how it all works together. (Please bear with me; I'm just going through the usual frustration that any

Re: Why not Ruby?

2009-01-01 Thread Tamas K Papp
On Thu, 01 Jan 2009 23:28:08 +0100, Richard Riley wrote: > posts controversial but always interesting. His ELisp tutorial is far > and away better than anything else out there for the programmer moving > to Elisp IMO. He backs up his points with reasons and supportive Programmers don't "move" to

Leo 4.6 beta 1 released

2009-03-25 Thread Edward K Ream
com/group/leo-editor Download: http://sourceforge.net/project/showfiles.php?group_id=3458 Bzr: http://code.launchpad.net/leo-editor/ Quotes: http://webpages.charter.net/edreamleo/testimonials.html ---- Edward K. Ream email

importing part of a module without executing the rest

2008-06-13 Thread krishna . 000 . k
file1.py -- a = 20 from abc import * print "Should this be printed when 'a' is alone imported from this module" file2.py -- from file1 import a print a file2.py is used in a context where 'from abc import *' statement doesn't make sense but it can make sense of (and requires) 'a'

ANN: Leo 4.5 b1 released

2008-06-28 Thread Edward K Ream
itor Download: http://sourceforge.net/project/showfiles.php?group_id=3458 Bzr: http://code.launchpad.net/leo-editor/ Quotes: http://webpages.charter.net/edreamleo/testimonials.html ---- Edward K. Ream email: [EMAIL P

Re: Question

2008-07-19 Thread Venky K Shankar
On Saturday 19 July 2008 03:14:20 pm Peter Otten wrote: > [EMAIL PROTECTED] wrote: > > Why is Perl so much better than python? > > Because you have the video: > > http://mail.python.org/pipermail/python-list/2004-March/253370.html >> what about this ? i feel python's better :) >> h

Re: How do you check if a program/process is running using python?

2008-07-19 Thread Venky K Shankar
On Sunday 20 July 2008 12:08:49 am Lamonte Harris wrote: > How do you check if a program or process is running when using python? > What I want to do is have an infinite loop to check if a program is running > or not and send data to my web server to check yes or no. Is this > possible? If so how

ANN: Leo 4.4.8 rc1 released

2008-04-03 Thread Edward K Ream
net/leo-editor/ Quotes: http://webpages.charter.net/edreamleo/testimonials.html ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edream

ANN: Leo 4.4.8 final

2008-04-06 Thread Edward K Ream
net/leo-editor/ Quotes: http://webpages.charter.net/edreamleo/testimonials.html ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edream

pylirc question: clearing the queue

2008-04-07 Thread jesse . k . rosenthal
Hi all, Is there a way in the pylirc module to either (a) get it to stop listening for a period of time, or (b) clear the queue of any stored up commands? I have a script that starts mplayer, and I use my remote while I'm running mplayer. The shell script waits (subrpocess.Popen.wait()) for the mp

ANN: Leo 4.5 beta 3 released

2008-08-15 Thread Edward K Ream
eamleo/testimonials.html ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http://mail.python.org/mailman/listinfo/python-list

ANN: Leo 4.5 beta 4 released

2008-08-25 Thread Edward K Ream
o-editor/ Quotes: http://webpages.charter.net/edreamleo/testimonials.html ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -

ANN: Leo 4.5 rc1 released

2008-08-28 Thread Edward K Ream
eamleo/testimonials.html ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http://mail.python.org/mailman/listinfo/python-list

Leo 4.5 final released

2008-09-02 Thread Edward K Ream
//code.launchpad.net/leo-editor/ Quotes: http://webpages.charter.net/edreamleo/testimonials.html ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.

Oserror: [Errno 20]

2006-04-03 Thread k r fry
Hi, I am new to this list and also programming with python. I have an error: oserror [errno 20] not a directory "katiescint.py" The piece of code causing the problem is: [code] for subdir in os.listdir(DATADIR): #loop through list of strings file=FITS.Read(DATADIR+'/'+subdir+

Re: Oserror: [Errno 20]

2006-04-03 Thread k r fry
r: 'module' object has no attribute 'istdir' I did think maybe it was meant to be "listdir" instead of "istdir", but that doesn't work either. Sorry to be a pain. Peter Hansen wrote: > k r fry wrote: > >> Hi, I am new to this list and als

Re: Oserror: [Errno 20]

2006-04-03 Thread k r fry
subdir in os.path.listdir(DATADIR): #loop through list of strings and here is what I get: Traceback (most recent call last): File "katiescint.py", line 153, in ? for subdir in os.path.listdir(DATADIR): #loop through list of strings AttributeError

Re: Oserror: [Errno 20]

2006-04-03 Thread k r fry
Thank you very much! *embarassed*. :-) Ben Thul wrote: > I think that if you go back and look at the original reply, he spelled > it "isdir"...;) > > --Ben > k r fry wrote: > >> Again, I apologise. Not knowing much about Python means that I don't

Re: Oserror: [Errno 20]

2006-04-03 Thread k r fry
Thank you very much! I really appreciate the help. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: mod_python and PHP sharing same session

2006-04-04 Thread K Raghu Prasad
Scott wrote: > I am trying to get a mod_python application to read an existing PHP > session. I need some data that was set in the session by the PHP > application. I am using the mod_python Session class but even when I > specify the session id that PHP uses the Session(req, sid) call > ret

Re: how to convert string

2006-04-05 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote: > I want to print number 0 to 9 in one line like this > 0 1 2 3 4 5 6 7 8 9 > > if I do like this, it prints in different lines > > for i in xrange(10): > print i for i in xrange(10): print i, > so i tried like this > > str = "" > for i in xrange(10): > st

Re: How to determine if a line of python code is a continuation of the line above it

2006-04-09 Thread Leif K-Brooks
Sandra-24 wrote: > I'm not sure how complex this is, I've been brainstorming a little, and > I've come up with: from tokenize import generate_tokens, NL, NEWLINE from cStringIO import StringIO def code_lines(source): """Takes Python source code (as either a string or file-like object) a

emacs, pdb, python3, ubuntu

2009-11-30 Thread K. Richard Pixley
Does anyone have this combination working? And if so, which version of ubuntu and what did you have to do to get it to work? --rich -- http://mail.python.org/mailman/listinfo/python-list

Re: Feature request: String-inferred names

2009-12-03 Thread Bradley K. Harms
class rather than the instance. (To be precise, > you can add such a method to the instance, but it won't be called > automatically.) Likewise staticmethods and classmethods won't work > correctly unless they are in the class. But ordinary methods work fine: > the o

subprocess.Popen does not close pipe in an error case

2010-01-05 Thread Steven K. Wong
Below, I have a Python script that launches 2 child programs, prog1 and prog2, with prog1's stdout connected to prog2's stdin via a pipe. (It's like executing "prog1 | prog2" in the shell.) If both child programs exit with 0, then the script runs to completion. But if prog2 exits with non-0, prog1

Re: subprocess.Popen does not close pipe in an error case

2010-01-05 Thread Steven K. Wong
BTW, I'm using Python 2.6.2 on Linux. -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess.Popen does not close pipe in an error case

2010-01-06 Thread Steven K. Wong
On Jan 6, 10:30 am, Nobody wrote: > I think that you should close prog1.stdout here. Otherwise, there will > be two readers on the pipe (the calling process and prog2). Even if one of > them dies, there's always the possibility that the caller might eventually > decide to read prog1.stdout itself.

Re: subprocess.Popen does not close pipe in an error case

2010-01-06 Thread Steven K. Wong
Well, the example code at http://www.python.org/doc/2.6.2/library/subprocess.html#replacing-shell-pipeline has the same issue: output=`dmesg | grep hda` ==> p1 = Popen(["dmesg"], stdout=PIPE) p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE) output = p2.communicate()[0] After communicate

ANN: Leo 4.7 b3 released

2010-02-02 Thread Edward K Ream
including new command line options and new plugins. - Dozens of bug fixes. Edward K. Ream Links: -- Leo: http://webpages.charter.net/edreamleo/front.html Forum:http://groups.google.com/group/leo-editor Download: http://sourceforge.net/project/showfiles.php?group_id=3458

ANN: Leo 4.7 rc1 released

2010-02-12 Thread Edward K Ream
eo-editor Download: http://sourceforge.net/project/showfiles.php?group_id=3458 Bzr: http://code.launchpad.net/leo-editor/ Quotes: http://webpages.charter.net/edreamleo/testimonials.html Edward K. Ream February 12, 2010 -- http://mail.python.org/mailman/listinfo/python-list

ANN: Leo 4.7 final released

2010-02-23 Thread Edward K Ream
Leo 4.7 finalFebruary 23, 2009 Leo 4.7 final is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106 Leo 4.7 final fixes all known bugs in Leo. Leo is a text editor, data organizer, project manager and much more. See: http://webpages.

Re: ANN: Leo 4.7 final released

2010-02-24 Thread Edward K Ream
On Tue, 23 Feb 2010 07:53:44 -0600, Edward K Ream wrote: A critical bug has been reported against Leo 4.7 final, and indeed all previous versions of Leo 4.7. The bug can cause loss of data in @file nodes when Leo 4.7 saves .leo files created with older versions of Leo. This bug will be fixed

ANN: Leo 4.7.1 released

2010-02-26 Thread Edward K Ream
Leo 4.7.1 final is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106 Leo 4.7.1 fixes a dangerous bug in Leo 4.7. When converting file-like sentinels to thin-like sentinels in an external file, Leo now issues a warning and sets the corresponding @file nod

Re: Updates about Tk

2010-03-09 Thread Donal K. Fellows
On Feb 27, 5:29 pm, rantingrick wrote: > Great post Kevin! The only thing i would like to add are my two > favorite references for learning Tkinter. They are not geared around > the new ttk stuff, but still 95% relevant to any Tkinter-ing > > http://effbot.org/tkinterbook/ > http://infohost.nmt.ed

Leo 4.8 rc1 released

2010-11-15 Thread Edward K. Ream
ttp://groups.google.com/group/leo-editor Download: http://sourceforge.net/project/showfiles.php?group_id=3458 Bzr: http://code.launchpad.net/leo-editor/ Quotes: http://webpages.charter.net/edreamleo/testimonials.html Edward K. Ream November 15, 2010 -- http://mail.python.org/mailman/listinfo/python-list

Re: Scheme as a virtual machine?

2010-11-22 Thread Tamas K Papp
On Mon, 22 Nov 2010 08:25:34 -0800, scattered wrote: > On Nov 22, 9:45 am, Raffael Cavallaro > wrote: >> On 2010-11-22 08:12:27 -0500, markhanif...@gmail.com said: >> >> > All opinions are biased. >> >> All opinions show some bias. Not all opinions represent what is usually >> called a "conflict

ANN: Leo 4.8 final

2010-11-26 Thread Edward K. Ream
groups.google.com/group/leo-editor Download: http://sourceforge.net/project/showfiles.php?group_id=3458 Bzr: http://code.launchpad.net/leo-editor/ Quotes: http://webpages.charter.net/edreamleo/testimonials.html Edward K. Ream November 26, 2010 -- http://mail.python.org/mailman/listinfo/python-list

@property; @classmethod; def f()

2011-01-01 Thread K. Richard Pixley
Can anyone explain to me why this doesn't work? class Foo(object): @property @classmethod def f(cls): return 4 I mean, I think it seems to be syntactically clear what I'm trying to accomplish. What am I missing? --rich -- http://mail.python.org/mailman/listinfo/python-lis

Re: Which is the best implementation of LISP family of languages for real world programming ?

2010-06-11 Thread Tamas K Papp
On Thu, 10 Jun 2010 13:14:01 -0700, bolega wrote: > Please compare LISP and its virtues with other languages such as > javascript, python etc. Generally, it is advisable to cross-post questions like this to at least 50 other language newsgroups. For example, you are not giving Ruby users a fair

<    2   3   4   5   6   7   8   >