Unexpected Behaviour using unittest

2008-02-22 Thread Bruce Coram
The code fragment below shows what appears to be inconsistent behaviour. The code is testing that messages are created correctly and that an instances of a class is created correctly. It checks that all of the expected addresses are used (contained in addresslist) and that all of the message

Re: Return value of an assignment statement?

2008-02-22 Thread Marc 'BlackJack' Rintsch
On Thu, 21 Feb 2008 21:28:25 -0800, Jeff Schwab wrote: > So what is the "variable?" Or is Python the first HLL I've ever heard > of that didn't have variables? Relax, Python has variables. It's just sometimes a good advice for people coming from languages like C to forget about that term for a

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Bruno Desthuilliers
Nicola Musatti a écrit : > On Feb 21, 10:55 am, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: >> Carl Banks a écrit : > [...] >>> C++ is a compile-time, type-checked language, which means it is >>> totally safer for newbies than Python. Yep, your big company is >>> totally safe with newbie C++ pr

Any experience with Python on a PDA ?

2008-02-22 Thread Stef Mientki
hello, I wonder if anyone has (good ;-) experiences with Python on a PDA ? And if so, - what OS - what GUI thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-22 Thread SPE - Stani's Python Editor
On Feb 22, 1:41 am, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On Feb 20, 4:19 am, Stani <[EMAIL PROTECTED]> wrote: > > Even without python-pyexiv2 Phatch features read-only EXIF support thanks to > > PIL. So you can name your files or write data stamps (date, aperature, > > velocity, > > ...) bas

Re: Return value of an assignment statement?

2008-02-22 Thread Carl Banks
On Feb 21, 6:52 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > mrstephengross wrote: > >> What you can't do (that I really miss) is have a tree of assign-and-test > >> expressions: > >> import re > >> pat = re.compile('some pattern') > >> if m = pat.match(some_string): > >>

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-22 Thread SPE - Stani's Python Editor
On Feb 21, 2:32 pm, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Feb 18, 9:58 am, "SPE- Stani'sPythonEditor" > > <[EMAIL PROTECTED]> wrote: > > I'm pleased to announce the release of Phatch which is a > > powerful batch processor and renamer. Phatch exposes a big part of > > This program is fantas

Re: Return value of an assignment statement?

2008-02-22 Thread Carl Banks
On Feb 21, 4:57 pm, mrstephengross <[EMAIL PROTECTED]> wrote: > > What you can't do (that I really miss) is have a tree of assign-and-test > > expressions: > > import re > > pat = re.compile('some pattern') > > if m = pat.match(some_string): > > do_something(m) >

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Bruno Desthuilliers
Jeff Schwab a écrit : > Bruno Desthuilliers wrote: >> Carl Banks a écrit : >>> On Feb 20, 8:58 am, Tim Chase <[EMAIL PROTECTED]> wrote: > You Used Python to Write WHAT? > http://www.cio.com/article/185350 """ Furthermore, the power and expressivity that Python offers means th

Getting python docstings

2008-02-22 Thread Rufman
Does anyone know how to get docstrings (reStructuredText) out of python source code using docutils? Thanks for the help. Stephane -- http://mail.python.org/mailman/listinfo/python-list

Re: Any experience with Python on a PDA ?

2008-02-22 Thread Martin Blume
"Stef Mientki" schrieb > hello, > > I wonder if anyone has (good ;-) experiences > with Python on a PDA ? > And if so, > - what OS > - what GUI > Python runs here on: - Sharp Zaurus SL-C3100 (with the exception of Tkinter) (Linux 2.4) - Mio A701 (Windows Mobile) But I only do small stuf

Re: Return value of an assignment statement?

2008-02-22 Thread Duncan Booth
Jeff Schwab <[EMAIL PROTECTED]> wrote: > a += b > > Whether a refers to the same object before and after that statement > depends on what type of object it referred to before the statement. > Yes but the rule followed by the builtin types is pretty simple: if 'a' can still refer to the same ob

Re: Getting python docstings

2008-02-22 Thread Stefan Behnel
Rufman wrote: > Does anyone know how to get docstrings (reStructuredText) out of > python source code using docutils? Depends on what you mean with "get ... out of". There are tools like epydoc that generate source code documentation, maybe that's what you mean? Stefan -- http://mail.python.org/

Re: Return value of an assignment statement?

2008-02-22 Thread Paul Rubin
Carl Banks <[EMAIL PROTECTED]> writes: > > >> import re > > >> pat = re.compile('some pattern') > > >> if m = pat.match(some_string): > > >> do_something(m) > >... > Don't be ridiculous. Assignment operators are maybe one of the worst > things in existence, but

Re: Tkinter OSX and "lift"

2008-02-22 Thread Eric Brunel
On Thu, 21 Feb 2008 16:53:14 +0100, Kevin Walzer <[EMAIL PROTECTED]> wrote: > Miki wrote: >> Hello Kevin, >> >>> Tk.lift doesn't seem to work on OSX (Python 2.5.1). If you click on the PythonLauncher application that runs in your dock when this script is executed, the window comes into

Re: Return value of an assignment statement?

2008-02-22 Thread Duncan Booth
Carl Banks <[EMAIL PROTECTED]> wrote: > Some Pythonistas will swear to their grave and back that should be > done by factoring out the tests into a list and iterating over it, and > NO OTHER WAY WHATSOEVER, but I don't buy it. That's a lot of > boilerplate--the very thing Python is normally so go

get process running time

2008-02-22 Thread Samuel Lipp
Hi, I'm looking for a way to get a processes running time. I know that operating systems keep track of it, but I didn't find any python class, function,... that would give me that information :( Any idea how I can get this information ? regards, Sam ___

Re: Any experience with Python on a PDA ?

2008-02-22 Thread Duncan Booth
Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > I wonder if anyone has (good ;-) experiences with Python on a PDA ? > And if so, > - what OS > - what GUI > > thanks, > Stef Mientki > I haven't done much programming yet on my Nokia n810, but a lot of the community software for it is writt

Re: Adding Priority Scheduling feature to the subprocess

2008-02-22 Thread Nick Craig-Wood
TimeHorse <[EMAIL PROTECTED]> wrote: > Anyway, on the one hand AmigaOS support where -128 -> p = 0.0 and +127 > -> p = 1.0 would be a good example of why simply using a 41 point UNIX > scale is defecient in representing all possible priorities, but apart > from the support AmigaOS argument, you

Re: Return value of an assignment statement?

2008-02-22 Thread Bruno Desthuilliers
Jeff Schwab a écrit : > [EMAIL PROTECTED] wrote: (snip) >> Explicitely using list.extend would make things clearer: >> >> def invoke_some_fct(parent): >> parent.x.extend(['world']) > > Whether you use += or extend has nothing to do with it. Mmm... Really ? > You omitted the > relevant pa

Re: distutils and data files

2008-02-22 Thread Diez B. Roggisch
> Not if the documentation for 2.5's got anything to say about it. If > it does, it's well hidden. > > I think I'll kill the idea of using distutils for my program. It > seems like distutils was primarily designed for modules and > extensions. Start using setuptools and pkg_resources. Then you

RE: Globals or objects? (is: module as singleton)

2008-02-22 Thread Duncan Booth
"James Newton" <[EMAIL PROTECTED]> wrote: > Duncan Booth wrote: >> you can create additional module instances (by calling new.module) > > Hi Duncan, > > Could you provide a scenario where this would be useful (and the best > practice)? Not really as such cases are few and far between. Try grep

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Nicola Musatti
Paul Boddie wrote: > On 21 Feb, 19:22, Nicola Musatti <[EMAIL PROTECTED]> wrote: [...] > > The main reason why C++ has declined in usage is because it never got > > the kind of corporate marketing enjoyed by Java and C#. > > What? C++ was practically the favoured language for serious > applicatio

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Paul Rubin
Nicola Musatti <[EMAIL PROTECTED]> writes: > In C++ memory is just another resource which you can handle just like > any other one, possibly using RAII. Ok, I'll bite. Here's a straightforward Python expression: a = [f(x) + g(y) for x,y in izip(m1, m2) if h(x,y).frob() == 7] Consider how ma

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Paul Rubin
Nicola Musatti <[EMAIL PROTECTED]> writes: > The real point about garbage collection is that it's about the only > way to ensure that an object of one type is never taken to be of > another type, e.g. by keeping around pointers to the object that > occupied its memory before it was reallocated. I b

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Nicola Musatti
On Feb 22, 9:03 am, Bruno Desthuilliers wrote: > Nicola Musatti a écrit : [...] > > So, yes, your big company is > > likely to be safer with newbie C++ programmers than with Python newbie > > programmers. > > Sorry but I don't buy your arguments. I suspect nobody seriously does, not even in C++ n

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Nicola Musatti
On Feb 22, 12:24 am, Carl Banks <[EMAIL PROTECTED]> wrote: > On Feb 21, 1:22 pm, Nicola Musatti <[EMAIL PROTECTED]> wrote: > > > There are other downsides to garbage collection, as the fact that it > > makes it harder to implement the Resource Acquisition Is > > Initialization idiom, due to the lac

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Nicola Musatti
On Feb 22, 1:17 am, Jeff Schwab <[EMAIL PROTECTED]> wrote: [...] > If you've already got a generic, language-supported way to manage > resources (like RAII with deterministic destruction), then why bother > with garbage collection? I'm not trying to knock it; it was a big step > up from C-style "w

Re: Globals or objects?

2008-02-22 Thread MartinRinehart
A fascinating, well-informed discussion. Thanks to all. Holden's suggestion re coupling and cohesion was most informative. I conclude that whether you use an object or a global (within a module, not across modules) is an implementation detail that has no impact on either cohesion or coupling. D'A

Re: Getting python docstings

2008-02-22 Thread Rufman
On Feb 22, 10:36 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Rufman wrote: > > Does anyone know how to get docstrings (reStructuredText) out of > > python source code using docutils? > > Depends on what you mean with "get ... out of". There are tools like epydoc > that generate source code docum

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Paul Boddie
On 22 Feb, 06:37, George Sakkis <[EMAIL PROTECTED]> wrote: > Paul Rubin wrote: > > It just seems to me that there is a killer language just around the > > corner, with Python's ease-of-use but with a serious compile-time type > > system, maybe some kind of cross between ML and Python. > > Could Boo

Re: Globals or objects?

2008-02-22 Thread tinnews
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >> > but you do keep having to use a longer reference to the value so > >> >what have you won? > >> > >> Clarity, simplicity, robustness > > > > Clarity - why is it clearer? > > Consider two function calls: > > > x = ham(arg, counter) > y = spam

Re: Return value of an assignment statement?

2008-02-22 Thread Steven D'Aprano
On Thu, 21 Feb 2008 16:23:23 -0800, Jeff Schwab wrote: > Steve Holden wrote: [...] if m = pat.match(some_string): do_something(m) >>> >>> Yep, this is exactly what I am (was) trying to do. Oh well Any >>> clever ideas on this front? >>> >> The syntax is the way it

Re: Return value of an assignment statement?

2008-02-22 Thread Steven D'Aprano
On Fri, 22 Feb 2008 08:12:56 +, Marc 'BlackJack' Rintsch wrote: > A "variable" in > programming languages is composed of a name, a memory location, possibly > a type and a value. In C-like languages, where you put values in named > and typed "boxes", the memory location and type are attached t

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Nicola Musatti
On Feb 22, 12:09 pm, Paul Rubin wrote: > Nicola Musatti <[EMAIL PROTECTED]> writes: > > The real point about garbage collection is that it's about the only > > way to ensure that an object of one type is never taken to be of > > another type, e.g. by keeping around pointe

Tkinter Menu Item Activation

2008-02-22 Thread MartinRinehart
Tkinter definitely deserves more respect! I'm making rapid progress and it looks good. But am stuck on this: I want the File/Save state to change from disabled to enabled, depending on whether or not there is something to save (Text modified). Google returns results in every language except Python

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Nicola Musatti
On Feb 22, 12:07 pm, Paul Rubin wrote: > Nicola Musatti <[EMAIL PROTECTED]> writes: > > In C++ memory is just another resource which you can handle just like > > any other one, possibly using RAII. > > Ok, I'll bite. Here's a straightforward Python expression: > >a =

Re: OT: Ideas for a first course using Python

2008-02-22 Thread [EMAIL PROTECTED]
On Feb 22, 2:20 am, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On Feb 21, 4:48 pm, [EMAIL PROTECTED] wrote: > > > > > Sorry to butt in but I am shopping for some ideas. > > > I am interested in putting together a programming course for non- > > programmers (outside the computer science domain) base

Re: Adding more warnings

2008-02-22 Thread Frithiof Andreas Jensen
"Thomas Dybdahl Ahle" <[EMAIL PROTECTED]> skrev i en meddelelse news:[EMAIL PROTECTED] > Is it possible to make python warn me about those at "compile time"? No. The compiler only "knows" about it once the broken code is run. I use the standard module "unittest" to run through every single bit

Re: OT: Ideas for a first course using Python

2008-02-22 Thread Roy H. Han
Ishwar, You might want to focus on applications of Python. For example, you might have a few lectures on web development using mod_python, scientific computing using numpy, windows scripting using win32com and GUI development using wxPython and wxGlade. Roy On Fri, Feb 22, 2008 at 7:50 AM, [EMA

Re: Linux/Python Issues

2008-02-22 Thread Frithiof Andreas Jensen
"Bruno Desthuilliers" <[EMAIL PROTECTED]> skrev i en meddelelse news:[EMAIL PROTECTED] > [EMAIL PROTECTED] a écrit : > So, here's the basic scheme: > > - download the source tarball, preferably in /usr/local/src > - unpack it > - cd into the unpacked source directory > - *carefully* read the REA

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-22 Thread Steve Holden
SPE - Stani's Python Editor wrote: [...] >> great >> tool, great functionality. We can surely nominate it for the >> bestPythonbased tool of 2008 ... so far ;-) > Well, thanks a lot for all the compliments. Feel free to spread the > word or to get involved: > - by contributing back on the wiki (t

Re: Sending key-presses to other programs on Windows, and settings of controls?

2008-02-22 Thread Simon Brunning
On Thu, Feb 21, 2008 at 1:20 PM, Tim van der Leeuw <[EMAIL PROTECTED]> wrote: > I'm looking for ways to send keypresses to another application on Windows > XP, and to set values of Windows Controls (all of them text-boxes). Try . -- Cheers, Simon B. [EMAIL PROTECTED

Re: Globals or objects?

2008-02-22 Thread Steven D'Aprano
On Fri, 22 Feb 2008 03:16:12 -0800, MartinRinehart wrote: > D'Aprano's discussion is persuasive but only in the case where you do > not want multiple actors updating a single value. In my case multiple > actors have legitimate interest in updating the value. (Actors within a > single thread, fortu

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Bruno Desthuilliers
Nicola Musatti a écrit : > On Feb 22, 9:03 am, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: >> Nicola Musatti a écrit : > [...] >>> So, yes, your big company is >>> likely to be safer with newbie C++ programmers than with Python newbie >>> programmers. >> Sorry but I don't buy your arguments. >

Getting stdout from other processes

2008-02-22 Thread Matthias Vogelgesang
Hello, as I found out, it is possible to get the output of other programs using os.popen() and read from it. However this method is blocking for server processes and programs that don't stop immediately. Has anyone an idea how to get the output of such programs? -- http://mail.python.org/mailman/l

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Nicola Musatti <[EMAIL PROTECTED]> wrote: > Yet I'm convinced that even such partial guarantee is worth having. Partial guarantees are like being a little bit pregnant. -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-22 Thread Mike Driscoll
On Feb 22, 2:39 am, "SPE - Stani's Python Editor" <[EMAIL PROTECTED]> wrote: > On Feb 22, 1:41 am, Mike Driscoll <[EMAIL PROTECTED]> wrote: > > > On Feb 20, 4:19 am, Stani <[EMAIL PROTECTED]> wrote: > > > Even without python-pyexiv2 Phatch features read-only EXIF support thanks > > > to > > > PIL.

Re: Return value of an assignment statement?

2008-02-22 Thread Steven D'Aprano
On Fri, 22 Feb 2008 00:45:59 -0800, Carl Banks wrote: > On Feb 21, 6:52 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >> mrstephengross wrote: >> >> What you can't do (that I really miss) is have a tree of >> >> assign-and-test expressions: >> >> import re >> >> pat = re.compile('som

Re: Acting like button are being pressed (BUT THEY ARE NOT) Please Help

2008-02-22 Thread Martin Franklin
> self.entry00.bind('', self.leftClick(self.entry00, > 0, 0)) # bind left mouse click Difficult to say for sure due to excessive code wrapping.. ;) but I would say that these bind methods are calling the left and right Click methods... rather than bind'ing them to the entry widgets. the

Re: Globals or objects?

2008-02-22 Thread Steven D'Aprano
On Fri, 22 Feb 2008 12:01:20 +, tinnews wrote: > Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> >> > but you do keep having to use a longer reference to the value >> >> >so what have you won? >> >> >> >> Clarity, simplicity, robustness >> > >> > Clarity - why is it clearer? >> >> Conside

Re: Acting like button are being pressed (BUT THEY ARE NOT) Please Help

2008-02-22 Thread Marc 'BlackJack' Rintsch
On Fri, 22 Feb 2008 06:48:37 -0800, mcsejung wrote: > [snipped massive bit of code] Sorry but dumping about 900 lines of code at people with no real question in the message body and just sort of a question in the subject won't help much to get answers. Just a quick look at the code tells that it

Acting like button are being pressed (BUT THEY ARE NOT) Please Help

2008-02-22 Thread mcsejung
""" - Name:_tkUnderWaterDemolitionRemoval.py Purpose: The classic Under Water Demolition Removal game Author: mcsejung Created: 2008/02/15 RCS-ID: $Id: _tkUnderWaterDemolitionRemoval.py $ Copyrig

Re: Is there a open souce IDE writen by C( C++) or partly writen by C( C++)?

2008-02-22 Thread Jesper
Give PyScripter from http://www.mmm-experts.com/ a try It is for Windows, though it is written in Delphi and not in C/C++ /Jesper "zaley" <[EMAIL PROTECTED]> skrev i en meddelelse news:[EMAIL PROTECTED] Of course, python scripts debugger On 2ÔÂ22ÈÕ, ÏÂÎç3ʱ22·Ö, zaley <[EMAIL PROTECTED]> wrote

Re: Getting python docstings

2008-02-22 Thread Marc 'BlackJack' Rintsch
On Fri, 22 Feb 2008 03:53:27 -0800, Rufman wrote: > On Feb 22, 10:36 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: >> Rufman wrote: >> > Does anyone know how to get docstrings (reStructuredText) out of >> > python source code using docutils? >> >> Depends on what you mean with "get ... out of". The

Re: ANN: NUCULAR B3 Full text indexing (now on Win32 too)

2008-02-22 Thread Aaron Watters
[apologies to the list: I would have done this offline, but I can't figure out Paul's email address.] 1) Paul please forward your email address 3) Since you seem to know about these things: I was thinking of adding an optional feature to Nucular which would allow a look-up like "given a word find

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote: > > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:python- > > [EMAIL PROTECTED] On Behalf Of Carl Banks > > Sent: Wednesday, February 20, 2008 8:39 PM > > To: python-list@python.org > > Subject: Re: A

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Nicola Musatti
On Feb 22, 3:25 pm, Roy Smith <[EMAIL PROTECTED]> wrote: > In article > <[EMAIL PROTECTED]>, > Nicola Musatti <[EMAIL PROTECTED]> wrote: > > > Yet I'm convinced that even such partial guarantee is worth having. > > Partial guarantees are like being a little bit pregnant. Yes, and I'm sure your te

Re: Return value of an assignment statement?

2008-02-22 Thread Marc 'BlackJack' Rintsch
On Fri, 22 Feb 2008 12:32:10 +, Steven D'Aprano wrote: > On Fri, 22 Feb 2008 08:12:56 +, Marc 'BlackJack' Rintsch wrote: > >> A "variable" in programming languages is composed of a name, a memory >> location, possibly a type and a value. In C-like languages, where you >> put values in nam

Re: Is there a open souce IDE writen by C( C++) or partly writen by C( C++)?

2008-02-22 Thread Preston Landers
On Feb 21, 8:58 pm, zaley <[EMAIL PROTECTED]> wrote: > Is there a open souce IDE writen by C( C++) or partly writen by C( C+ > +)? Eclipse is a good open source IDE for many languages including C/C++ and Python. It includes an interactive debugger. I believe most of it is written in Java, but I'

advanced usage of python threads

2008-02-22 Thread hyperboreean
Hi, Is there a document where I can find some advanced information about python threads? I know the basic things about them and did some practice, but when I try to advance I don't know where to go or how to go. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Marc 'BlackJack' Rintsch
On Fri, 22 Feb 2008 04:48:28 -0800, Nicola Musatti wrote: > On Feb 22, 12:07 pm, Paul Rubin wrote: >> Nicola Musatti <[EMAIL PROTECTED]> writes: >> > In C++ memory is just another resource which you can handle just like >> > any other one, possibly using RAII. >> >> Ok,

xml escapedness

2008-02-22 Thread Robin Becker
A colleague has decided to keep his django database string values (which are xml fragments) in an xml escaped form to avoid having the problem of escaping them when they are used in templates etc etc. Unfortunately he found that the normal admin doesn't escape on the way through so thought of

Re: Getting stdout from other processes

2008-02-22 Thread Diez B. Roggisch
Matthias Vogelgesang schrieb: > Hello, > as I found out, it is possible to get the output of other programs > using os.popen() and read from it. However this method is blocking for > server processes and programs that don't stop immediately. Has anyone > an idea how to get the output of such progra

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Chris Mellon
On Fri, Feb 22, 2008 at 4:56 AM, Nicola Musatti <[EMAIL PROTECTED]> wrote: > On Feb 22, 12:24 am, Carl Banks <[EMAIL PROTECTED]> wrote: > > On Feb 21, 1:22 pm, Nicola Musatti <[EMAIL PROTECTED]> wrote: > > > > > There are other downsides to garbage collection, as the fact that it > > > makes it

Re: Return value of an assignment statement?

2008-02-22 Thread Carl Banks
On Feb 22, 9:58 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Fri, 22 Feb 2008 00:45:59 -0800, Carl Banks wrote: > > On Feb 21, 6:52 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > >> mrstephengross wrote: > >> >> What you can't do (that I really miss) is have a tree of > >>

Re: Return value of an assignment statement?

2008-02-22 Thread Steve Holden
Marc 'BlackJack' Rintsch wrote: > On Fri, 22 Feb 2008 12:32:10 +, Steven D'Aprano wrote: > >> On Fri, 22 Feb 2008 08:12:56 +, Marc 'BlackJack' Rintsch wrote: >> >>> A "variable" in programming languages is composed of a name, a memory >>> location, possibly a type and a value. In C-like la

Re: xml escapedness

2008-02-22 Thread Tim van der Leeuw
On Fri, Feb 22, 2008 at 5:17 PM, Robin Becker <[EMAIL PROTECTED]> wrote: > A colleague has decided to keep his django database string values (which > are xml > fragments) in an xml escaped form to avoid having the problem of escaping > them > when they are used in templates etc etc. > > Unfortunat

Re: how to flush child_stdin

2008-02-22 Thread [EMAIL PROTECTED]
On Feb 22, 12:15 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Thu, 21 Feb 2008 12:34:28 -0800 (PST), "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > > I'm opening up a subprocess like this where slave.py is a text based > > app that receives c

Re: Querying a complex website

2008-02-22 Thread schweet1
On Feb 20, 6:06 pm, 7stud <[EMAIL PROTECTED]> wrote: > 7stud wrote: > > schweet1 wrote: > > > On Feb 19, 4:04�pm, 7stud <[EMAIL PROTECTED]> wrote: > > > > schweet1 wrote: > > > > > Greetings, > > > > > > I am attempting to use python to submit a query to the following URL: > > > > > >https://ramps.

Re: Return value of an assignment statement?

2008-02-22 Thread Steve Holden
Carl Banks wrote: > On Feb 21, 6:52 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >> mrstephengross wrote: What you can't do (that I really miss) is have a tree of assign-and-test expressions: import re pat = re.compile('some pattern') if m = pat.match

Re: Any experience with Python on a PDA ?

2008-02-22 Thread Grant Edwards
On 2008-02-22, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > I wonder if anyone has (good ;-) experiences with Python on a PDA ? > And if so, > - what OS > - what GUI Not a PDA per se, but a target platform very similar to a PDA: PXA-255 at 200MHz with a 1/4 VGA LCD, and something like 128M

Re: advanced usage of python threads

2008-02-22 Thread Christian Heimes
hyperboreean wrote: > Hi, > Is there a document where I can find some advanced information about > python threads? I know the basic things about them and did some > practice, but when I try to advance I don't know where to go or how to go. What's your application doing? Most people are not aware

Re: Tkinter OSX and "lift"

2008-02-22 Thread Miki
Hello Eric, > >>> Tk.lift doesn't seem to work on OSX (Python 2.5.1). > There is a trick that sometimes works even for interpreted application: > > import Tkinter as tk > root = tk.Tk() > root.withdraw() > # Code building the window... > root.lift() > root.deiconify() > root.mainloop() > > This s

Simple - looking for a way to do an element exists check..

2008-02-22 Thread rh0dium
Hi all, I have a simple list to which I want to append another tuple if element 0 is not found anywhere in the list. element = ('/smsc/chp/aztec/padlib/5VT.Cat', '/smsc/chp/aztec/padlib', '5VT.Cat', (33060)) element1 = ('/smsc/chp/aztec/padlib/5VT.Cat2', '/smsc/chp/aztec/padlib', '5VT.

Re: Simple - looking for a way to do an element exists check..

2008-02-22 Thread Paul McGuire
On Feb 22, 11:20 am, rh0dium <[EMAIL PROTECTED]> wrote: > > found = False > for item in a: >   if item[0] == element[0] >     found = True >     break > if not found: >   a.append(element) > > But this is just ugly - Is there a simpler way to interate over all > items in a without using a found fla

Re: Simple - looking for a way to do an element exists check..

2008-02-22 Thread Paul McGuire
On Feb 22, 11:20 am, rh0dium <[EMAIL PROTECTED]> wrote: > Hi all, > > I have a simple list to which I want to append another tuple if > element 0 is not found anywhere in the list. > > element =  ('/smsc/chp/aztec/padlib/5VT.Cat', >   '/smsc/chp/aztec/padlib', >   '5VT.Cat', (33060)) > > element1 =

Re: Simple - looking for a way to do an element exists check..

2008-02-22 Thread Jason
On Feb 22, 10:20 am, rh0dium <[EMAIL PROTECTED]> wrote: > Hi all, > > I have a simple list to which I want to append another tuple if > element 0 is not found anywhere in the list. > > element = ('/smsc/chp/aztec/padlib/5VT.Cat', > '/smsc/chp/aztec/padlib', > '5VT.Cat', (33060)) > > element1 =

Re: xml escapedness

2008-02-22 Thread Robin Becker
Tim van der Leeuw wrote: > On Fri, Feb 22, 2008 at 5:17 PM, Robin Becker <[EMAIL PROTECTED]> wrote: > >> A colleague has decided to keep his django database string values (which >> are xml >> fragments) in an xml escaped form to avoid having the problem of escaping >> them >> when they are used in

Re: xml escapedness

2008-02-22 Thread Steve Holden
Robin Becker wrote: > Tim van der Leeuw wrote: >> On Fri, Feb 22, 2008 at 5:17 PM, Robin Becker <[EMAIL PROTECTED]> wrote: >> >>> A colleague has decided to keep his django database string values (which >>> are xml >>> fragments) in an xml escaped form to avoid having the problem of escaping >>> th

Re: Getting stdout from other processes

2008-02-22 Thread Miki
Hello Matthias, > as I found out, it is possible to get the output of other programs > using os.popen() and read from it. However this method is blocking for > server processes and programs that don't stop immediately. Has anyone > an idea how to get the output of such programs? The current "offic

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Nicola Musatti
On Feb 22, 5:13 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Fri, 22 Feb 2008 04:48:28 -0800, Nicola Musatti wrote: [...] > > As you can see the standard library takes care of all memory > > management. > > Aaah, that's much nicer and easier to understand than the list > comprehensi

Re: Tkinter Menu Item Activation

2008-02-22 Thread Rob Wolfe
[EMAIL PROTECTED] writes: > Tkinter definitely deserves more respect! I'm making rapid progress > and it looks good. > > But am stuck on this: I want the File/Save state to change from > disabled to enabled, depending on whether or not there is something to > save (Text modified). Google returns r

Re: xml escapedness

2008-02-22 Thread Robin Becker
Steve Holden wrote: > Robin Becker wrote: >> Tim van der Leeuw wrote: >>> On Fri, Feb 22, 2008 at 5:17 PM, Robin Becker <[EMAIL PROTECTED]> wrote: >>> A colleague has decided to keep his django database string values (which are xml fragments) in an xml escaped form to avoid having th

Re: Return value of an assignment statement?

2008-02-22 Thread Steven D'Aprano
On Fri, 22 Feb 2008 08:19:07 -0800, Carl Banks wrote: > (The perl example wasn't using an assignment operator.) Hmmm... I see. Obviously I didn't pretend to understand Perl well enough. (I assume you're ignoring the assignments $name = chop(\1) etc. Fair enough.) [...] > I can't help but to t

bus error/segfault from PyArg_ParseTuple in initproc with incorrect arg number

2008-02-22 Thread Miles Lubin
I am using PyArg_ParseTuple to parse the arguments (ignoring the keyword arguments) to my initproc for a type I define. It seems that something goes wrong inside PyArg_ParseTuple when it gets the wrong number of arguments (my format string is "OO"); if the function isn't given exactly two argumen

Re: advanced usage of python threads

2008-02-22 Thread hyperboreean
Well, I will be writing the application server of a three-tier architecture system. I will be using Twisted for the communication with the client but from there I have to make several calls to a database and this asks threading. The tables will be filled by another system that gathers some data

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Paul Rubin
Nicola Musatti <[EMAIL PROTECTED]> writes: > > Partial guarantees are like being a little bit pregnant. > > Yes, and I'm sure your tests cover all possible paths through your code. That is the point of type checking. With a sound type system, "int x" makes sure, at compile time, that x stays an

Re: n00b with urllib2: How to make it handle cookie automatically?

2008-02-22 Thread Rob Wolfe
est <[EMAIL PROTECTED]> writes: > Hi all, > > I need urllib2 do perform series of HTTP requests with cookie from > PREVIOUS request(like our browsers usually do ). Many people suggest I > use some library(e.g. pycURL) instead but I guess it's good practise > for a python beginner to DIY something

Re: Simple - looking for a way to do an element exists check..

2008-02-22 Thread Paul Rubin
rh0dium <[EMAIL PROTECTED]> writes: > found = False > for item in a: > if item[0] == element[0] > found = True > break > if not found: > a.append(element) > > But this is just ugly - Is there a simpler way to interate over all > items in a without using a found flag? Untested and I'm

Re: Globals or objects?

2008-02-22 Thread tinnews
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Fri, 22 Feb 2008 12:01:20 +, tinnews wrote: > > > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >> >> > but you do keep having to use a longer reference to the value > >> >> >so what have you won? > >> >> > >> >> Clarity, simplicity, robustne

Re: Simple - looking for a way to do an element exists check..

2008-02-22 Thread Paul Rubin
Paul Rubin writes: > if any(x==element[0] for x in a): > a.append(element) Should say: if any(x[0]==element[0] for x in a): a.append(element) -- http://mail.python.org/mailman/listinfo/python-list

Pydev, Eclipse

2008-02-22 Thread Boris Ozegovic
Hi Suppose I have three blocks: if 1: if 2: if 3: # here I want my cursor go back to second block (if 2:) What is the standard shortcut for this? ctrl+arrow keys aren't, arrow keys alone aren't either. -- http://mail.python.org/mailman/listinfo/python-li

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Paul Rubin
Nicola Musatti <[EMAIL PROTECTED]> writes: > >a = [f(x) + g(y) for x,y in izip(m1, m2) if h(x,y).frob() == 7] > > > > Consider how many intermediate objects are being allocated in figuring > > out that listcomp. Do you REALLY want to manage all the deallocation > > with something like RAII? >

Re: Return value of an assignment statement?

2008-02-22 Thread Aahz
In article <[EMAIL PROTECTED]>, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > >FWIW, it's IMHO a real wart - given Python's pretention at readability - >that augmented assignement has been implemented that way for lists. This was debated extensively when augmented assignment was created, and

Re: Simple - looking for a way to do an element exists check..

2008-02-22 Thread Paul McGuire
On Feb 22, 12:54 pm, Paul Rubin wrote: > Paul Rubin writes: > >     if any(x==element[0] for x in a): > >       a.append(element) > > Should say: > >      if any(x[0]==element[0] for x in a): >         a.append(element) I think you have this ba

Re: Return value of an assignment statement?

2008-02-22 Thread Aahz
In article <[EMAIL PROTECTED]>, Jeff Schwab <[EMAIL PROTECTED]> wrote: >Aahz wrote: >> In article <[EMAIL PROTECTED]>, >> Jeff Schwab <[EMAIL PROTECTED]> wrote: >>> [EMAIL PROTECTED] wrote: There's nothing like a variable "storing" anything in Python. All you have are names to (ref

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Jeff Schwab
Carl Banks wrote: > On Feb 22, 12:23 am, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Carl Banks wrote: >>> On Feb 21, 7:17 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: Carl Banks wrote: > On Feb 21, 1:22 pm, Nicola Musatti <[EMAIL PROTECTED]> wrote: >> There are other downsides to garbage

Re: Return value of an assignment statement?

2008-02-22 Thread Jeff Schwab
George Sakkis wrote: > On Feb 22, 12:26 am, Jeff Schwab <[EMAIL PROTECTED]> wrote: > >>> On the other hand, "a = b" does always the same thing; unlike C++, '=' >>> is not an operator and therefore it cannot be overriden by the class >>> of 'a'. >> "Not an operator?" Then what is it? > > In this

Re: Tkinter Menu Item Activation

2008-02-22 Thread MartinRinehart
Rob Wolfe wrote: > But I think that you should read this: > http://effbot.org/zone/vroom.htm Rob, may the gods shower you with gold coins! -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >