Wing IDE 3.2.1 released

2009-09-15 Thread Wingware
Hi, Wingware has released version 3.2.1 of Wing IDE, our integrated development environment for the Python programming language. This bug fix release includes the following: * Improved support for Snow Leopard (OS X 10.6) * Support for x86_64 Python 2.4+ on OS X * Support for Stackless Python

[ANN] Intro+Intermediate Python course, San Francisco, Nov 2009

2009-09-15 Thread wesley chun
(COMPREHENSIVE) INTRO+INTERMEDIATE PYTHON Mon-Wed, 2009 Nov 9-11, 9AM - 5PM If you have been in the Python community for some time, you may be familiar with my introductory (and advanced) courses. Many new Python intro courses have been added over the past few years, so aren't all classes the

[ANN] argparse 1.0.1 - Command-line parsing library

2009-09-15 Thread Steven Bethard
= Announcing argparse 1.0.1 = The argparse module provides an easy, declarative interface for creating command line tools, which knows how to: * parse the arguments and flags from sys.argv * convert arg strings into objects for your program *

Re: Odd/Weird errors with FTPLib

2009-09-15 Thread Bakes
On Sep 15, 1:32 am, MRAB pyt...@mrabarnett.plus.com wrote: Bakes wrote: On Sep 13, 11:47 pm, MRAB pyt...@mrabarnett.plus.com wrote: Bakes wrote: On 13 Sep, 22:41, Chris Rebert c...@rebertia.com wrote: On Sun, Sep 13, 2009 at 2:34 PM, Bakes ba...@ymail.com wrote: I am using a simple

[ANN] argparse 1.0.1 - Command-line parsing library

2009-09-15 Thread Steven Bethard
= Announcing argparse 1.0.1 = The argparse module provides an easy, declarative interface for creating command line tools, which knows how to: * parse the arguments and flags from sys.argv * convert arg strings into objects for your program *

Re: list as an instance attribute

2009-09-15 Thread Lie Ryan
Robin Becker wrote: Python is often put forward as a as a finger friendly language, but we have capitals encouraged for user class names and for some common values eg None, True, False these are required. And I'm glad it is, or else I'll get a finger-sore and an eye-sore --

Re: Google Code Jam language usage

2009-09-15 Thread Bearophile
(If you see any error in what I have written here, please tell me.) So far I've never done a Google Code Jam. There are 12 problems there (G.C.Jam 2009), and the best solutions are 9 in C++ and 3 in C (I think they are the best solutions, but I am not sure). The code of all such best solutions is

Re: python decimals

2009-09-15 Thread Mark Dickinson
On Sep 15, 2:27 am, Andrew Svetlov andrew.svet...@gmail.com wrote: Is there some kind of python binding for decNumber library? Standard decimal.Decimal is good enough, but very slow. My current project toughly coupled with 'currency' operations and we have performance problems related to

Re: VT100 in Python

2009-09-15 Thread Grant Edwards
On 2009-09-14, Wolfgang Rohdewald wolfg...@rohdewald.de wrote: that should be easy using regular expressions And they say irony doesn't work well on Usenet! -- Grant Edwards grante Yow! My nose feels like a at bad

Re: An assessment of the Unicode standard

2009-09-15 Thread Christopher Culver
Robin Becker ro...@reportlab.com writes: well allegedly, the medium is the message so we also need to take account of language in addition to the meaning of communications. I don't believe all languages are equivalent in the meanings that they can encode or convey. Our mathematics is heavily

Re: An assessment of the Unicode standard

2009-09-15 Thread r
On Sep 14, 1:24 pm, Terry Reedy tjre...@udel.edu wrote: r wrote: So how many letters do we need? 50, 100, 1000?  From Wikipedia IPA article: Occasionally symbols are added, removed, or modified by the International Phonetic Association. As of 2008, there are 107 distinct letters, 52

Re: numpy NaN, not surviving pickle/unpickle?

2009-09-15 Thread Mark Dickinson
On Sep 14, 4:05 pm, Scott David Daniels scott.dani...@acm.org wrote: Steven D'Aprano wrote: On Sun, 13 Sep 2009 17:58:14 -0500, Robert Kern wrote: Exactly -- there are 2**53 distinct floats on most IEEE systems, the vast majority of which might as well be random. What's the point of caching

Re: How to improve this code?

2009-09-15 Thread Hendrik van Rooyen
On Tuesday 15 September 2009 03:08:59 Oltmans wrote: match=[1,2,3,4,5] def elementsPresent(aList): result=False if not aList: return False for e in aList: if e in match: result=True else:

Re: Remove empty strings from list

2009-09-15 Thread Bruno Desthuilliers
Helvin a écrit : Hi, Sorry I did not want to bother the group, but I really do not understand this seeming trivial problem. I am reading from a textfile, where each line has 2 values, with spaces before and between the values. I would like to read in these values, but of course, I don't want

Re: Incremental project based programming guide

2009-09-15 Thread Hendrik van Rooyen
On Tuesday 15 September 2009 04:43:46 bouncy...@gmail.com wrote: I was wondering if anyone had actually designed their programming text around incremental parts of a project and then taken the results of the project at each chapter and created something of value. specifically in referwnce to

Re: An assessment of the Unicode standard

2009-09-15 Thread Hendrik van Rooyen
On Monday 14 September 2009 14:06:36 Christopher Culver wrote: This is the old Sapir-Whorf hypothesis, which fell out of favour among linguists half a century ago already. 1) Language does not constrain human thought, and 2) any two human languages are both capable of expressing the same

Re: Remove empty strings from list

2009-09-15 Thread Bruno Desthuilliers
Dave Angel a écrit : (snip) As Chris says, you're modifying the list while you're iterating through it, and that's undefined behavior. Why not do the following? mylist = line.strip().split(' ') mylist = [item for item in mylist if item] Mmmm... because the second line is plain useless

Re: Remove empty strings from list

2009-09-15 Thread Bruno Desthuilliers
Dennis Lee Bieber a écrit : (snip) All of which can be condensed into a simple for ln in f: wrds = ln.strip() # do something with the words -- no whitespace to be seen I assume you meant: wrds = ln.strip().split() ?-) --

Re: Retracing your steps in an interactive python env

2009-09-15 Thread Bernhard Voigt
On Sep 14, 9:52 pm, Jack Norton j...@0x6a.com wrote: Anyway, I have created a function using def, and well, I like the way it is working, however...  I have already filled the command line history buffer (the com.exe buffer?) so _what_ I actually filled this def with is lost.  Now, it isn't

PyQT Qthread stuck main app

2009-09-15 Thread daved170
Hi everybody, I've got a simple GUI app written in python and pyqt. I'm having 2 buttons - start and stop start calls a function that start a thread and stop stops it. my problem is that when start is pusshed the entire window stuck and it's impossible to push the STOP button and even when it

How to define a class that can act as dictionary key?

2009-09-15 Thread Lambda
Hi, I'd like to define a class to use it as a dictionary key: class dict_entry: def __init__(self, term = , doc_freq = 0): self.term = term self.doc_freq = doc_freq def __cmp__(self, entry): return isinstance(entry, dict_entry) and cmp(self.term, entry.term) def

Re: Google Code Jam language usage

2009-09-15 Thread Bearophile
(There can be ways to speed up this Python code, I have not tried to use a 1D matrix with shifts to find the right starting of the rows as in C, and often in such dynamic programming algorithms you can just keep 2 rows to avoid storing the whole dynamic matrix, this saves memory and speed up

Re: How to define a class that can act as dictionary key?

2009-09-15 Thread Paul Rubin
Lambda stephenh...@gmail.com writes: When I run it, it says TypeError: unhashable instance It looks like I can't use the new class object as the dictionary key. What should I do? You have to add a __hash__ method. Untested: def __hash__(self): return (self.term, self.doc_freq) is

Re: How to define a class that can act as dictionary key?

2009-09-15 Thread Xavier Ho
On Tue, Sep 15, 2009 at 9:47 PM, Lambda stephenh...@gmail.com wrote: When I run it, it says TypeError: unhashable instance I believe you need to implement __hash__() for the class. Make sure your class returns a unique identifier for a certain value. --

Re: How to define a class that can act as dictionary key?

2009-09-15 Thread Christian Heimes
Paul Rubin schrieb: Lambda stephenh...@gmail.com writes: When I run it, it says TypeError: unhashable instance It looks like I can't use the new class object as the dictionary key. What should I do? You have to add a __hash__ method. Untested: def __hash__(self): return (self.term,

Re: VTK install

2009-09-15 Thread Francesco Bochicchio
On Sep 15, 6:29 am, Gib gib.bo...@gmail.com wrote: As part of the MayaVi install, I need to install VTK.   ... Since VTK appears to be installed, I'm guessing that either the path setting is wrong, or python is not using PYTHONPATH.  How can I check that PYTHONPATH is being used? The paths

Re: How to define a class that can act as dictionary key?

2009-09-15 Thread Paul Rubin
Christian Heimes li...@cheimes.de writes: def __hash__(self): return (self.term, self.doc_freq) is probably the easiest. The __hash__ function must return an integer: Oh oops. Try: def __hash__(self): return hash((self.term, self.doc_freq)) --

str.split() with empty separator

2009-09-15 Thread Ulrich Eckhardt
Hi! 'abc'.split('') gives me a ValueError: empty separator. However, ''.join(['a', 'b', 'c']) gives me 'abc'. Why this asymmetry? I was under the impression that the two would be complementary. Uli -- Sator Laser GmbH Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932 --

Re: PyQT Qthread stuck main app

2009-09-15 Thread David Boddie
On Tue Sep 15 12:59:35 CEST 2009, daved170 wrote: my problem is that when start is pusshed the entire window stuck and it's impossible to push the STOP button and even when it looks like it's been pushed it actually don't do anything. any idea how to fix it? Does adding a call to the base

Re: How to define a class that can act as dictionary key?

2009-09-15 Thread Bruno Desthuilliers
Lambda a écrit : Hi, I'd like to define a class to use it as a dictionary key: Others already answered (define the __hash__ method). Just one point: the value returned by the __hash__ method should not change for the lifetime of the object. So if you use instance attributes to compute the

Re: str.split() with empty separator

2009-09-15 Thread Xavier Ho
On Tue, Sep 15, 2009 at 10:31 PM, Ulrich Eckhardt eckha...@satorlaser.comwrote: 'abc'.split('') gives me a ValueError: empty separator. However, ''.join(['a', 'b', 'c']) gives me 'abc'. Why this asymmetry? I was under the impression that the two would be complementary. I'm not sure about

preferred way to set encoding for print

2009-09-15 Thread _wolf
hi folks, i am doing my first steps in the wonderful world of python 3. some things are good. some things have to be relearned. some things drive me crazy. sadly, i'm working on a windows box. which, in germany, entails that python thinks it to be a good idea to take cp1252 as the default

Re: str.split() with empty separator

2009-09-15 Thread Dave Angel
Ulrich Eckhardt wrote: Hi! 'abc'.split('') gives me a ValueError: empty separator. However, ''.join(['a', 'b', 'c']) gives me 'abc'. Why this asymmetry? I was under the impression that the two would be complementary. Uli I think the problem is that join() is lossy; if you try

LinkedIn Messages, 9/15/2009

2009-09-15 Thread LinkedIn Communication
LinkedIn REMINDERS: Invitation Reminders: * View Invitation from Tim Heath http://www.linkedin.com/e/I2LlXdLlWUhFABKmxVOlgGLlWUhFAfhMPPF/blk/I287618177_3/0PnPsTcjwNdzsUcAALqnpPbOYWrSlI/svi/ * View Invitation from Navneet Khanna

ANN: OpenOpt 0.25 - free Python-written numerical optimization framework with automatic differentiation

2009-09-15 Thread dmitrey
OpenOpt is cross-platform (Windows, Linux, Mac OS etc) Python-written framework. If you have a model written in FuncDesigner (http:// openopt.org/FuncDesigner), you can get 1st derivatives via automatic differentiation (http://en.wikipedia.org/wiki/ Automatic_differentiation) (some examples here:

ANN: FuncDesigner 0.15 - free Python-written framework with automatic differentiation

2009-09-15 Thread dmitrey
FuncDesigner is cross-platform (Windows, Linux, Mac OS etc) Python- written framework with automatic differentiation (http:// en.wikipedia.org/wiki/Automatic_differentiation). License BSD allows to use it in both open- and closed-code soft. It has been extracted from OpenOpt framework as a

Re: Incremental project based programming guide

2009-09-15 Thread John Haggerty
On Tue, Sep 15, 2009 at 2:22 AM, Hendrik van Rooyen hend...@microcorp.co.za wrote: On Tuesday 15 September 2009 04:43:46 bouncy...@gmail.com wrote: I was wondering if anyone had actually designed their programming text around incremental parts of a project and then taken the results of the

Re: overrideredirect vs. text entry etc. widget

2009-09-15 Thread Sean DiZazzo
On Sep 14, 10:43 pm, kernus ker...@gmail.com wrote: I just googled this post: http://mail.python.org/pipermail/python-list/2006-September/575832.html something like: from Tkinter import * root = Tk() Entry(root).pack() Button(root, text='Quit', command=sys.exit).pack()

Re: MayaVi install

2009-09-15 Thread Robert Kern
On 2009-09-14 23:07 PM, Gib wrote: I am trying to follow the instructions for installing MayaVi given on the Enthought site: http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/installation.html I'm following the step-by-step instructions to install with eggs under Windows.

Re: PyQT Qthread stuck main app

2009-09-15 Thread Dave Angel
daved170 wrote: On Sep 15, 2:54 pm, David Boddie dbod...@trolltech.com wrote: On Tue Sep 15 12:59:35 CEST 2009, daved170 wrote: my problem is that when start is pusshed the entire window stuck and it's impossible to push the STOP button and even when it looks like it's been pushed it

cx_Oracle problem

2009-09-15 Thread Squid
It's time for another round of stump-the-geek. (thats what we call it in my office) If actual code is needed I can provide but lets start off small for this one... I've got a Python script that uses cx_Oracle to access an Oracle DB. running the script from command line runs perfect running the

Re: cx_Oracle problem

2009-09-15 Thread Squid
On Sep 15, 9:45 am, Squid ossto...@gmail.com wrote: It's time for another round of stump-the-geek. (thats what we call it in my office) If actual code is needed I can provide but lets start off small for this one... I've got a Python script that uses cx_Oracle to access an Oracle DB.

Re: How to improve this code?

2009-09-15 Thread Sol Toure
def are_elements_present(sourceList, searchList):for e in searchList: if e not in sourceList: return False return True Using set: def are_elements_present(sourceList, searchList): return len(set(sourceList).intersection(set(searchList)) ==

Re: How to improve this code?

2009-09-15 Thread Tim Golden
Sol Toure wrote: def are_elements_present(sourceList, searchList):for e in searchList: if e not in sourceList: return False return True Using set: def are_elements_present(sourceList, searchList): return

Re: How to improve this code?

2009-09-15 Thread Tim Golden
Tim Golden wrote: Unless I'm missing something, (and I didn't bother to read the original code so I may be) that's a subset test: set (searchList) = set (searchList) (cough) or, rather: set (searchList) = set (sourceList) TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: An assessment of the Unicode standard

2009-09-15 Thread Christopher Culver
Hendrik van Rooyen hend...@microcorp.co.za writes: 2) Is about as useful as stating that any Turing complete language and processor pair is capable of solving any computable problem, given enough time. So why are we not all programming in brainfuck? Except the amount of circumlocution one

Re: str.split() with empty separator

2009-09-15 Thread MRAB
Vlastimil Brom wrote: 2009/9/15 Ulrich Eckhardt eckha...@satorlaser.com: Hi! 'abc'.split('') gives me a ValueError: empty separator. However, ''.join(['a', 'b', 'c']) gives me 'abc'. Why this asymmetry? I was under the impression that the two would be complementary. Uli maybe it isn't

Re: weird str error

2009-09-15 Thread Peter Otten
daved170 wrote: Hi everybody, I'm using SPE 0.8.3.c as my python editor. I'm using the str() function and i got a very odd error. I'm trying to do this: print str(HI) When i'm writing this line in the shell it prints: HI When it's in my code (it's the only line) i'm getting the following

Re: weird str error

2009-09-15 Thread Dave Angel
daved170 wrote: Hi everybody, I'm using SPE 0.8.3.c as my python editor. I'm using the str() function and i got a very odd error. I'm trying to do this: print str(HI) When i'm writing this line in the shell it prints: HI When it's in my code (it's the only line) i'm getting the following error:

Re: Re: How to improve this code?

2009-09-15 Thread Dave Angel
Oltmans wrote: On Sep 15, 1:13 pm, Hendrik van Rooyen hend...@microcorp.co.za wrote: (i) a True if All the elements in match are in aList, else False? (ii) a True if any one or more of the members of match are in aList? (iii) Something else? That's a good question because I

Re: An assessment of the Unicode standard

2009-09-15 Thread Hyuga
On Sep 14, 5:05 am, Christopher Culver crcul...@christopherculver.com wrote: Hyuga hyugaricd...@gmail.com writes: I just wanted to add, in defense of the Chinese written language ... that I think it would make a fairly good candidate for use at least as a universal *written* language.  

Re: An assessment of the Unicode standard

2009-09-15 Thread r
On Sep 15, 4:12 am, Hendrik van Rooyen hend...@microcorp.co.za wrote: (snip) When a language lacks a word for a concept like window, then (I believe  :-) ), it kind of puts a crimp in the style of thinking that a person will do, growing up with only that language. Are you telling us people

Re: How to improve this code?

2009-09-15 Thread Andreas Waldenburger
On Mon, 14 Sep 2009 18:33:17 -0700 (PDT) André andre.robe...@gmail.com wrote: Here's an example using sets: def is_present(list_1, list_2): ...if set(list_1).intersection(set(list_2)): ... return True ...return False ... Not that it matters, but I'd probably write: def

Looking for a pure Python chart drawing module

2009-09-15 Thread John Nagle
I'm looking for something that can draw simple bar and pie charts in Python. I'm trying to find a Python package, not a wrapper for some C library, as this has to run on both Windows and Linux and version clashes are a problem. Here's the list from the Python wiki at

Re: Looking for a pure Python chart drawing module

2009-09-15 Thread Vlastimil Brom
2009/9/15 John Nagle na...@animats.com: I'm looking for something that can draw simple bar and pie charts in Python.  I'm trying to find a Python package, not a wrapper for some C library, as this has to run on both Windows and Linux and version clashes are a problem. Here's the list from

KeyBoard interrupt and Redirection operator

2009-09-15 Thread aditya shukla
Hello Guys, I have a program which i use like this scraps.py arg1 arg2 filename. I am using the redirection operator to direct the output to the filename .The scenario here is that I want to print a message as long as the program is running and as generate an error message and exit as I use a

Re: How to check something is in a list with rich-comparison objects?

2009-09-15 Thread Gabriel Genellina
En Tue, 15 Sep 2009 11:18:33 -0300, Jason jason.hee...@gmail.com escribió: Comparing a string to the enumerations in pysvn gives me an attribute error, because they've overloaded the rich compare methods: import pysvn string in [pysvn.wc_notify_action.status_completed, string] Traceback

Trouble with MySQLdb

2009-09-15 Thread Chris
I'm receiving the following error: Traceback (most recent call last): File db.py, line 189, in module rows = db.get(SELECT * FROM survey) File db.py, line 55, in get self.sql(query) File db.py, line 47, in sql return self.cursor.execute(query) File

Re: Why use locals()

2009-09-15 Thread Gabriel Genellina
En Tue, 15 Sep 2009 11:18:35 -0300, Sion Arrowsmith s...@viridian.paintbox escribió: Sean DiZazzo half.ital...@gmail.com wrote: What I'm not clear about is under what circumstances locals() does not produce the same result as vars() . py help(vars) Help on built-in function vars in module

Re: KeyBoard interrupt and Redirection operator

2009-09-15 Thread Gabriel Genellina
En Tue, 15 Sep 2009 15:10:48 -0300, aditya shukla adityashukla1...@gmail.com escribió: I have a program which i use like this scraps.py arg1 arg2 filename. I am using the redirection operator to direct the output to the filename .The scenario here is that I want to print a message as long

Re: KeyBoard interrupt and Redirection operator

2009-09-15 Thread Gary Herron
aditya shukla wrote: Hello Guys, I have a program which i use like this scraps.py arg1 arg2 filename. I am using the redirection operator to direct the output to the filename .The scenario here is that I want to print a message as long as the program is running and as generate an error

ActiveState Python 2.5 doesn't work via ssh?

2009-09-15 Thread Grant Edwards
Does anybody have any idea why Active State Python 2.5 works fine from a normal Cygwin shell window, but hangs when I try to start it when I'm ssh'd into the machine? -- Grant Edwards grante Yow! I don't know WHY I at

Re: Looking for a pure Python chart drawing module

2009-09-15 Thread ici
On Sep 15, 8:25 pm, John Nagle na...@animats.com wrote: I'm looking for something that can draw simple bar and pie charts in Python.  I'm trying to find a Python package, not a wrapper for some C library, as this has to run on both Windows and Linux and version clashes are a problem. Here's

subprocess woes

2009-09-15 Thread kj
I'm trying to write a function, sort_data, that takes as argument the path to a file, and sorts it in place, leaving the last sentinel line in its original position (i.e. at the end). Here's what I have (omitting most error-checking code): def sort_data(path, sentinel='.\n'): tmp_fd, tmp

Re: KeyBoard interrupt and Redirection operator

2009-09-15 Thread Dave Angel
aditya shukla wrote: Hello Guys, I have a program which i use like this scraps.py arg1 arg2 filename. I am using the redirection operator to direct the output to the filename .The scenario here is that I want to print a message as long as the program is running and as generate an error

Upcoming Python/Django Classes

2009-09-15 Thread Steve Holden
Holden Web is please to announce a public Introduction to Python class, near Washington DC, on October 13-15, presented by Steve Holden. This is followed, on Friday October 16, by a one-day Django Master Class presented by Jacob Kaplan-Moss. Further details are available from

Re: subprocess woes

2009-09-15 Thread Mike Driscoll
On Sep 15, 2:26 pm, kj no.em...@please.post wrote: I'm trying to write a function, sort_data, that takes as argument the path to a file, and sorts it in place, leaving the last sentinel line in its original position (i.e. at the end).  Here's what I have (omitting most error-checking code):

Re: subprocess woes

2009-09-15 Thread Christian Heimes
Mike Driscoll wrote: You can use cStringIO to create a file-like object in memory: http://docs.python.org/library/stringio.html No, you can't with subprocess. The underlying operating system API requires a file descriptor of a real file. Christian --

Re: An assessment of the Unicode standard

2009-09-15 Thread Terry Reedy
Christopher Culver wrote: Robin Becker ro...@reportlab.com writes: well allegedly, the medium is the message so we also need to take account of language in addition to the meaning of communications. I don't believe all languages are equivalent in the meanings that they can encode or convey. Our

Re: python decimals

2009-09-15 Thread Terry Reedy
Mark Dickinson wrote: On Sep 15, 2:27 am, Andrew Svetlov andrew.svet...@gmail.com wrote: Is there some kind of python binding for decNumber library? Standard decimal.Decimal is good enough, but very slow. My current project toughly coupled with 'currency' operations and we have performance

Re: Looking for a pure Python chart drawing module

2009-09-15 Thread John Nagle
John Nagle wrote: I'm looking for something that can draw simple bar and pie charts in Python. I'm trying to find a Python package, not a wrapper for some C library, as this has to run on both Windows and Linux and version clashes are a problem. Here's the list from the Python wiki at

Application Packages

2009-09-15 Thread Dj Gilcrease
Say I have an application that lives in /usr/local/myapp it comes with some default plugins that live in /usr/local/myapp/plugins and I allow users to have plugins that would live in ~/myapp/plugins Is there a way to map ~/myapp to a user package so I could do from user.plugins import * or better

unpacking vars from list of tuples

2009-09-15 Thread Ross
I'm inexperienced with some of the fancy list slicing syntaxes where python shines. If I have a list of tuples: k=[(a, bob, c), (p, joe, d), (x, mary, z)] and I want to pull the middle element out of each tuple to make a new list: myList = [bob, joe, mary] is there some compact way to do

Re: unpacking vars from list of tuples

2009-09-15 Thread Chris Rebert
On Tue, Sep 15, 2009 at 2:51 PM, Ross ros...@gmail.com wrote: I'm inexperienced with some of the fancy list slicing syntaxes where python shines. If I have a list of tuples:   k=[(a, bob, c), (p, joe, d), (x, mary, z)] and I want to pull the middle element out of each tuple to make a new

Re: unpacking vars from list of tuples

2009-09-15 Thread Andre Engels
On Tue, Sep 15, 2009 at 11:51 PM, Ross ros...@gmail.com wrote: I'm inexperienced with some of the fancy list slicing syntaxes where python shines. If I have a list of tuples:   k=[(a, bob, c), (p, joe, d), (x, mary, z)] and I want to pull the middle element out of each tuple to make a new

Re: unpacking vars from list of tuples

2009-09-15 Thread Wolfram Hinderer
On 15 Sep., 23:51, Ross ros...@gmail.com wrote: If I have a list of tuples:    k=[(a, bob, c), (p, joe, d), (x, mary, z)] and I want to pull the middle element out of each tuple to make a new list: myList = [bob, joe, mary] if a tuple is OK: zip(*k)[1] --

Re: Why use locals()

2009-09-15 Thread Carl Banks
On Sep 15, 11:41 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Tue, 15 Sep 2009 11:18:35 -0300, Sion Arrowsmith   s...@viridian.paintbox escribió: Sean DiZazzo  half.ital...@gmail.com wrote: What I'm not clear about is under what circumstances locals() does not produce the same

Re: unpacking vars from list of tuples

2009-09-15 Thread Tim Chase
If I have a list of tuples: k=[(a, bob, c), (p, joe, d), (x, mary, z)] and I want to pull the middle element out of each tuple to make a new list: myList = [bob, joe, mary] is there some compact way to do that? I can imagine the obvious one of myList = [] for a in k:

Re: unpacking vars from list of tuples

2009-09-15 Thread Ross
On Sep 15, 6:00 pm, Andre Engels andreeng...@gmail.com wrote: On Tue, Sep 15, 2009 at 11:51 PM, Ross ros...@gmail.com wrote: I'm inexperienced with some of the fancy list slicing syntaxes where python shines. If I have a list of tuples:   k=[(a, bob, c), (p, joe, d), (x, mary, z)]

Re: VTK install

2009-09-15 Thread Gib
On Sep 16, 12:28 am, Francesco Bochicchio bieff...@gmail.com wrote: On Sep 15, 6:29 am, Gib gib.bo...@gmail.com wrote: As part of the MayaVi install, I need to install VTK.   ... Since VTK appears to be installed, I'm guessing that either the path setting is wrong, or python is not

Re: MayaVi install

2009-09-15 Thread Gib
On Sep 16, 3:45 am, Robert Kern robert.k...@gmail.com wrote: On 2009-09-14 23:07 PM, Gib wrote: I am trying to follow the instructions for installing MayaVi  given on the Enthought site: http://code.enthought.com/projects/mayavi/docs/development/html/mayav... I'm following the

Re: Looking for a pure Python chart drawing module

2009-09-15 Thread Ethan Furman
John Nagle wrote: http://home.gna.org/pychart/doc/introduction.html Tried PyChart. Set up for PNG file format. Got the error Exception: Ghostscript not found.This thing just creates PostScript, then pumps it through GhostScript (anybody remember that?) to get other formats. And does

Re: Application Packages

2009-09-15 Thread Diez B. Roggisch
Dj Gilcrease schrieb: Say I have an application that lives in /usr/local/myapp it comes with some default plugins that live in /usr/local/myapp/plugins and I allow users to have plugins that would live in ~/myapp/plugins Is there a way to map ~/myapp to a user package so I could do from

Re: LinkedIn Messages, 9/15/2009

2009-09-15 Thread Rhodri James
On Tue, 15 Sep 2009 14:39:04 +0100, LinkedIn Communication communicat...@linkedin.com wrote: LinkedIn [snippety snip] Methinks the spam filter needs updating. -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Remove empty strings from list

2009-09-15 Thread Rhodri James
On Tue, 15 Sep 2009 02:55:13 +0100, Chris Rebert c...@rebertia.com wrote: On Mon, Sep 14, 2009 at 6:49 PM, Helvin helvin...@gmail.com wrote: Hi, Sorry I did not want to bother the group, but I really do not understand this seeming trivial problem. I am reading from a textfile, where each line

Fwd: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Russell Jackson
Hi, I have the following code that works fine in Python 2.x, but I can't seem to get it to work in Python 3 with Popen. Can you please tell me how to get the same functionality out of Python 3? The gist of what I doing is in the setpassword function. I have tried numerous ways to get this to work,

Re: subprocess woes

2009-09-15 Thread kj
In d87065db-f51f-4afe-924c-f9e4a1eb0...@g23g2000vbr.googlegroups.com Mike Driscoll kyoso...@gmail.com writes: On Sep 15, 2:26=A0pm, kj no.em...@please.post wrote: I'm trying to write a function, sort_data, that takes as argument the path to a file, and sorts it in place, leaving the last

Re: subprocess woes

2009-09-15 Thread kj
Upon re-reading my post I realize that I left out some important details. In h8oppp$qo...@reader1.panix.com kj no.em...@please.post writes: I'm trying to write a function, sort_data, that takes as argument the path to a file, and sorts it in place, leaving the last sentinel line in its

Re: Fwd: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Rhodri James
On Wed, 16 Sep 2009 00:01:17 +0100, Russell Jackson ru...@rcjacksonconsulting.com wrote: Hi, I have the following code that works fine in Python 2.x, but I can't seem to get it to work in Python 3 with Popen. Can you please tell me how to get the same functionality out of Python 3? The

multiproccess: What is the Dameon flag?

2009-09-15 Thread Allen Fowler
Hello, What is the Daemon flag and when/why would I want to use it? Thank you, AF -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess woes

2009-09-15 Thread Chris Rebert
On Tue, Sep 15, 2009 at 12:26 PM, kj no.em...@please.post wrote: I'm trying to write a function, sort_data, that takes as argument the path to a file, and sorts it in place, leaving the last sentinel line in its original position (i.e. at the end).  Here's what I have (omitting most

Re: Looking for a pure Python chart drawing module

2009-09-15 Thread gerlos
John Nagle ha scritto: I'm looking for something that can draw simple bar and pie charts in Python. I'm trying to find a Python package, not a wrapper for some C library, as this has to run on both Windows and Linux and version clashes are a problem. Did you look at matplotlib? In their

Re: Retrieve url's of all jpegs at a web page URL

2009-09-15 Thread Chris Rebert
On Tue, Sep 15, 2009 at 7:28 AM, grimmus graham.col...@gmail.com wrote: Hi, I would like to achieve something like Facebook has when you post a link. It shows images located at the URL you entered so you can choose what one to display as a summary. I was thinking i could loop through the

Re: subprocess woes

2009-09-15 Thread kj
In mailman.1498.1253057406.2854.python-l...@python.org Chris Rebert c...@rebertia.com writes: On Tue, Sep 15, 2009 at 12:26 PM, kj no.em...@please.post wrote: I'm trying to write a function, sort_data, that takes as argument the path to a file, and sorts it in place, leaving the last sentinel

Re: Fwd: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Russell Jackson
I just get an errorlevel from the executable when I read stdout, but I can't tell what is going on because, of course, I can't tell what Popen is actually doing. I never see the prompt from the executable that I would expect to see when I read stdout. I originally had the function like this: def

Re: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Chris Rebert
On Tue, Sep 15, 2009 at 4:01 PM, Russell Jackson ru...@rcjacksonconsulting.com wrote: snip Attempted code in Python 3: (Doesn't work either) snip         cmd = ' passwd {0}'.format(user)         pipe = Popen(p4 + cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, universal_newlines=True)

socket.MSG_WAITALL flag broken on Windows XP in Python 2.5.4?

2009-09-15 Thread Wes McKinney
I noticed the flag socket.MSG_WAITALL seems to have crept its way into Python 2.5 on Windows (it's in 2.5.4, but not in 2.5.1, not sure about intermediate releases). I do not think Windows supports it. It seems to cause some problems in some libraries (like Pyro) that use it if it's available in

Re: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Chris Rebert
On Tue, Sep 15, 2009 at 5:07 PM, Chris Rebert c...@rebertia.com wrote: On Tue, Sep 15, 2009 at 4:01 PM, Russell Jackson ru...@rcjacksonconsulting.com wrote: snip Attempted code in Python 3: (Doesn't work either) snip         cmd = ' passwd {0}'.format(user)         pipe = Popen(p4 + cmd,

Re: multiproccess: What is the Dameon flag?

2009-09-15 Thread MRAB
Allen Fowler wrote: Hello, What is the Daemon flag and when/why would I want to use it? From the documentation: When a process exits, it attempts to terminate all of its daemonic child processes.. Sometimes you want the main process to wait for its worker processes to terminate before

Re: Application Packages

2009-09-15 Thread Dj Gilcrease
when looking up namespace-packages I found pkgutil which lets me add a myapp.user package with the following in its __init__.py and nothing else import os, os.path from pkgutil import extend_path homedir = os.environ.get('HOME') or os.environ.get('USERPROFILE') __path__ =

  1   2   >