Re: Object serialization: transfer from a to b (non-implemented code on b)

2010-04-16 Thread Gabriel Rossetti
Andreas Löscher wrote: import types import marshal def a(): pass ... s=marshal.dumps(a.__code__) f=types.FunctionType(marshal.loads(s), {}) f What version of python do you have? If I try your code above I get : >>> import type

Re: Updated License Term Agreement for VC Redistributable in VS 2008 SP1

2010-04-16 Thread Tim Roberts
Andrej Mitrovic wrote: > >I don't think this license agreement change involves the express >editions, which are free. Correct me if I'm wrong here? The license agreement change fixes a problem that was accidentally introduced by Visual Studio 2008 SP1. The redistributable package that can be dow

Re: how to get elements of a com object (wmi log events)

2010-04-16 Thread Tim Golden
On 16/04/2010 01:39, News123 wrote: Just having a short question: I found a code snippet, that fetches windows event logs via a wmi query. import win32com.client strComputer = "." objWMIService = win32com.client.Dispatch("WbemScripting.SWbemLocator") objSWbemServices = objWMIService.ConnectSe

Re: Globally override built-in print function?

2010-04-16 Thread Peter Otten
Dave W. wrote: > I naively thought I could capture output from exec()'ed print > invocations by (somehow) overriding 'print' globally. But this > seems not to be possible. Or at least not easy: Assigning a new function to the global print name affects only print() calls within your script, not

Re: How to run program in Linux

2010-04-16 Thread Dave Angel
Jim Byrnes wrote: I am just learning Python and am new to Linux so I am probably doing something to trip myself up. I am trying to run an example GUI program that fetches a record from a database. All the files are in the same folder. The program runs but its results vary depending on how I

Re: Globally override built-in print function?

2010-04-16 Thread Lie Ryan
On 04/16/10 12:17, Dave W. wrote: >>> I naively thought I could capture output from exec()'ed print >>> invocations by (somehow) overriding 'print' globally. But this >>> seems not to be possible. > >> >>old_print = __builtins__.print >>__builtins__.print = printhook >>yield >>_

cross-platform coloured text in terminal

2010-04-16 Thread Jonathan Hartley
Hi, It irks me that I know of no simple cross-platform way to print colored terminal text from Python. As I understand it, printing ANSI escape codes (as wrapped nicely by module termcolor and others) works on Macs and *nix, but only works on Windows if one has installed the ANSI.SYS device drive

Re: cross-platform coloured text in terminal

2010-04-16 Thread Jonathan Hartley
On Apr 16, 10:28 am, Jonathan Hartley wrote: > Hi, > > It irks me that I know of no simple cross-platform way to print > colored terminal text from Python. > > As I understand it, printing ANSI escape codes (as wrapped nicely by > module termcolor and others) works on Macs and *nix, but only works

Re: Object serialization: transfer from a to b (non-implemented code on b)

2010-04-16 Thread Daniel Fetchinson
> I am trying to serialize a function, class, etc and transfer it, have it > unserialized and used. You might want to look at pyro: http://pyro.sourceforge.net/ and also picloud: http://www.picloud.com/ HTH, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://ma

Can anyone reproduce this crash?

2010-04-16 Thread Alf P. Steinbach
Python 3.1.1 in Windows XP Prof: def number_from_user( prompt ): while True: spec = input( prompt ) try: return float( spec ) except ValueError: s = "Sorry, '{}' is not a valid number spec. Try e.g. '3.14'." print( s.format( spec )

Re: Can anyone reproduce this crash?

2010-04-16 Thread MRAB
Alf P. Steinbach wrote: Python 3.1.1 in Windows XP Prof: def number_from_user( prompt ): while True: spec = input( prompt ) try: return float( spec ) except ValueError: s = "Sorry, '{}' is not a valid number spec. Try e.g. '3.14'."

Re: Can anyone reproduce this crash?

2010-04-16 Thread Lie Ryan
On 04/16/10 21:29, MRAB wrote: > Alf P. Steinbach wrote: >> I thought I'd report this so I tried it several times more but unable >> to reproduce: instead of above hang + crash + truncated traceback the >> complete expected traceback appeared and the program terminated properly. >> >> Can anyone re

Re: Can anyone reproduce this crash?

2010-04-16 Thread Alf P. Steinbach
* MRAB: Alf P. Steinbach wrote: Python 3.1.1 in Windows XP Prof: def number_from_user( prompt ): while True: spec = input( prompt ) try: return float( spec ) except ValueError: s = "Sorry, '{}' is not a valid number spec. Try e.g. '3.14'."

Re: Download Visual Studio Express 2008 now

2010-04-16 Thread Lie Ryan
On 04/13/10 06:36, Martin v. Loewis wrote: > Microsoft has just released Visual Studio 2010, along with its free (of > charge) Express edition. Following a tradition, they are likely to > withdraw support and availability for VS 2008 Express some time in the > future. If only Python could do that,

Re: Download Visual Studio Express 2008 now

2010-04-16 Thread Robin Becker
On 12/04/2010 21:36, Martin v. Loewis wrote: .. If you are planning to build Python extension modules in the next five years, I recommend that you obtain a copy of VS Express, just in case Microsoft removes it from their servers. As mentioned, it's free of charge. When downloading it for

Re: Download Visual Studio Express 2008 now

2010-04-16 Thread Lie Ryan
On 04/16/10 22:09, Robin Becker wrote: > On 12/04/2010 21:36, Martin v. Loewis wrote: > ... >> >> If you are planning to build Python extension modules in the next five >> years, I recommend that you obtain a copy of VS Express, just in case >> Microsoft removes it from their servers. As me

Re: Tough sorting problem: or, I'm confusing myself

2010-04-16 Thread Lie Ryan
On 04/15/10 02:03, Paul Rubin wrote: > Raymond Hettinger writes: >> Not sure what the readability issue is. The phrase "nlargest(2, >> iterable)" does exactly what it says, finds the 2 largest elements >> from an iterable. That makes the programmer's intent more clear than >> the slower, but sem

Re: Can anyone reproduce this crash?

2010-04-16 Thread Alf P. Steinbach
* Alf P. Steinbach: * MRAB: Alf P. Steinbach wrote: Python 3.1.1 in Windows XP Prof: def number_from_user( prompt ): while True: spec = input( prompt ) try: return float( spec ) except ValueError: s = "Sorry, '{}' is not a valid number spec

Re: Download Visual Studio Express 2008 now

2010-04-16 Thread Brian Blais
On Apr 12, 2010, at 16:36 , Martin v. Loewis wrote: If you are planning to build Python extension modules in the next five years, I recommend that you obtain a copy of VS Express Am I missing something here? I have heard this before, but I have built extension modules many times under windo

unexpected output from difflib.SequenceMatcher

2010-04-16 Thread Vlastimil Brom
Hi all, Once in a while I happen to stumble on some not expected behaviour of difflib.SequenceMatcher, in this case I hopefully managed to replicate it on an illustrative sample text. Both strings differ in a minimal way, each having one extra character in a "strategic" position, which seems to mee

Re: Can anyone reproduce this crash?

2010-04-16 Thread Alf P. Steinbach
* Alf P. Steinbach: > [About baffling almost not reproducible interpreter crash on Ctrl C] The error code 0xc417 is some custom one, not a standard Windows code. Sorry, I was wrong about that, just that the MS ErrLook utility didn't find it. http://social.msdn.microsoft.com/Forums/en-US

Re: A question about the posibility of raise-yield in Python

2010-04-16 Thread Lie Ryan
On 04/16/10 02:30, Terry Reedy wrote: > On 4/15/2010 9:34 AM, Дамјан Георгиевски wrote: >> I'm writing this as a complete newbie (on the issue), so don't be >> surprised if it's the stupidest idea ever. >> >> I was wondering if there was ever a discusision in the python community >> on a 'raise-yie

Re: Can anyone reproduce this crash?

2010-04-16 Thread Alf P. Steinbach
* Alf P. Steinbach: * Alf P. Steinbach: > [About baffling almost not reproducible interpreter crash on Ctrl C] The error code 0xc417 is some custom one, not a standard Windows code. Sorry, I was wrong about that, just that the MS ErrLook utility didn't find it. http://social.msdn.mi

Re: Tough sorting problem: or, I'm confusing myself

2010-04-16 Thread Peter Otten
david jensen wrote: > Hi all, > > I'm trying to find a good way of doing the following: > > Each n-tuple in combinations( range( 2 ** m ), n ) has a corresponding > value n-tuple (call them "scores" for clarity later). I'm currently > storing them in a dictionary, by doing: > > > res={} >

Re: user rights and python com servers

2010-04-16 Thread sniffer
On Apr 16, 10:48 am, Mark Hammond wrote: > On 16/04/2010 2:40 PM, sniffer wrote: > > > Thanks Mark, > >   just one question does the explanation given above by you also apply > > to winxp systems in a domain, > > Yeah - IIRC, domain users can't change much of the registry by default, > primarily a

question about list extension

2010-04-16 Thread J
Ok... I know pretty much how .extend works on a list... basically it just tacks the second list to the first list... like so: >>> lista=[1] >>> listb=[2,3] >>> lista.extend(listb) >>> print lista; [1, 2, 3] what I'm confused on is why this returns None: >>> lista=[1] >>> listb=[2,3] >>> print li

Merge two directories together

2010-04-16 Thread Keith Hughitt
Suppose you have two file-trees with common sub-directories but different files that you want to merge together, e.g. /test/ /test/a/ /test/a/file1 /test2/ /test2/a/ /test2/a/file2 You can easily merge the directories in Linux using the "cp" command: cp -r test/* test2/ While Python provides s

Re: Can anyone reproduce this crash?

2010-04-16 Thread Alf P. Steinbach
* Alf P. Steinbach: Found a another bug discussion with * same exception, 0xc417 STATUS_INVALID_CRUNTIME_PARAMETER * same address, 0x78588389 * almost same Python version, namely Py3, * almost same context, namely occurring when program terminates, at http://w

Re: Updated License Term Agreement for VC Redistributable in VS 2008 SP1

2010-04-16 Thread python
Hi Tim, > The license agreement change fixes a problem that was accidentally introduced > by Visual Studio 2008 SP1. The redistributable package that can be downloaded directly from Microsoft (which you would use if you had the Express Edition) has the right license to begin with. It never had th

Re: question about list extension

2010-04-16 Thread Bruno Desthuilliers
J a écrit : Ok... I know pretty much how .extend works on a list... basically it just tacks the second list to the first list... like so: lista=[1] listb=[2,3] lista.extend(listb) print lista; [1, 2, 3] what I'm confused on is why this returns None: So why the None? Is this because what's

Re: How to run program in Linux

2010-04-16 Thread Dave Angel
Jim Byrnes wrote: Dave Angel wrote: Jim Byrnes wrote: I am just learning Python and am new to Linux so I am probably doing something to trip myself up. I am trying to run an example GUI program that fetches a record from a database. All the files are in the same folder. The program runs but it

Re: question about list extension

2010-04-16 Thread Lie Ryan
On 04/16/10 23:41, J wrote: > Ok... I know pretty much how .extend works on a list... basically it > just tacks the second list to the first list... like so: > lista=[1] listb=[2,3] lista.extend(listb) print lista; > [1, 2, 3] > > what I'm confused on is why this returns None:

Re: Download Visual Studio Express 2008 now

2010-04-16 Thread Robert Kern
On 2010-04-16 07:30 AM, Brian Blais wrote: On Apr 12, 2010, at 16:36 , Martin v. Loewis wrote: If you are planning to build Python extension modules in the next five years, I recommend that you obtain a copy of VS Express Am I missing something here? I have heard this before, but I have built

Re: question about list extension

2010-04-16 Thread J. Cliff Dyer
On Sat, 2010-04-17 at 00:37 +1000, Lie Ryan wrote: > On 04/16/10 23:41, J wrote: > > So, what I'm curious about, is there a list comprehension or other > > means to reduce that to a single line? > > from itertools import chain > def printout(*info): > print '\n'.join(map(str, chain(*info))) >

Re: Suppress output to stdout/stderr in InteractiveInterpreter

2010-04-16 Thread Robert Kern
On 2010-04-16 00:42 AM, Dave W. wrote: Think I'll start a new post with the subject: "Globally override built-in print function?" Don't bother. Replacing sys.stdout is the right thing to do. It won't interfere with the C++ streams... -snip- I'm not so certain. Won't the C++ host app share th

Reactive programming in Python ?

2010-04-16 Thread pca
Dear all, Could “reactive programming” still increase the productivity and joy of Python programming? I’d like to hear your thoughts on the idea that object-oriented “programming by formula”, as in a spreadsheet, would simplify our work, because we would not have to worry about the sequence of pr

Re: Globally override built-in print function?

2010-04-16 Thread Robert Kern
On 2010-04-15 21:17 PM, Dave W. wrote: I naively thought I could capture output from exec()'ed print invocations by (somehow) overriding 'print' globally. But this seems not to be possible. old_print = __builtins__.print __builtins__.print = printhook yield __builtins__.print

Re: python wia and RegisterEvent

2010-04-16 Thread gelonida
Hi Mark, On Apr 16, 3:16 am, Mark Hammond wrote: > On 16/04/2010 7:15 AM,gelonidawrote: > > The model used by pywin32 is more "low level" than that exposed by some > of the MS languages.  You probably need something closer to: > >   class MgrHandlerClass: >        def OnEvent(self, EventID=defaul

Re: Incorrect scope of list comprehension variables

2010-04-16 Thread Aahz
In article <4bb92850$0$8827$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: > >Nevertheless, it is a common intuition that the list comp variable should >*not* be exposed outside of the list comp, and that the for-loop variable >should. Perhaps it makes no sense, but it is very common -- I'v

Re: Updated License Term Agreement for VC Redistributable in VS 2008 SP1

2010-04-16 Thread CM
On Apr 16, 3:31 am, Tim Roberts wrote: > Andrej Mitrovic wrote: > > >I don't think this license agreement change involves the express > >editions, which are free. Correct me if I'm wrong here? > > The license agreement change fixes a problem that was accidentally > introduced by Visual Studio 200

Re: Suppress output to stdout/stderr in InteractiveInterpreter

2010-04-16 Thread Dave W.
>>> Don't bother. Replacing sys.stdout is the right thing to do. It >>> won't interfere with the C++ streams... >> I'm not so certain. Won't the C++ host app share the same >> stdin/stdout/stderr file descriptors with the embedded Python >> interpreter? > No. Changing the object that the name sys

Re: Globally override built-in print function?

2010-04-16 Thread Dave W.
>>> old_print = __builtins__.print >>> __builtins__.print = printhook >>> yield >>> __builtins__.print = old_print > >> I'm pretty sure this is semantically equivalent to my original >> code, but I gave it a try anyway. > > Not at all. Declaring "global print" then assigning to "pri

Re: cross-platform coloured text in terminal

2010-04-16 Thread Lie Ryan
On 04/16/10 19:28, Jonathan Hartley wrote: > I'm playing with ideas of what API to expose. My favourite one is to > simply embed ANSI codes in the stream to be printed. Then this will > work as-is on Mac and *nix. To make it work on Windows, printing could > be done to a file0-like object which wra

Re: Updated License Term Agreement for VC Redistributable in VS 2008 SP1

2010-04-16 Thread Lie Ryan
On 04/15/10 06:38, pyt...@bdurham.com wrote: > Alex, > >> I do not see anything about redistribution, only installation, unless I am >> missing something? > > I read "installation" to mean the same as "redistribution" in the > context of this article. Perhaps I'm wrong? > Does it makes sense t

Re: Globally override built-in print function?

2010-04-16 Thread J. Cliff Dyer
On Fri, 2010-04-16 at 09:50 -0700, Dave W. wrote: > >>> old_print = __builtins__.print > >>> __builtins__.print = printhook > >>> yield > >>> __builtins__.print = old_print > > > >> I'm pretty sure this is semantically equivalent to my original > >> code, but I gave it a try anyway.

Re: Updated License Term Agreement for VC Redistributable in VS 2008 SP1

2010-04-16 Thread python
Lie, > Does it makes sense to be able to install a library in other's computer, but > not redistribute it? Hmm... I'll have to consult a lawyer. See Tim Robert's response (I can't remember which Python mailing list) The license agreement change fixes a problem that was accidentally introduced

Re: Merge two directories together

2010-04-16 Thread Steven Howe
Think about using the subprocess module. There are calls made just for your. Notably (using command pydoc subprrocess.call) : - subprocess.call = call(*popenargs, **kwargs) Run command with arguments. Wait for command to complete, then return the returncode attribute.

Re: Updated License Term Agreement for VC Redistributable in VS 2008 SP1

2010-04-16 Thread Lie Ryan
On 04/17/10 03:40, pyt...@bdurham.com wrote: > Lie, > >> Does it makes sense to be able to install a library in other's computer, but >> not redistribute it? Hmm... I'll have to consult a lawyer. > > See Tim Robert's response (I can't remember which Python mailing list) > I was responding to A

Re: Reactive programming in Python ?

2010-04-16 Thread Mike Kent
On Apr 16, 11:18 am, pca wrote: > Dear all, > > Could “reactive programming” still increase the productivity and joy > of Python programming?  I’d like to hear your thoughts on the idea > that object-oriented “programming by formula”, as in a spreadsheet, > would simplify our work, because we woul

Re: Merge two directories together

2010-04-16 Thread Dave W.
> While Python provides some helpful methods for moving files and > directories around (shutil.move, shutil.copytree, etc), none of > them seem to be able to merge two directories. -snip- > Any ideas? It's not pretty, but you could hack up the original copytree() source so it ignores errors from t

Re: Reactive programming in Python ?

2010-04-16 Thread Stefan Behnel
pca, 16.04.2010 17:18: > In fact, I have seeded an open-source project, Yoopf, that enables > programming by formula within Python, with the goal of dramatically > accelerating the development of the model view in the MVC model. Looks like the example on the main page would work better with the "a

Re: Download Visual Studio Express 2008 now

2010-04-16 Thread Martin v. Löwis
Brian Blais wrote: > On Apr 12, 2010, at 16:36 , Martin v. Loewis wrote: > >> If you are planning to build Python extension modules in the next five >> years, I recommend that you obtain a copy of VS Express > > Am I missing something here? I have heard this before, but I have built > extension

Re: Incorrect scope of list comprehension variables

2010-04-16 Thread Raymond Hettinger
On Apr 3, 3:30 am, Alain Ketterlin wrote: > Hi all, > > I've just spent a few hours debugging code similar to this: > > d = dict() > for r in [1,2,3]: >     d[r] = [r for r in [4,5,6]] > print d > > THe problem is that the "r" in d[r] somehow captures the value of the > "r" in the list comprehensi

Re: Can anyone reproduce this crash?

2010-04-16 Thread Terry Reedy
On 4/16/2010 9:50 AM, Alf P. Steinbach wrote: * Alf P. Steinbach: Found a another bug discussion with * same exception, 0xc417 STATUS_INVALID_CRUNTIME_PARAMETER * same address, 0x78588389 * almost same Python version, namely Py3, * almost same context, namely occurring when program term

distutils examples?

2010-04-16 Thread TomF
I'm packaging up a program with distutils and I've run into problems trying to get setup.py right. It's not a standalone package; it's a script plus modules, data files and documentation. I've been over the distutils documentation but I'm having trouble getting the package_data and data_files

Re: question about list extension

2010-04-16 Thread Terry Reedy
On 4/16/2010 9:41 AM, J wrote: Ok... I know pretty much how .extend works on a list... basically it just tacks the second list to the first list... like so: lista=[1] listb=[2,3] lista.extend(listb) print lista; [1, 2, 3] This shows right here that lista is extended in place. If you are not

Re: distutils examples?

2010-04-16 Thread Philip Semanchuk
On Apr 16, 2010, at 3:12 PM, TomF wrote: I'm packaging up a program with distutils and I've run into problems trying to get setup.py right. It's not a standalone package; it's a script plus modules, data files and documentation. I've been over the distutils documentation but I'm having t

Re: question about list extension

2010-04-16 Thread J
On Fri, Apr 16, 2010 at 15:16, Terry Reedy wrote: > On 4/16/2010 9:41 AM, J wrote: >> >> Ok... I know pretty much how .extend works on a list... basically it >> just tacks the second list to the first list... like so: >> > lista=[1] > listb=[2,3] > lista.extend(listb) > print lista

getting a string as the return value from a system command

2010-04-16 Thread Catherine Moroney
Hello, I want to call a system command (such as uname) that returns a string, and then store that output in a string variable in my python program. What is the recommended/most-concise way of doing this? I could always create a temporary file, call the "subprocess.Popen" module with the tempora

Re: Reactive programming in Python ?

2010-04-16 Thread pca
On Apr 16, 8:28 pm, Stefan Behnel wrote: > pca, 16.04.2010 17:18: > > > In fact, I have seeded an open-source project, Yoopf, that enables > > programming by formula within Python, with the goal of dramatically > > accelerating the development of the model view in the MVC model. > > Looks like the

Re: Reactive programming in Python ?

2010-04-16 Thread Stefaan Himpe
You can find more information on this project at www.yoopf.org. Your comments are more than welcome! Is this something similar to trellis? http://pypi.python.org/pypi/Trellis -- http://mail.python.org/mailman/listinfo/python-list

Re: getting a string as the return value from a system command

2010-04-16 Thread Robert Kern
On 2010-04-16 14:06 PM, Catherine Moroney wrote: Hello, I want to call a system command (such as uname) that returns a string, and then store that output in a string variable in my python program. What is the recommended/most-concise way of doing this? I could always create a temporary file, c

Re: getting a string as the return value from a system command

2010-04-16 Thread Catherine Moroney
Robert Kern wrote: On 2010-04-16 14:06 PM, Catherine Moroney wrote: Hello, I want to call a system command (such as uname) that returns a string, and then store that output in a string variable in my python program. What is the recommended/most-concise way of doing this? I could always create

SEC apparently about to mandate Python for a particular financial use

2010-04-16 Thread Mike Kent
http://jrvarma.wordpress.com/2010/04/16/the-sec-and-the-python/ -- http://mail.python.org/mailman/listinfo/python-list

Re: SEC apparently about to mandate Python for a particular financial use

2010-04-16 Thread Chris Rebert
On Fri, Apr 16, 2010 at 3:01 PM, Mike Kent wrote: > SEC apparently about to mandate Python for a particular financial use > http://jrvarma.wordpress.com/2010/04/16/the-sec-and-the-python/ See thread from 5 days ago: http://mail.python.org/pipermail/python-list/2010-April/1241578.html Cheers, Chr

Re: Download Visual Studio Express 2008 now

2010-04-16 Thread Martin v. Loewis
>> Python 2.6, 2.7, and 3.1 are all built with that release (i.e. 2008). >> Because of another long tradition, Python extension modules must be >> built with the same compiler version (more specifically, CRT version) as >> Python itself. So to build extension modules for any of these releases, >> y

Re: What license/copyright text to include and where to include it when selling a commercial Python based application?

2010-04-16 Thread Martin v. Loewis
> 1. What Python license text/copyright text should I place in our > printed user manual? > > 2. What Python license text/copyright text should I include in > our online documentation? > > 3. What Python license text/copyright text should I include in > product's license text file? > > 4. What P

Re: feature request for a wget -r like implementation in python3

2010-04-16 Thread Gabriel Genellina
En Thu, 15 Apr 2010 16:37:37 -0300, gert escribió: [a wget -r like implementation in python3] So I can make a recursive http download script What about calling wget itself? subprocess.call(['wget',...]) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: SEC apparently about to mandate Python for a particular financial use

2010-04-16 Thread Gnarlodious
"technology as a regulatory tool", what a concept! Pretty impressive change we can believe in. Here's hoping open-source human-readable computer programs become the standard for verifiable elections and all sorts of financial uses. Otherwise, computers will end up being used to defraud the populace

Re: Incorrect scope of list comprehension variables

2010-04-16 Thread Steven D'Aprano
On Fri, 16 Apr 2010 08:48:03 -0700, Aahz wrote: > In article <4bb92850$0$8827$c3e8...@news.astraweb.com>, Steven D'Aprano > wrote: >> >>Nevertheless, it is a common intuition that the list comp variable >>should *not* be exposed outside of the list comp, and that the for-loop >>variable should.

Re: Incorrect scope of list comprehension variables

2010-04-16 Thread Chris Rebert
On Fri, Apr 16, 2010 at 5:20 PM, Steven D'Aprano wrote: > On Fri, 16 Apr 2010 08:48:03 -0700, Aahz wrote: >> In article <4bb92850$0$8827$c3e8...@news.astraweb.com>, Steven D'Aprano >> wrote: >>>Nevertheless, it is a common intuition that the list comp variable >>>should *not* be exposed outside o

Re: Incorrect scope of list comprehension variables

2010-04-16 Thread MRAB
Steven D'Aprano wrote: On Fri, 16 Apr 2010 08:48:03 -0700, Aahz wrote: In article <4bb92850$0$8827$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: Nevertheless, it is a common intuition that the list comp variable should *not* be exposed outside of the list comp, and that the for-loop vari

Re: Incorrect scope of list comprehension variables

2010-04-16 Thread Alf P. Steinbach
* Steven D'Aprano: On Fri, 16 Apr 2010 08:48:03 -0700, Aahz wrote: In article <4bb92850$0$8827$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: Nevertheless, it is a common intuition that the list comp variable should *not* be exposed outside of the list comp, and that the for-loop variable

Re: getting a string as the return value from a system command

2010-04-16 Thread Larry Hudson
Catherine Moroney wrote: Hello, I want to call a system command (such as uname) that returns a string, and then store that output in a string variable in my python program. What is the recommended/most-concise way of doing this? I could always create a temporary file, call the "subprocess.Pope

Elise Mooney reports on Channel 9 about Maths Worldwide and the fraud that it is

2010-04-16 Thread Ms. Hyde
Link: http://www.petitiononline.com/mwwabuse/petition.html (as reported by Elise Mooney from Channel 9) I wish to raise this topic of Rob and Kim Hyde and their experience they stated publicly on Channel Nine's A Current Affair. Now they are caring loving parents, and for them to even THINK about

Re: Reactive programming in Python ?

2010-04-16 Thread Stefan Behnel
pca, 16.04.2010 22:02: On Apr 16, 8:28 pm, Stefan Behnel wrote: pca, 16.04.2010 17:18: In fact, I have seeded an open-source project, Yoopf, that enables programming by formula within Python, with the goal of dramatically accelerating the development of the model view in the MVC model. Looks

Re: Striving for PEP-8 compliance

2010-04-16 Thread Gregory Ewing
Steven D'Aprano wrote: On Wed, 14 Apr 2010 22:10:28 +0200, Hans Mulder wrote: Anybody who invents another brace-delimited language should be beaten. You always end up with a big problem trying to make sure the braces are consistent with the program logic. Anybody who invents another programm

Re: getting a string as the return value from a system command

2010-04-16 Thread CHEN Guang
> Catherine Moroney wrote: >> Hello, >> >> I want to call a system command (such as uname) that returns a string, >> and then store that output in a string variable in my python program. >> >> What is the recommended/most-concise way of doing this? >> >> I could always create a temporary file, c