Re: Why my modification of source file doesn't take effect whendebugging?

2005-12-02 Thread Fredrik Lundh
Christophe wrote: > > "import" only reads the file the first time it's called. Every import > > call after that looks up the module in memory. This is to prevent > > circular dependencies between modules from creating infinite loops. > > You need to use the reload() function: > > As a matter of

Re: advice : how do you iterate with an acc ?

2005-12-02 Thread Jeffrey Schwab
[EMAIL PROTECTED] wrote: > hello, > > i'm wondering how people from here handle this, as i often encounter > something like: > > acc = []# accumulator ;) > for line in fileinput.input(): > if condition(line): > if acc:#1 > doSomething(acc)#1 > acc = []

Python & Unicode decimal interpretation

2005-12-02 Thread Scott David Daniels
In reading over the source for CPython's PyUnicode_EncodeDecimal, I see a dance to handle characters which are neither dec-equiv nor in Latin-1. Does anyone know about the intent of such a conversion? As far as I can tell, error handling is one of: strict, replace, ignore, xmlcharrefreplace,

Re: General question about Python design goals

2005-12-02 Thread Donn Cave
Quoth Mike Meyer <[EMAIL PROTECTED]>: | Donn Cave <[EMAIL PROTECTED]> writes: ... |> For me, conceptually, if an object can't be accessed |> sequentially, then it can't be mapped to a sequence. | | So you're saying that for should implicitly invoke list (or maybe | iter) on any object that it's pas

Re: Why my modification of source file doesn't take effect when debugging?

2005-12-02 Thread Scott David Daniels
Christophe wrote: > infidel a écrit : >>> I'm using the Windows version of Python and IDLE. When I debug my .py >>> file, my modification to the .py file does not seem to take effect >>> unless I restart IDLE. Saving the file and re-importing it doesn't help >>> either. Where's the problem? >> >> "

CGI and long running job

2005-12-02 Thread merry . sailor
Hello, I am using python and CGI to initiate a long running simulation (up to 5h long) on a remote machine. The main idea is that I use a form, enter the parameters and a CGI scripts start the simulation using these parameters. The structure of the script is: 1. Read paremeters 2. Display some inf

FiPy visualization results in MacOS Tiger "Bus Error"

2005-12-02 Thread David T
Has anyone run across this error? When calling any of several visualization routines from FiPy, Python quits with a Bus Error I'm using MacOS X Tiger 10.4.3, and I've tried several builds of Python 2.4: Framework build of 2.4.1, Fink build of 2.4.2, Fink build of vtkPython 2.4.2. Same c

Re: Import path for unit tests

2005-12-02 Thread Ben Finney
Duncan Booth <[EMAIL PROTECTED]> wrote: > Ben Finney wrote: > > What is the common idiom here? I can conceive of several possible > > ways to get around it, all of which seem hackish to some degree. > > I don't know if it is the common idiom, but I tend to write: > > TESTDIR = os.path.dirname(os.

Re: advice : how do you iterate with an acc ?

2005-12-02 Thread bonono
Bengt Richter wrote: > It looks to me like itertools.groupby could get you close to what you want, > e.g., (untested) Ah, groupby. The generic string.split() equivalent. But the doc said the input needs to be sorted. -- http://mail.python.org/mailman/listinfo/python-list

Re: advice : how do you iterate with an acc ?

2005-12-02 Thread Dan Sommers
On 2 Dec 2005 16:45:38 -0800, [EMAIL PROTECTED] wrote: > hello, > i'm wondering how people from here handle this, as i often encounter > something like: > acc = []# accumulator ;) > for line in fileinput.input(): > if condition(line): > if acc:#1 > doSomething(acc)

Re: advice : how do you iterate with an acc ?

2005-12-02 Thread Bengt Richter
On 2 Dec 2005 17:08:02 -0800, [EMAIL PROTECTED] wrote: > >[EMAIL PROTECTED] wrote: >> hello, >> >> i'm wondering how people from here handle this, as i often encounter >> something like: >> >> acc = []# accumulator ;) >> for line in fileinput.input(): >> if condition(line): >> if a

Re: General question about Python design goals

2005-12-02 Thread Aahz
In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> wrote: >Donn Cave <[EMAIL PROTECTED]> writes: >> >> For me, conceptually, if an object can't be accessed >> sequentially, then it can't be mapped to a sequence. > >So you're saying that for should implicitly invoke list (or maybe >ite

Re: Setting PYTHONPATH from Makefile

2005-12-02 Thread Inyeol Lee
On Fri, Dec 02, 2005 at 08:10:41PM -0500, Mike Meyer wrote: > Inyeol Lee <[EMAIL PROTECTED]> writes: > > On Fri, Dec 02, 2005 at 07:33:20PM -0500, Mike Meyer wrote: > >> > The problem is that myscript.py and some modules that myscript.py > >> > imports are not in the current directory, but in anoth

Re: General question about Python design goals

2005-12-02 Thread Mike Meyer
Donn Cave <[EMAIL PROTECTED]> writes: > In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> > wrote: >> Seriously. Why doesn't this have to be phrased as "for x in list((1, >> 2, 3))", just like you have to write list((1, 2, 3)).count(1), etc.? > How could list(t) work, if for x in t di

Re: Setting PYTHONPATH from Makefile

2005-12-02 Thread Mike Meyer
Inyeol Lee <[EMAIL PROTECTED]> writes: > On Fri, Dec 02, 2005 at 07:33:20PM -0500, Mike Meyer wrote: >> > The problem is that myscript.py and some modules that myscript.py >> > imports are not in the current directory, but in another place in the >> > filesystem, say, /path/to/stuff. If this was a

Re: advice : how do you iterate with an acc ?

2005-12-02 Thread bonono
[EMAIL PROTECTED] wrote: > hello, > > i'm wondering how people from here handle this, as i often encounter > something like: > > acc = []# accumulator ;) > for line in fileinput.input(): > if condition(line): > if acc:#1 > doSomething(acc)#1 > acc = [] >

Re: Setting PYTHONPATH from Makefile

2005-12-02 Thread Inyeol Lee
On Fri, Dec 02, 2005 at 07:33:20PM -0500, Mike Meyer wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > I have a Makefile target that uses a python script, like: > > > > %.abc: %.def > > python myscript.py > > > > The problem is that myscript.py and some modules that myscript.py >

advice : how do you iterate with an acc ?

2005-12-02 Thread vd12005
hello, i'm wondering how people from here handle this, as i often encounter something like: acc = []# accumulator ;) for line in fileinput.input(): if condition(line): if acc:#1 doSomething(acc)#1 acc = [] else: acc.append(line) if acc:#

Re: Setting PYTHONPATH from Makefile

2005-12-02 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I have a Makefile target that uses a python script, like: > > %.abc: %.def > python myscript.py > > The problem is that myscript.py and some modules that myscript.py > imports are not in the current directory, but in another place in the > f

ANN: Dao Language v.0.9.6-beta is release!

2005-12-02 Thread Alexander Zatvornitskiy
Hello, [EMAIL PROTECTED] 28 nov 2005 at 02:48, [EMAIL PROTECTED] wrote: p> This is just to let you know that the lastest version Dao language is p> released. Please wrote "hello world" example for us, and some more simple examples which highlight major features of this language. I think, it is

Re: Why use #!/usr/bin/env python rather than #!python?

2005-12-02 Thread Mike Meyer
Carsten Haese <[EMAIL PROTECTED]> writes: > (3) assumes that whatever shell the user is running looks up the shebang > executable in the path, which bash, just to name one example, does not > do. For the record, on a modern Unix system, #! isn't handled by the shell; it's handled by the kernel. #!

Re: Detect Blank DVD or CD in CDROM Drive

2005-12-02 Thread Gregory Piñero
not sure if this first email made it to the list.  Sorry if it ends up as a dupe.On 12/2/05, Gregory Piñero <[EMAIL PROTECTED] > wrote:Hi guys, I'm thinking it will take a real expert to do this, probably someone who can use windows API's or directly poll the hardware or some such thing.  But if y

Re: Cut and paste an EPS file

2005-12-02 Thread Larry Bates
There is a python iterface to imagemagik that might work. I haven't used it, just read about it. -Larry Bates John Henry wrote: > I am looking for a Python tookit that will enable me to cut section of > a picture out from an EPS file and create another EPS file. > > I am using a proprietary pac

Re: JOB: Telecommute Python Programmer - IMMEDIATE NEED

2005-12-02 Thread Paul Rubin
"Beau Gould" <[EMAIL PROTECTED]> writes: > JOB: Telecommute Python Programmer - IMMEDIATE NEED > Please see www.superiorss.com/jobs.htm I hope this person is not trying to spam web BBS's, wikis, etc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter menu

2005-12-02 Thread [EMAIL PROTECTED]
> > the easiest way to do this is to create a new function object for each > file, and use default argument binding to pass in the right filename: > > for file in self.allfiles: > def callback(fname=file): > self.showFile(fname, parent) > self.showfilemenu_bar.add

Re: Cut and paste an EPS file

2005-12-02 Thread John Henry
Thanks for the reply. Yes, that would have been too easy :=) If I change the bbox, I would cut out the lower 1/3 of the plot. I only want to apply it to the top 2/3 of the page. Regards, -- JH -- http://mail.python.org/mailman/listinfo/python-list

JOB: Telecommute Python Programmer - IMMEDIATE NEED

2005-12-02 Thread Beau Gould
JOB: Telecommute Python Programmer - IMMEDIATE NEED Please see www.superiorss.com/jobs.htm -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.13.10/190 - Release Date: 12/1/2005 -- http://mail.python.org/mailman/listinfo/python-lis

Re: Cut and paste an EPS file

2005-12-02 Thread Ben Caradoc-Davies
John Henry wrote: > I am looking for a Python tookit that will enable me to cut section of > a picture out from an EPS file and create another EPS file. > I am using a proprietary package for doing certain engineering > calculations. It creates single page x-y line plots that has too much > blank

Re: XML and namespaces

2005-12-02 Thread uche . ogbuji
Alan Kennedy: """ > Oh no. That only means that namespace declaration attributes are not > created in the DOM data structure. However, output has to fix up > namespaces in .namespaceURI properties as well as directly asserted > "xmlns" attributes. It would be silly for DOM to produce malformed >

Cut and paste an EPS file

2005-12-02 Thread John Henry
I am looking for a Python tookit that will enable me to cut section of a picture out from an EPS file and create another EPS file. I am using a proprietary package for doing certain engineering calculations. It creates single page x-y line plots that has too much blank spaces around the plotted a

Re: XML and namespaces

2005-12-02 Thread Alan Kennedy
[AMK] > """ > (I assume not. Section 1.3.3 of the DOM Level 3 says "Similarly, > creating a node with a namespace prefix and namespace URI, or changing > the namespace prefix of a node, does not result in any addition, > removal, or modification of any special attributes for declaring the > approp

Re: how to handle two forms in cgi?

2005-12-02 Thread lli
Hi Dan, Sure. You are right. When I correct this according to your idea, it works now. Thank you very much. But I have second problem. When users run second form, other people can see adress in users' browers and know how to run the second form, so they don't need to run login form. How I can hand

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-02 Thread Inyeol Lee
On Fri, Dec 02, 2005 at 09:45:10PM +0100, Gerhard H�ring wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Micah Elliott wrote: > > On Dec 02, Dave Hansen wrote: > > > >>Python recognizes the TAB character as valid indentation. TAB > >>characters are evil. They should be banned from

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-02 Thread Simon Brunning
On 12/2/05, Dave Hansen <[EMAIL PROTECTED]> wrote: > FWIW, indentation scoping one one of the features that _attracted_ me > to Python. +1 QOTW OK, it's a bit of a cliche. But it's a cliche because it's *true*. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ --

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-02 Thread Gerhard Häring
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Micah Elliott wrote: > On Dec 02, Dave Hansen wrote: > >>Python recognizes the TAB character as valid indentation. TAB >>characters are evil. They should be banned from Python source code. > > AGREE! AGREE! AGREE! > >>The interpreter should sto

Re: How to list currently defined classes, methods etc

2005-12-02 Thread Colin J. Williams
Deep wrote: > I have been looking a bit and am stuck at this point. > > Given a string, how do i find what is the string bound to. > Let me give an example. > > def deep(): > print "Hello" > > now inspect.ismethod(deep) returns true. (As it should). > But if I am trying to make a list of al

Re: How to list currently defined classes, methods etc

2005-12-02 Thread Kent Johnson
Deep wrote: > I have been looking a bit and am stuck at this point. > > Given a string, how do i find what is the string bound to. > Let me give an example. > > def deep(): > print "Hello" > > now inspect.ismethod(deep) returns true. (As it should). > But if I am trying to make a list of al

Re: unittest.assertRaise and keyword arguments?

2005-12-02 Thread Bo Peng
Giovanni Bajo wrote: > You can pass keyword arguments to assertRaises without problems: > > self.assertRaises(ValueError, myfunc, arg1,arg2, arg3, arg4, abc=0, foo=1, > bar="hello") Well, I though abc=0 would be keyword arguments for assertRaisers and never tried it! > > Or you can always do s

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-02 Thread Micah Elliott
On Dec 02, Dave Hansen wrote: > Python recognizes the TAB character as valid indentation. TAB > characters are evil. They should be banned from Python source code. AGREE! AGREE! AGREE! > The interpreter should stop translation of code and throw an > exception when one is encountered. You co

Re: CGI module does not parse data

2005-12-02 Thread amfr
I am using execfile, setting stdin and stdout like this: sys.stdin = self.wfile sys.stdout = self.rfile execfile(filename) Its the same code used in the CGIHTTPServer module. I know that the python is executing corretly, a script with this content would work: print "" print "" print "" print "bl

Volume of CSG (constructive solid geometry) objects

2005-12-02 Thread Charlie
>From python, I need to be able to create CSG objects and calculate their volume (and from that their mass). It looks like their are plenty of packages to create and display CSG objects, however, I can not seem to find any API to get to the object's volume. If anyone has any ideas/tips/pointers/e

Re: unittest.assertRaise and keyword arguments?

2005-12-02 Thread Giovanni Bajo
Bo Peng wrote: > The syntax for using assertRaise is > >assertRaise(exception, function, para1, para2,...) > > However, I have a long list of arguments (>20) so I would like to test > some of them using keyword arguments (use default for others). Is there > a way to do this except for manually

Re: XML and namespaces

2005-12-02 Thread A.M. Kuchling
On 2 Dec 2005 06:16:29 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Of course. Minidom implements level 2 (thus the "NS" at the end of the > method name), which means that its APIs should all be namespace aware. > The bug is that writexml() and thus toxml() are not so. Hm, OK.

Re: How to list currently defined classes, methods etc

2005-12-02 Thread Deep
I have been looking a bit and am stuck at this point. Given a string, how do i find what is the string bound to. Let me give an example. def deep(): print "Hello" now inspect.ismethod(deep) returns true. (As it should). But if I am trying to make a list of all bound methods), i use dir(), w

unittest.assertRaise and keyword arguments?

2005-12-02 Thread Bo Peng
Dear list, The syntax for using assertRaise is assertRaise(exception, function, para1, para2,...) However, I have a long list of arguments (>20) so I would like to test some of them using keyword arguments (use default for others). Is there a way to do this except for manually try...except?

Re: Death to tuples!

2005-12-02 Thread Bengt Richter
On 2 Dec 2005 13:05:43 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: >On 2005-12-02, Bengt Richter <[EMAIL PROTECTED]> wrote: >> On 1 Dec 2005 09:24:30 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: >> >>>On 2005-11-30, Duncan Booth <[EMAIL PROTECTED]> wrote: Antoon Pardon wrote: > >Perso

LDAP Authentication

2005-12-02 Thread Derek Perriero
Any help would be great on this.  I've been trying to bind a username and password to the ldap server for authentication, but when I locally run this script: #!/usr/bin/python import ldap ## Connect to LDAP host try:     ldapcn = ldap.initialize('ldap://xxx.xxx.xxx.xxx')     ldapcn.bind('cn=usern

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-02 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, Dave Hansen <[EMAIL PROTECTED]> wrote: > On 2 Dec 2005 10:08:21 -0800 in comp.lang.python, [EMAIL PROTECTED] > wrote: > > >Here it is again... Python bypassed/discounted because, of all things, > >scoping by indentation!?!? > > > >This used to surprise me. Until

Re: Instances behaviour

2005-12-02 Thread Inyeol Lee
On Fri, Dec 02, 2005 at 10:43:56AM +0100, bruno at modulix wrote: > Inyeol Lee wrote: > (snip) > > class A(object): > ... def __init__(self, foo): > ... if self.__class__ is A: > ... raise TypeError("A is base class.") > > > s/TypeError/NotI

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-02 Thread [EMAIL PROTECTED]
You're not alone. The first thing I do after installing an IDE or programmers editor is to change the configuration to use spaces as identantion. I still don't get why there is still people using real tabs as indentation. -- Paulo Dave Hansen wrote: > On 2 Dec 2005 10:08:21 -0800 in comp.lang.py

Re: an intriguing wifi http server mystery...please help

2005-12-02 Thread Paul Boddie
[EMAIL PROTECTED] wrote: > The server runs fast when one computer is the server, but slow when the > other computer is the server. > How can this be, given that this asymmetry does not exist when both > computers are wired. Probably because the way your wireless interfaces are configured may be di

Detect Blank DVD or CD in CDROM Drive

2005-12-02 Thread Gregory Piñero
Hi guys, I'm thinking it will take a real expert to do this, probably someone who can use windows API's or directly poll the hardware or some such thing.  But if you think you know how then please let me know.  I'm trying to write an automation script that will burn an ISO file each night. By the

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-02 Thread Dave Hansen
On 2 Dec 2005 10:08:21 -0800 in comp.lang.python, [EMAIL PROTECTED] wrote: >Here it is again... Python bypassed/discounted because, of all things, >scoping by indentation!?!? > >This used to surprise me. Until I hear more and more otherwise >reasonable programmers list this as their number one r

Re: libxml2 and XPath - Iterate through repeating elements?

2005-12-02 Thread Paul Boddie
[EMAIL PROTECTED] wrote: > I'm trying to iterate through repeating elements to extract data using > libxml2 but I'm having zero luck - any help would be appreciated. Here's how I attempt to solve the problem using libxml2dom [1] (and I imagine others will suggest their own favourite modules, too):

Re: How to creat a file?

2005-12-02 Thread [EMAIL PROTECTED]
sandorf wrote: > Thank to you all, guys. Here's another question: > > I'm using the Windows version of Python and IDLE. When I debug my .py > file, my modification to the .py file does not seem to take effect > unless I restart IDLE. Saving the file and re-importing it doesn't help > either. Where

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-02 Thread Paul Boddie
[EMAIL PROTECTED] wrote: > Here it is again... Python bypassed/discounted because, of all things, > scoping by indentation!?!? [...] > Could the PyPy people find some way (I don't how) to eliminate this > stumbling block going forward?? No: I believe they could only eliminate it "going backward

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-02 Thread JohnBMudd
Here it is again... Python bypassed/discounted because, of all things, scoping by indentation!?!? This used to surprise me. Until I hear more and more otherwise reasonable programmers list this as their number one reason for shunning Python. I gauge design defects by how much after market discu

How to keep Pydoc from listing too much?

2005-12-02 Thread Tony Nelson
How can I tell Pydoc not to list information for some of the base classes? For example, when a class inherits from gtk.Widget, lots of GTK stuff gets added that doesn't really need to be there. Is there some option to Pydoc to tell it to skip some classes? Is there something I can put in my

Re: Setting PYTHONPATH from Makefile

2005-12-02 Thread François Pinard
[EMAIL PROTECTED] > I have a Makefile target that uses a python script, like: > %.abc: %.def > python myscript.py > If this was a tcsh script, I would just do: >setenv PYTHONPATH /path/to/stuff >python myscript.py > but this cannot be done from a Makefile. Use: %.abc:

Re: Death to tuples!

2005-12-02 Thread Mike Meyer
Antoon Pardon <[EMAIL PROTECTED]> writes: > On 2005-12-02, Bengt Richter <[EMAIL PROTECTED]> wrote: >> On 1 Dec 2005 09:24:30 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: >>>On 2005-11-30, Duncan Booth <[EMAIL PROTECTED]> wrote: Antoon Pardon wrote: >>>I think one could argue that since '[]'

Re: an intriguing wifi http server mystery...please help

2005-12-02 Thread jojoba
Hello again everyone, First, I want to thank all those who have contributed to the unravelling of this server-slow-down mystery. But unfortunately, either: 1) i have not made my point clear about what my question is 2) i do not understand the responses given So, let me briefly reiterate what the

libxml2 and XPath - Iterate through repeating elements?

2005-12-02 Thread nickheppleston
I'm trying to iterate through repeating elements to extract data using libxml2 but I'm having zero luck - any help would be appreciated. My XML source is similar to the following - I'm trying to extract the line number and product code from the repeating line elements: 123456

Re: Eclipse best/good or bad IDE for Python?

2005-12-02 Thread gene tani
[EMAIL PROTECTED] wrote: > I'm trying to move beyond Emacs/Vim/Kate > and was wondering if Eclipse is better and if it is the *best* > IDE for Python. > > Should I leave Emacs and do Python coding in Eclipse? > > Chris I'm agnostic; lots of IDE's/editors have buzz, you should learn to use at leas

Re: Problem cmpiling M2Crypto under Plone

2005-12-02 Thread Thomas G. Apostolou
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thomas G. Apostolou wrote: > > > So what you say is that the Python installed with Plone doesn't have > > Python.h in ./include but Python installers from Python.org do have the > > file? > > that's likely, given buildin

Re: Why use #!/usr/bin/env python rather than #!python?

2005-12-02 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Adriano Ferreira <[EMAIL PROTECTED]> wrote: > Hey, that's not fair. In your illustration above, does 'python' can be > found in the PATH? That is, > > $ python /tmp/hello.py > > works? If it does, probably > > #!/usr/bin/python > #!/usr/bin/env python > #!python

Re: Death to tuples!

2005-12-02 Thread Mike Meyer
Antoon Pardon <[EMAIL PROTECTED]> writes: >>> Well there are two possibilities I can think of: >>> >>> 1) >>> arg_default = ... >>> def f(arg = arg_default): >>> ... >> >> Yuch. Mostly because it doesn't work: >> >> arg_default = ... >> def f(arg = arg_default): >> ... >> >> arg_default =

Re: Detect TKinter window being closed?

2005-12-02 Thread Glen
Thanks Fredrik and Adonis that's just what I needed, plus a bit more to learn about. -- http://mail.python.org/mailman/listinfo/python-list

Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2)

2005-12-02 Thread Cameron Laird
QOTW: "Python makes it easy to implement algorithms." - casevh "Most of the discussion of immutables here seems to be caused by newcomers wanting to copy an idiom from another language which doesn't have immutable variables. Their real problem is usually with binding, not immutability." - Mike Me

Re: Why my modification of source file doesn't take effect when debugging?

2005-12-02 Thread Christophe
infidel a écrit : >>I'm using the Windows version of Python and IDLE. When I debug my .py >>file, my modification to the .py file does not seem to take effect >>unless I restart IDLE. Saving the file and re-importing it doesn't help >>either. Where's the problem? > > > "import" only reads the fil

Re: Why my modification of source file doesn't take effect when debugging?

2005-12-02 Thread infidel
> I'm using the Windows version of Python and IDLE. When I debug my .py > file, my modification to the .py file does not seem to take effect > unless I restart IDLE. Saving the file and re-importing it doesn't help > either. Where's the problem? "import" only reads the file the first time it's cal

Re: Is there no compression support for large sized strings in Python?

2005-12-02 Thread Christopher Subich
Fredrik Lundh wrote: > Harald Karner wrote: >>>python -c "print len('m' * ((2048*1024*1024)-1))" >> >>2147483647 > > > the string type uses the ob_size field to hold the string length, and > ob_size is an integer: > > $ more Include/object.h > ... > int ob_size; /* Number of items in va

Re: aligning a set of word substrings to sentence

2005-12-02 Thread Steven Bethard
Steven Bethard wrote: > Michael Spencer wrote: > >> Steven Bethard wrote: >> >>> I've got a list of word substrings (the "tokens") which I need to >>> align to a string of text (the "sentence"). The sentence is >>> basically the concatenation of the token list, with spaces sometimes >>> insert

Re: Detect TKinter window being closed?

2005-12-02 Thread Fredrik Lundh
Glen wrote: > Is it possible to to detect a Tkinter top-level window being closed with the > close icon/button (top right), for example to call a function before the > window actually closes? http://effbot.org/tkinterbook/tkinter-events-and-bindings.htm#protocols -- http://mail.python.org/

Re: Eclipse best/good or bad IDE for Python?

2005-12-02 Thread Aaron Bingham
[EMAIL PROTECTED] wrote: >I'm trying to move beyond Emacs/Vim/Kate >and was wondering if Eclipse is better and if it is the *best* >IDE for Python. > >Should I leave Emacs and do Python coding in Eclipse? > > I've been a heavy Emacs user for several years, but recently switched to Eclipse for P

Re: Detect TKinter window being closed?

2005-12-02 Thread Adonis
Glen wrote: > Is it possible to to detect a Tkinter top-level window being closed with the > close icon/button (top right), for example to call a function before the > window actually closes? > > Python 2.4 / Linux (2.6 kernel) if that makes any difference. > Any info would be greatly appreciated.

Re: How do you create a custom QCursor in Python Qt?

2005-12-02 Thread Phil Thompson
On Friday 02 December 2005 3:31 pm, [EMAIL PROTECTED] wrote: > I am a newcomer to using Python and Qt and the main problem that I have > is the dearth of any example code or books describing the use of Python > and Qt together. > > My current problem is that I want to create a custom cursor, from m

Detect TKinter window being closed?

2005-12-02 Thread Glen
Is it possible to to detect a Tkinter top-level window being closed with the close icon/button (top right), for example to call a function before the window actually closes? Python 2.4 / Linux (2.6 kernel) if that makes any difference. Any info would be greatly appreciated. Thanks Glen -- http://

Re: aligning a set of word substrings to sentence

2005-12-02 Thread Steven Bethard
Michael Spencer wrote: > Steven Bethard wrote: > >> I've got a list of word substrings (the "tokens") which I need to >> align to a string of text (the "sentence"). The sentence is basically >> the concatenation of the token list, with spaces sometimes inserted >> beetween tokens. I need to d

Re: aligning a set of word substrings to sentence

2005-12-02 Thread Steven Bethard
Fredrik Lundh wrote: > Steven Bethard wrote: > > I feel like there should be a simpler solution (maybe with the re module?) but I can't figure one out. Any suggestions? >>> >>>using the finditer pattern I just posted in another thread: >>> >>>tokens = ['She', "'s", 'gon', 'na', 'write',

How do you create a custom QCursor in Python Qt?

2005-12-02 Thread Steegg
I am a newcomer to using Python and Qt and the main problem that I have is the dearth of any example code or books describing the use of Python and Qt together. My current problem is that I want to create a custom cursor, from my understanding of it I need to create two "QBitmap"s, one of which wi

Re: Why use #!/usr/bin/env python rather than #!python?

2005-12-02 Thread Adriano Ferreira
On 12/2/05, Klaus Alexander Seistrup <[EMAIL PROTECTED]> wrote: > /me is using bash on linux. I think that was not a bash issue in my case, but a Cygwin/Win32 issue. Windows has some monstruous oddities in order to assure broken behavior of yesterday is here today in the name of compatibility. Exa

Re: [[x,f(x)] for x in list that maximizes f(x)] <--newbie help

2005-12-02 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: ... > As while DSU is a very smart way to guard the max compare thing, it is > still being introduced as a way that is not related to the original > problem, i.e. I just want to compare f(x) And that's why in 2.5 you'll just code max(mylist, key=f) to express this int

Re: Ruby on Rails Job Site -- Is there a Python equivalent?

2005-12-02 Thread Paul Boddie
Adrian Holovaty wrote: > http://code.djangoproject.com/wiki/DevelopersForHire > > See the "Django-powered jobs" section. We could definitely advertise > this page more, as it's a bit hidden at the moment on the Django wiki. Don't forget the Python Job Board: http://www.python.org/Jobs.html Yes,

Re: Why use #!/usr/bin/env python rather than #!python?

2005-12-02 Thread Klaus Alexander Seistrup
Adriano Ferreira wrote: > So that "#!/usr/bin/env python" is more portable than "#! python" > and that's probably why it worked for me with cygwin/bash but not > for Klaus on whatever platform he used. /me is using bash on linux. > I agree. Only a very strange Unix-like installation would not

Re: Why use #!/usr/bin/env python rather than #!python?

2005-12-02 Thread Adriano Ferreira
On 12/2/05, Carsten Haese <[EMAIL PROTECTED]> wrote: > (3) assumes that whatever shell the user is running looks up the shebang > executable in the path, which bash, just to name one example, does not > do. I think that was the answer I was looking for. So that "#!/usr/bin/env python" is more port

Re: an intriguing wifi http server mystery...please help

2005-12-02 Thread Paul Boddie
[EMAIL PROTECTED] wrote: > Could the above server-speed assymetry that i spoke of above be caused > by this reverse dns lookup? I think so. You stated that you use "a fairly simple HTTP server", although that's not exactly specific enough to diagnose the problem, but if that were the standard libr

Re: (newbie) N-uples from list of lists

2005-12-02 Thread bonono
Martin Miller wrote: > I'd be interested in seeing the one liner using reduce you mentioned -- > how it might be done that way isn't obvious to me. > > Another aspect of Taschuk's solution I like and think is important is > the fact that it is truly iterative in the sense that calling it > returns

Re: Eclipse best/good or bad IDE for Python?

2005-12-02 Thread Fabio Zadrozny
Hi Chris, I think that you should try it yourself... being the *best ide* is usually a subjective matter, so, you should decide yourself if it is the best IDE for the task you want it to. I must also warn you that I'm its current maintainer, and it is *my* favorite IDE :-) Also, I use it for

Setting PYTHONPATH from Makefile

2005-12-02 Thread [EMAIL PROTECTED]
I have a Makefile target that uses a python script, like: %.abc: %.def python myscript.py The problem is that myscript.py and some modules that myscript.py imports are not in the current directory, but in another place in the filesystem, say, /path/to/stuff. If this was a tcsh script, I w

Re: Why my modification of source file doesn't take effect when debugging?

2005-12-02 Thread Jeremy Jones
sandorf wrote: >I'm using the Windows version of Python and IDLE. When I debug my .py >file, my modification to the .py file does not seem to take effect >unless I restart IDLE. Saving the file and re-importing it doesn't help > >either. Where's the problem? > >Thanks. > > > No problem. Just r

Re: Eclipse best/good or bad IDE for Python?

2005-12-02 Thread Jean-François Doyon
I'm a big fan of Eclipse and reocmmend it to anyone who asks :) No one can say any one is the *best*, since it's a matter of taste, but it's pretty darn good. The main benefit IMO is it's felibility ... Eclipse is a *framework*, that can handle lots things quite well, like HTML (If you're coding

Re: Why use #!/usr/bin/env python rather than #!python?

2005-12-02 Thread Carsten Haese
On Fri, 2005-12-02 at 09:12, Adriano Ferreira wrote: > On 12/2/05, Klaus Alexander Seistrup <[EMAIL PROTECTED]> wrote: > > #v+ > > > > $ ls -l /tmp/hello.py > > -rwxr-xr-x 1 klaus klaus 38 2005-12-02 14:59 /tmp/hello.py > > $ cat /tmp/hello.py > > #! python > > print 'Hello, world!' > > # eof > >

Re: Instances behaviour

2005-12-02 Thread Mr.Rech
I see your point. Looking again at my metaclass implementation and comparing it with your abstract class + inheritance approach it turns out that the latter is definetively more straightforward, easier to maintain and all in all more pythonic. Sorry, but being an OOP newbie put me in the position

Re: Why use #!/usr/bin/env python rather than #!python?

2005-12-02 Thread Klaus Alexander Seistrup
Adriano Ferreira skrev: >> #v+ >> >> $ ls -l /tmp/hello.py >> -rwxr-xr-x 1 klaus klaus 38 2005-12-02 14:59 /tmp/hello.py >> $ cat /tmp/hello.py >> #! python >> print 'Hello, world!' >> # eof >> $ /tmp/hello.py >> bash: /tmp/hello.py: python: bad interpreter: No such file or directory >> $ >> >> #

Why my modification of source file doesn't take effect when debugging?

2005-12-02 Thread sandorf
I'm using the Windows version of Python and IDLE. When I debug my .py file, my modification to the .py file does not seem to take effect unless I restart IDLE. Saving the file and re-importing it doesn't help either. Where's the problem? Thanks. -- http://mail.python.org/mailman/listinfo/pytho

Re: XML and namespaces

2005-12-02 Thread uche . ogbuji
Quoting Andrew Kuchling: """ > >>> element = document.createElementNS("DAV:", "href") This call is incorrect; the signature is createElementNS(namespaceURI, qualifiedName). """ Not at all, Andrew. "href" is a valid qname, as is "foo:href". The prefix is optional in a QName. Here is the

Re: why use #!/usr/bin/env python rather than #!python?

2005-12-02 Thread Fredrik Lundh
Adriano Ferreira wrote: > Many Python scripts I see start with the shebang line > > #!/usr/bin/env python > > What is the difference from using just > > #!python $ more test.py #!python print "hello" $ chmod +x test.py $ ./test.py -bash: ./test.py: python: bad interpreter: No such file or directo

Re: Why use #!/usr/bin/env python rather than #!python?

2005-12-02 Thread Adriano Ferreira
On 12/2/05, Klaus Alexander Seistrup <[EMAIL PROTECTED]> wrote: > #v+ > > $ ls -l /tmp/hello.py > -rwxr-xr-x 1 klaus klaus 38 2005-12-02 14:59 /tmp/hello.py > $ cat /tmp/hello.py > #! python > print 'Hello, world!' > # eof > $ /tmp/hello.py > bash: /tmp/hello.py: python: bad interpreter: No such f

Re: New Ordered Dictionery to Criticise

2005-12-02 Thread Fuzzyman
Hello Bengt, Bengt Richter wrote: > On 1 Dec 2005 03:38:37 -0800, "Fuzzyman" <[EMAIL PROTECTED]> wrote: > > > > >Fuzzyman wrote: > >> Sorry for this hurried message - I've done a new implementation of out > >> ordered dict. This comes out of the discussion on this newsgroup (see > >> blog entry fo

Re: Why use #!/usr/bin/env python rather than #!python?

2005-12-02 Thread Klaus Alexander Seistrup
Adriano Ferreira wrote: > Many Python scripts I see start with the shebang line > > #!/usr/bin/env python > > What is the difference from using just > > #!python #v+ $ ls -l /tmp/hello.py -rwxr-xr-x 1 klaus klaus 38 2005-12-02 14:59 /tmp/hello.py $ cat /tmp/hello.py #! python print 'Hello, worl

  1   2   >