[ANN] PyTables 2.1.1 released

2009-03-13 Thread Francesc Alted
=== Announcing PyTables 2.1.1 === PyTables is a library for managing hierarchical datasets and designed to efficiently cope with extremely large amounts of data with support for full 64-bit file addressing. PyTables runs on top of the HDF5 library

ANN: Urwid 0.9.8.4 - Console UI Library

2009-03-13 Thread Ian Ward
Announcing Urwid 0.9.8.4 Urwid home page: http://excess.org/urwid/ Tarball: http://excess.org/urwid/urwid-0.9.8.4.tar.gz RSS: http://excess.org/feeds/tag/urwid/ About this release: === This is a maintenance release that adds compatibility with

ANN: AsciiDoc 8.4.1 released

2009-03-13 Thread Stuart Rackham
This release introduces the new Python API for AsciiDoc (http://www.methods.co.nz/asciidoc/asciidocapi.html). All additions and changes are detailed in the changelog: http://www.methods.co.nz/asciidoc/CHANGELOG.html What is it? --- AsciiDoc is an uncomplicated text document format for

Roundup Issue Tracker release 1.4.7

2009-03-13 Thread Richard Jones
I'm proud to release version 1.4.7 of Roundup. 1.4.7 is primarily a bugfix release which contains important security fixes: - a number of security issues were discovered by Daniel Diniz - EditCSV and ExportCSV altered to include permission checks - HTTP POST required on actions which alter data

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-13 Thread Lie Ryan
Hendrik van Rooyen wrote: Ulrich Eckhardt eck...aser.com wrote: IOW, why not explicitly say what you want using keyword arguments with defaults instead of inventing an IMHO cryptic, read-only mini-language? Seriously, the problem I see with this proposal is that its aim to be as short as

Re: import not working?

2009-03-13 Thread Lie Ryan
Scott David Daniels wrote: Aahz wrote: In article mailman.605.1235434737.11746.python-l...@python.org, Rhodri James rho...@wildebst.demon.co.uk wrote: ... sys.path.append(C:\\DataFileTypes) My preference: sys.path.append(rC:\DataFileTypes) This doesn't work if you need to add a trailing

Re: urllib2.URLError: urlopen error unknown url type: http

2009-03-13 Thread Coonay
i update via http proxy cmdset HTTP_PROXY=http://cache.mycompany.com:3128 cmdpython appcfg.py update myapp URLError: urlopen error [Errno 10061] No connection could be made because the t arget machine actively refused it Traceback (most recent call last): File C:\Program

Re: __import__ with dict values

2009-03-13 Thread Lie Ryan
Gabriel Genellina wrote: En Thu, 12 Mar 2009 09:27:35 -0200, alex goretoy aleksandr.gore...@gmail.com escribió: note i would still like to be able to do __import__(sys).path p = __import__(sys).path That's a convoluted way of doing: import sys p = sys.path (except that the latter one

Re: A Dangling Tk Entry

2009-03-13 Thread Rhodri James
On Thu, 12 Mar 2009 04:34:57 -, W. eWatson notval...@sbcglobal.net wrote: I happened to notice that BJ and Rhondi started a small subthread to Nice to know your observation skills are up to scratch :-( this, so I thought I'd explore it. It led to interesting things, but not for its

converting a string to a function parameter

2009-03-13 Thread koranthala
Hi, Is it possible to convert a string to a function parameter? Ex: str = 'True, type=rect, sizes=[3, 4]' and I should be able to use it as: test(convert(str)) and the behaviour should be same as calling test with those values : i.e. test(True, type=rect, sizes=[3, 4]) I tried eval, but it

Re: converting a string to a function parameter

2009-03-13 Thread Chris Rebert
On Fri, Mar 13, 2009 at 12:52 AM, koranthala koranth...@gmail.com wrote: Hi,    Is it possible to convert a string to a function parameter? Ex: str = 'True, type=rect, sizes=[3, 4]' and I should be able to use it as: test(convert(str)) and the behaviour should be same as calling test with

Re: converting a string to a function parameter

2009-03-13 Thread koranthala
On Mar 13, 1:01 pm, Chris Rebert c...@rebertia.com wrote: On Fri, Mar 13, 2009 at 12:52 AM, koranthala koranth...@gmail.com wrote: Hi,    Is it possible to convert a string to a function parameter? Ex: str = 'True, type=rect, sizes=[3, 4]' and I should be able to use it as:

Re: cross platform accessing paths (windows, linux ...)

2009-03-13 Thread Vlastimil Brom
2009/3/13 hendra kusuma penguinr...@gmail.com: you may want to use os.sep to replace manually written / \ : for each os I heard that unix/linux use / as directory separator while windows use \ and mac os use : Thanks for the notice about the : path separator on mac; windows uses \ but

Re: Raw String Question

2009-03-13 Thread andrew cooke
MRAB wrote: andrew cooke wrote: MRAB wrote: [...] The other special case is with \u in a Unicode string: ur\u0041 u'A' this isn't true for 3.0: r\u0041 '\\u0041' (there's no u because it's a string, not a bytes literal) and as far as i can tell, that's correct behaviour according

VMware and pywin32 error...

2009-03-13 Thread dash
Hallo, has anyone experience with installing Python and pywin32 to Windows XP Pro running in a VMware environment? At the end of installing pywin32 I get following error: Traceback (most recent call last): File string,

issue - not able to connect to python com server

2009-03-13 Thread Madhubala
Hi , I have an issue regarding connectivity between client and com server. I have a com server implemented in MFC dll having MFC as static library. The requirement is to write python wrapper to it . Using ctypes I wrote a wrapper to MFC dll which exports couple of functions for com

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-13 Thread Raymond Hettinger
[Lie Ryan] A hyphotetical code using conv function and the microlanguage could look like this:   num = 213210.3242   fmt = create_format(sep='-', decsep='@')   print fmt 50|\/|3_v3ry_R34D4|3L3_C0D3   '{0!{1}}'.format(num, fmt) '213-...@3242' LOL, it's like APL all over again ;-) FWIW,

Re: unbiased benchmark

2009-03-13 Thread Martin P. Hellwig
Lie Ryan wrote: cut But ruby don't bite... cut Neither does a python, it is a constrictor, meaning it has a firm grip on the modules imported :-) -- mph -- http://mail.python.org/mailman/listinfo/python-list

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-13 Thread andrew cooke
Raymond Hettinger wrote: [Lie Ryan] A hyphotetical code using conv function and the microlanguage could look like this:   num = 213210.3242   fmt = create_format(sep='-', decsep='@')   print fmt 50|\/|3_v3ry_R34D4|3L3_C0D3   '{0!{1}}'.format(num, fmt) '213-...@3242' LOL, it's like APL

Re: Python/Django forum-building software Snap/SCT, any reviews?

2009-03-13 Thread Bruno Desthuilliers
John Crawford a écrit : I'm looking for good open-source software for forums. There is a *lot* out there, for instance Lussumo's Vanilla gets good reviews, but most are PHP-based, and I would obviously prefer to use Python, with or without Django. Two packages that are Django-based that I

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-13 Thread Paul Rubin
Raymond Hettinger pyt...@rcn.com writes: The proposal is roughly: If you want commas in the output, put a comma in the format string. It's not rocket science. What if you want to change the separator? Europeans usually use periods instead of commas: one thousand = 1.000. --

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-13 Thread Raymond Hettinger
[andrew cooke] would it break anything to also allow format(1234567, 'd')       # what we have now  '1234567' format(1234567, '.d')      # proposed new option  '1.234.567' format(1234.5, ',2f')      # proposed new option  '1234,50' format(1234.5, '.,2f')     # proposed new option

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-13 Thread Raymond Hettinger
[Paul Rubin] What if you want to change the separator?  Europeans usually use periods instead of commas: one thousand = 1.000. That is supported also. -- http://mail.python.org/mailman/listinfo/python-list

disabling compiler flags in distutils

2009-03-13 Thread Christian Meesters
Hoi, I've written an extension in C++ which compiles wonderfully. However, I want to compile it using a setup script with distutils and distutils gives the compiler the unwanted (!) flag -Wstrict-prototypes, which is a flag only understood when compiling C. The C++ compiler runs, but issues a

Re: Install NumPy in python 2.6

2009-03-13 Thread David Cournapeau
On Fri, Mar 13, 2009 at 8:20 PM, gopal mishra gop...@infotechsw.com wrote: error: Setup script exited with error: None numpy 1.2.1 does not officially support python 2.6. Specially on windows, there are some issues like this one. Numpy 1.3.0 (to be released 1st April 2009) will contain

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-13 Thread Tim Rowe
2009/3/12 Raymond Hettinger pyt...@rcn.com: If anyone here is interested, here is a proposal I posted on the python-ideas list. The idea is to make numbering formatting a little easier with the new format() builtin in Py2.6 and Py3.0:  http://docs.python.org/library/string.html#formatspec

Install NumPy in python 2.6

2009-03-13 Thread gopal mishra
Hi, I am trying to install SciPy and NumPy in Python 2.6 (OS - Win XP). http://downloads.sourceforge.net/numpy/numpy-1.2.1.tar.gz http://downloads.sourceforge.net/scipy/scipy-0.7.0.tar.gz While installing numpy It gives following installation error. Running from numpy source directory.

Re: import not working?

2009-03-13 Thread Steve Holden
Lie Ryan wrote: Scott David Daniels wrote: Aahz wrote: In article mailman.605.1235434737.11746.python-l...@python.org, Rhodri James rho...@wildebst.demon.co.uk wrote: ... sys.path.append(C:\\DataFileTypes) My preference: sys.path.append(rC:\DataFileTypes) This doesn't work if you need to

Plugin based feature adding to web-application

2009-03-13 Thread Ravi Kumar
I need an architecture in a project using Django and Python + MySQL, so that when I put a python script in specified directory, that should be loaded and its methods/functions can be used. As far as i have thought on this, I am going to scan that particular directory, list out the files, import

+1 QOTW...

2009-03-13 Thread skip
From the PSF board candidates statements: Tim Peters == While my efforts to get the PSF recognized as a bank holding company (and so qualify for billions of dollars in US TARP aid) haven't yet succeeded, I'm apparently the only director who even thought about it --

Re: What happened to NASA at Python? :(

2009-03-13 Thread skip
I would have thought someone would have noticed by now. Am I the only person who uses Windows? Apparently just you and the guy who built the distribution. wink Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: default shelve on linux corrupts, does different DB system help?

2009-03-13 Thread skip
Paul I have the problem that my shelve(s) sometimes corrupt (looks like Paul it has after python has run out of threads). Paul I am using the default shelve so on linux I get the dbhash Paul version. Is there a different DB type I can choose that is known Paul to be more

Re: Python/Django forum-building software Snap/SCT, any reviews?

2009-03-13 Thread Adrian Cherry
John Crawford cycl...@speakeasy.net wrote in news:newztoolz_rulz!_www.techsono.com_3319721838_653...@speakea sy.net: Two packages that are Django-based that I have found, are Snap and SCT. They both look pretty good (and Snap was influenced by Vanilla). Does anyone have any experience with

Re: Plugin based feature adding to web-application

2009-03-13 Thread limodou
On Fri, Mar 13, 2009 at 8:31 PM, Ravi Kumar ra2...@gmail.com wrote: I need an architecture in a project using Django and Python + MySQL, so that when I put a python script in specified directory, that should be loaded and its methods/functions can be used. As far as i have thought on this, I

Re: cross platform accessing paths (windows, linux ...)

2009-03-13 Thread David Smith
Vlastimil Brom wrote: 2009/3/13 hendra kusuma penguinr...@gmail.com: you may want to use os.sep to replace manually written / \ : for each os I heard that unix/linux use / as directory separator while windows use \ and mac os use : Thanks for the notice about the : path separator on mac;

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-13 Thread Wolfgang Rohdewald
On Freitag, 13. März 2009, Raymond Hettinger wrote: [Paul Rubin] What if you want to change the separator? Europeans usually use periods instead of commas: one thousand = 1.000. That is supported also. do you support just a fixed set of separators or anything? how about this:

Encoding/decoding: Still don't get it :-/

2009-03-13 Thread Gilles Ganault
Hello I must be dense, but I still don't understand 1) why Python sometimes barfs out this type of error when displaying text that might not be Unicode-encoded, 2) whether I should use encode() or decode() to solve the issue, or even 3) if this is a Python issue or due to APWS SQLite wrapper that

Re: converting a string to a function parameter

2009-03-13 Thread odeits
On Mar 13, 12:52 am, koranthala koranth...@gmail.com wrote: Hi,     Is it possible to convert a string to a function parameter? Ex: str = 'True, type=rect, sizes=[3, 4]' and I should be able to use it as: test(convert(str)) and the behaviour should be same as calling test with those values

Re: Encoding/decoding: Still don't get it :-/

2009-03-13 Thread Peter Otten
Gilles Ganault wrote: I must be dense, but I still don't understand 1) why Python sometimes barfs out this type of error when displaying text that might not be Unicode-encoded, 2) whether I should use encode() or decode() to solve the issue, or even 3) if this is a Python issue or due to APWS

Re: Input data from .txt file and object array problem

2009-03-13 Thread odeits
On Mar 12, 9:02 am, SamuelXiao foolsmart2...@gmail.com wrote: On Mar 12, 11:17 pm, Piet van Oostrum p...@cs.uu.nl wrote: SamuelXiao foolsmart2...@gmail.com (S) wrote: S I want to input data by using pickle S First of all, I have a database.txt S The content is like: S AAA,aaalink

Re: Raw String Question

2009-03-13 Thread MRAB
andrew cooke wrote: MRAB wrote: andrew cooke wrote: MRAB wrote: [...] The other special case is with \u in a Unicode string: ur\u0041 u'A' this isn't true for 3.0: r\u0041 '\\u0041' (there's no u because it's a string, not a bytes literal) and as far as i can tell, that's correct

Special keyword argument lambda syntax

2009-03-13 Thread Beni Cherniavsky
This proposal (a) ignores Guido's clear-cut decision that lambda is good as it is, (b) is weird in proposing a special-case syntax, (c) is several Python versions too late for a graceful transition by 3.0. But I don't won't to just throw the idea away, so I'm posting here. If there is serious

Python competition ROUND #1

2009-03-13 Thread vedrandekovic
Hello, (Competition language: English) First round of Python competition at Python Evaluator will be next Saturday at 17:00 ( UTC ). If you want to register: http://evaluator.vdekovic.net/index.php?select=register.php Rules: http://evaluator.vdekovic.net/index.php?select=rules.php

Re: Special keyword argument lambda syntax

2009-03-13 Thread Rhodri James
On Fri, 13 Mar 2009 14:49:17 -, Beni Cherniavsky beni.cherniav...@gmail.com wrote: Specification = Allow keyword arguments in function call to take this form: NAME ( ARGUMENTS ) = EXPRESSION which is equivallent to the following: NAME = lambda ARGUMENTS:

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-13 Thread pruebauno
On Mar 13, 7:06 am, Tim Rowe digi...@gmail.com wrote: 2009/3/12 Raymond Hettinger pyt...@rcn.com: If anyone here is interested, here is a proposal I posted on the python-ideas list. The idea is to make numbering formatting a little easier with the new format() builtin in Py2.6 and

Re: Raw String Question

2009-03-13 Thread Lie Ryan
MRAB wrote: In Python 3.x a backslash doesn't have a special meaning in a raw string, except that it can prevent a following quote from ending the string, but the backslash is still included. Why? How useful is that? I think it would've been simpler if a backslash had _no_ special effect, not

Re: Special keyword argument lambda syntax

2009-03-13 Thread MRAB
Rhodri James wrote: On Fri, 13 Mar 2009 14:49:17 -, Beni Cherniavsky beni.cherniav...@gmail.com wrote: Specification = Allow keyword arguments in function call to take this form: NAME ( ARGUMENTS ) = EXPRESSION which is equivallent to the following: NAME = lambda

Memory efficient tuple storage

2009-03-13 Thread psaff...@googlemail.com
I'm reading in some rather large files (28 files each of 130MB). Each file is a genome coordinate (chromosome (string) and position (int)) and a data point (float). I want to read these into a list of coordinates (each a tuple of (chromosome, position)) and a list of data points. This has taught

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-13 Thread Tim Rowe
2009/3/13 prueba...@latinmail.com: I think this proposal is more for debugging big numbers and meant mostly for programmers' eyes. We are already using the dot instead of comma decimal separator in our programming languages that one more Americanism won't kill us. If it were for the

Re: converting a string to a function parameter

2009-03-13 Thread Scott David Daniels
koranthala wrote: Hi, Is it possible to convert a string to a function parameter? Ex: str = 'True, type=rect, sizes=[3, 4]' and I should be able to use it as: test(convert(str)) and the behaviour should be same as calling test with those values : i.e. test(True, type=rect, sizes=[3, 4]) I

Re: import not working?

2009-03-13 Thread Lie Ryan
Steve Holden wrote: Lie Ryan wrote: Scott David Daniels wrote: Aahz wrote: In article mailman.605.1235434737.11746.python-l...@python.org, Rhodri James rho...@wildebst.demon.co.uk wrote: ... sys.path.append(C:\\DataFileTypes) My preference: sys.path.append(rC:\DataFileTypes) This doesn't

Re: Memory efficient tuple storage

2009-03-13 Thread Kurt Smith
On Fri, Mar 13, 2009 at 10:59 AM, psaff...@googlemail.com psaff...@googlemail.com wrote: I'm reading in some rather large files (28 files each of 130MB). Each file is a genome coordinate (chromosome (string) and position (int)) and a data point (float). I want to read these into a list of

Re: Special keyword argument lambda syntax

2009-03-13 Thread Scott David Daniels
Rhodri James wrote: On Fri, 13 Mar 2009 14:49:17 -, Beni Cherniavsky beni.cherniav...@gmail.com wrote: ...Allow keyword arguments in function call to take this form: NAME ( ARGUMENTS ) = EXPRESSION which is equivallent to the following: NAME = lambda ARGUMENTS: EXPRESSION except

Re: Memory efficient tuple storage

2009-03-13 Thread Tim Wintle
On Fri, 2009-03-13 at 08:59 -0700, psaff...@googlemail.com wrote: I'm reading in some rather large files (28 files each of 130MB). Each file is a genome coordinate (chromosome (string) and position (int)) and a data point (float). I want to read these into a list of coordinates (each a tuple

Re: converting a string to a function parameter

2009-03-13 Thread Aaron Brady
On Mar 13, 2:52 am, koranthala koranth...@gmail.com wrote: Hi,     Is it possible to convert a string to a function parameter? Ex: str = 'True, type=rect, sizes=[3, 4]' and I should be able to use it as: test(convert(str)) and the behaviour should be same as calling test with those values :

An ordering question

2009-03-13 Thread Kottiyath
Hi, I have 2 lists a = [(4, 1), (7, 3), (3, 2), (2, 4)] b = [2, 4, 1, 3] Now, I want to order _a_ (a[1]) based on _b_. i.e. the second element in tuple should be the same as b. i.e. Output would be [(3, 2), (2, 4), (4, 1), (7, 3)] I did the same as follows: l = len(a) *

c++ extension, problem passing argument

2009-03-13 Thread Matteo
Hi all, I wrote a few c++ classes for some data analysis on a physics esperiment. Now I want to glue the lot with Python, so I built the necessary wrap code with SWIG and compiled the library with Distutils. All is fine, I can import the module and classes work as expected... ...but for one

Re: Special keyword argument lambda syntax

2009-03-13 Thread Hrvoje Niksic
MRAB goo...@mrabarnett.plus.com writes: sorted(range(9), def key(n): n % 3) [0, 3, 6, 1, 4, 7, 2, 5, 8] Given the recent pattern of syntactic constructs for expressions using expr keyword expr (ternary if, listcomps, genexps), and avoiding the use of colon in expressions, maybe it should be:

Re: Memory efficient tuple storage

2009-03-13 Thread Kurt Smith
On Fri, Mar 13, 2009 at 11:33 AM, Kurt Smith kwmsm...@gmail.com wrote: [snip OP] Assuming your data is in a plaintext file something like 'genomedata.txt' below, the following will load it into a numpy array with a customized dtype.  You can access the different fields by name ('chromo',

Re: c++ extension, problem passing argument

2009-03-13 Thread Aaron Brady
On Mar 13, 12:03 pm, Matteo tadweles...@gmail.com wrote: Hi all, I wrote a few c++ classes for some data analysis on a physics esperiment. Now I want to glue the lot with Python, so I built the necessary wrap code with SWIG and compiled the library with Distutils. All is fine, I can import

Re: An ordering question

2009-03-13 Thread MRAB
Kottiyath wrote: Hi, I have 2 lists a = [(4, 1), (7, 3), (3, 2), (2, 4)] b = [2, 4, 1, 3] Now, I want to order _a_ (a[1]) based on _b_. i.e. the second element in tuple should be the same as b. i.e. Output would be [(3, 2), (2, 4), (4, 1), (7, 3)] I did the same as follows:

Re: Memory efficient tuple storage

2009-03-13 Thread Tim Chase
While Kurt gave some excellent ideas for using numpy, there were some missing details in your original post that might help folks come up with a work smarter, not harder solution. Clearly, you're not loading it into memory just for giggles -- surely you're *doing* something with it once it's

Re: Special keyword argument lambda syntax

2009-03-13 Thread MRAB
Hrvoje Niksic wrote: MRAB goo...@mrabarnett.plus.com writes: sorted(range(9), def key(n): n % 3) [0, 3, 6, 1, 4, 7, 2, 5, 8] Given the recent pattern of syntactic constructs for expressions using expr keyword expr (ternary if, listcomps, genexps), and avoiding the use of colon in

Re: An ordering question

2009-03-13 Thread MRAB
MRAB wrote: Kottiyath wrote: Hi, I have 2 lists a = [(4, 1), (7, 3), (3, 2), (2, 4)] b = [2, 4, 1, 3] Now, I want to order _a_ (a[1]) based on _b_. i.e. the second element in tuple should be the same as b. i.e. Output would be [(3, 2), (2, 4), (4, 1), (7, 3)] I did the

Re: c++ extension, problem passing argument

2009-03-13 Thread Matteo
On 13 Mar, 18:19, Aaron Brady castiro...@gmail.com wrote: On Mar 13, 12:03 pm, Matteo tadweles...@gmail.com wrote: Hi all, I wrote a few c++ classes for some data analysis on a physics esperiment. Now I want to glue the lot with Python, so I built the necessary wrap code with SWIG and

Re: An ordering question

2009-03-13 Thread Hrvoje Niksic
Kottiyath n.kottiy...@gmail.com writes: Hi, I have 2 lists a = [(4, 1), (7, 3), (3, 2), (2, 4)] b = [2, 4, 1, 3] Now, I want to order _a_ (a[1]) based on _b_. i.e. the second element in tuple should be the same as b. i.e. Output would be [(3, 2), (2, 4), (4, 1), (7, 3)]

Re:

2009-03-13 Thread John Posner
I have 2 lists a = [(4, 1), (7, 3), (3, 2), (2, 4)] b = [2, 4, 1, 3] Now, I want to order _a_ (a[1]) based on _b_. i.e. the second element in tuple should be the same as b. i.e. Output would be [(3, 2), (2, 4), (4, 1), (7, 3)] I did the same as follows: l =

Re: Memory efficient tuple storage

2009-03-13 Thread psaff...@googlemail.com
Thanks for all the replies. First of all, can anybody recommend a good way to show memory usage? I tried heapy, but couldn't make much sense of the output and it didn't seem to change too much for different usages. Maybe I was just making the h.heap() call in the wrong place. I also tried

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-13 Thread Lie Ryan
Raymond Hettinger wrote: [andrew cooke] would it break anything to also allow format(1234567, 'd') # what we have now '1234567' format(1234567, '.d') # proposed new option '1.234.567' format(1234.5, ',2f') # proposed new option '1234,50' format(1234.5, '.,2f') #

Re: Memory efficient tuple storage

2009-03-13 Thread Benjamin Peterson
psaffrey at googlemail.com psaffrey at googlemail.com writes: First of all, can anybody recommend a good way to show memory usage? Python 2.6 has a function called sys.getsizeof(). -- http://mail.python.org/mailman/listinfo/python-list

Re: An ordering question

2009-03-13 Thread andrew cooke
Hrvoje Niksic wrote: Kottiyath n.kottiy...@gmail.com writes: Hi, I have 2 lists a = [(4, 1), (7, 3), (3, 2), (2, 4)] b = [2, 4, 1, 3] Now, I want to order _a_ (a[1]) based on _b_. i.e. the second element in tuple should be the same as b. i.e. Output would be [(3, 2), (2,

Re: c++ extension, problem passing argument

2009-03-13 Thread Matteo
hmmm... looks like SWIG has a problem with double pointers. I googled around a bit and found: http://osdir.com/ml/programming.swig/2003-02/msg00029.html anyone knows how to write a small wrapper to do the appropriate dereferencing? -- http://mail.python.org/mailman/listinfo/python-list

Re: An ordering question

2009-03-13 Thread andrew cooke
MRAB wrote: a = [(4, 1), (7, 3), (3, 2), (2, 4)] b = [2, 4, 1, 3] d = dict((v, k) for k, v in a) c = [(d[s], s) for s in b] c [(3, 2), (2, 4), (4, 1), (7, 3)] ah, that is more efficient than the suggestions i posted. andrew -- http://mail.python.org/mailman/listinfo/python-list

Re: Special keyword argument lambda syntax

2009-03-13 Thread bearophileHUGS
MRAB:   sorted(range(9), def key(n): n % 3) I am fine with the current lambda syntax, but another possibility: sorted(range(9), n = n % 3) Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: import not working?

2009-03-13 Thread Gabriel Genellina
En Fri, 13 Mar 2009 14:27:27 -0200, Lie Ryan lie.1...@gmail.com escribió: Steve Holden wrote: Lie Ryan wrote: Scott David Daniels wrote: Aahz wrote: In article mailman.605.1235434737.11746.python-l...@python.org, Rhodri James rho...@wildebst.demon.co.uk wrote: ...

Re: Memory efficient tuple storage

2009-03-13 Thread Gabriel Genellina
En Fri, 13 Mar 2009 14:49:51 -0200, Tim Wintle tim.win...@teamrubber.com escribió: If the same chromosome string is being used multiple times then you may find it more efficient to reference the same string, so you don't need to have multiple copies of the same string in memory. That may be

Re: __import__ with dict values

2009-03-13 Thread alex goretoy
wow, ok, thank you Gabriel, I wasn't aware of x,'y',z This is what I decided to go with for now in one of my classes, but another class will need a modified version of this, as mentioned x,'y',z B=_brush() list( ( self.__setattr__(x.replace(b_,),getattr(B,x)) for x in dir(B) if

Re:

2009-03-13 Thread Miles
On Fri, Mar 13, 2009 at 2:12 PM, John Posner wrote:     I have 2 lists a = [(4, 1), (7, 3), (3, 2), (2, 4)] b = [2, 4, 1, 3]     Now, I want to order _a_ (a[1]) based on _b_.     i.e. the second element in tuple should be the same as b.     i.e. Output would be [(3, 2), (2, 4), (4, 1),

Re:

2009-03-13 Thread Miles
On Fri, Mar 13, 2009 at 3:13 PM, Miles wrote: [snip] Sorry, didn't see the original thread on this. -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: __import__ with dict values

2009-03-13 Thread Gabriel Genellina
En Fri, 13 Mar 2009 17:12:49 -0200, alex goretoy aleksandr.gore...@gmail.com escribió: wow, ok, thank you Gabriel, I wasn't aware of x,'y',z This is what I decided to go with for now in one of my classes, but another class will need a modified version of this, as mentioned x,'y',z

Re: An ordering question

2009-03-13 Thread Hrvoje Niksic
andrew cooke and...@acooke.org writes: Hrvoje Niksic wrote: Kottiyath n.kottiy...@gmail.com writes: Hi, I have 2 lists a = [(4, 1), (7, 3), (3, 2), (2, 4)] b = [2, 4, 1, 3] Now, I want to order _a_ (a[1]) based on _b_. i.e. the second element in tuple should be the same as

Re: import not working?

2009-03-13 Thread Christian Heimes
Scott David Daniels wrote: Aahz wrote: In article mailman.605.1235434737.11746.python-l...@python.org, Rhodri James rho...@wildebst.demon.co.uk wrote: ... sys.path.append(C:\\DataFileTypes) My preference: sys.path.append(rC:\DataFileTypes) This doesn't work if you need to add a trailing

Re: VMware and pywin32 error...

2009-03-13 Thread Joshua Kugler
dot wrote: has anyone experience with installing Python and pywin32 to Windows XP Pro running in a VMware environment? At the end of installing pywin32 I get following error: Traceback (most recent call last):

Re: PythonWin, python thread and PostQuitMessage?

2009-03-13 Thread aloonstra
On 12 mrt, 18:43, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Thu, 12 Mar 2009 07:21:35 -0200, arn...@sphaero.org escribió: I'm not so much involved in any Windows programming however I needed to write a client for the Windows platform. I have this very simple question which I've

Quadratic equation

2009-03-13 Thread Daniel Sidorowicz
Hello I need some hello I need some help with a programingproject, I'm fairly new to programming so I do find it slightly confusing. Here is my code for my main function which passes my variable from a text file, however when i run it I get the error code: import math import quadroot def

Re: Quadratic equation

2009-03-13 Thread Benjamin Kaplan
On Fri, Mar 13, 2009 at 4:06 PM, Daniel Sidorowicz dsi1...@gmail.comwrote: Hello I need some hello I need some help with a programingproject, I'm fairly new to programming so I do find it slightly confusing. Here is my code for my main function which passes my variable from a text file,

Re: c++ extension, problem passing argument

2009-03-13 Thread bobicanprogram
On Mar 13, 1:34 pm, Matteo tadweles...@gmail.com wrote: hmmm... looks like SWIG has a problem with double pointers. I googled around a bit and found: http://osdir.com/ml/programming.swig/2003-02/msg00029.html anyone knows how to write a small wrapper to do the appropriate dereferencing?

Re: Memory efficient tuple storage

2009-03-13 Thread Kurt Smith
On Fri, Mar 13, 2009 at 1:13 PM, psaff...@googlemail.com psaff...@googlemail.com wrote: Thanks for all the replies. [snip] The numpy solution does work, but it uses more than 1GB of memory for one of my 130MB files. I'm using np.dtype({'names': ['chromo', 'position', 'dpoint'], 'formats':

Re: An ordering question

2009-03-13 Thread John Posner
If you don't want to build the intermediary dict, a less efficient version that runs in O(n^2): a.sort(key=lambda k: b.index(k[1])) Which is mostly similar to John's solution, but still more efficient because it only does a b.index call once per 'a' item instead of twice per

setup.py install and bdist_egg

2009-03-13 Thread Jasiu
Hey, I work at a company where I'm lucky enough to write web apps using Python and WSGI :). We develop more and more stuff in Python and it's becoming a mess of dependencies, so we thought we would create a guideline for developers that describes the whole process of deploying a Python app on a

Re: converting a string to a function parameter

2009-03-13 Thread Paul McGuire
On Mar 13, 11:46 am, Aaron Brady castiro...@gmail.com wrote: On Mar 13, 2:52 am, koranthala koranth...@gmail.com wrote: Hi,     Is it possible to convert a string to a function parameter? Ex: str = 'True, type=rect, sizes=[3, 4]' and I should be able to use it as: test(convert(str))

ANN: Urwid 0.9.8.4 - Console UI Library

2009-03-13 Thread Ian Ward
Announcing Urwid 0.9.8.4 Urwid home page: http://excess.org/urwid/ Tarball: http://excess.org/urwid/urwid-0.9.8.4.tar.gz RSS: http://excess.org/feeds/tag/urwid/ About this release: === This is a maintenance release that adds compatibility with

Re: Short-term python programming consultant - funds expire soon!

2009-03-13 Thread bobicanprogram
On Mar 10, 1:35 pm, Rob Clewley rob.clew...@gmail.com wrote: Dear Pythonistas, Our open-source software project (PyDSTool) has money to hire an experienced Python programmer on a short-term, per-task basis as a technical consultant (i.e., no fringe benefits offered). The work can be done

How to find in in the documentation

2009-03-13 Thread tinnews
I've had this trouble before, how do I find the details of how in works in the documentation. E.g. the details of:- if string in bigstring: It gets a mention in the if section but not a lot. -- Chris Green -- http://mail.python.org/mailman/listinfo/python-list

Neatest way to do a case insensitive in?

2009-03-13 Thread tinnews
What's the neatest way to do the following in case insensitive fashion:- if stringA in stringB: bla bla bla I know I can just do:- if stringA.lower() in stringB.lower(): bla bla bla But I was wondering if there's a neater/easier way? -- Chris Green --

Threads and temporary files

2009-03-13 Thread aiwarrior
Hi I recently am meddling with threads and wanted to make a threaded class that instead of processing anything just retrieves data from a file and returns that data to a main thread that takes all the gathered data and concatenates it sequentially. An example is if we want to get various ranges

Re: Rough draft: Proposed format specifier for a thousands separator

2009-03-13 Thread Raymond Hettinger
 The separators can be any one of COMMA, SPACE, DOT, UNDERSCORE, or NON-BREAKING-SPACE. What if I want other separators? format(n, ',d').replace(,, yoursep) How about this idea: make the format has long format, which is a bit more verbose, flexible, and unambiguous, and the current

Get pixel colors from images in Python 3

2009-03-13 Thread Cro
Good day. As the title sais, i am trying to extract pixel colors from images, in Python 3. I know that for python 2.x, PIL (Python image library) can do that, via Image getpixel((x,y)). It returns the colors as a list with 3 parameters, Red, Green and Blue. This is exactly what i want. Now, the

Re: How to find in in the documentation

2009-03-13 Thread Albert Hopkins
On Fri, 2009-03-13 at 21:01 +, tinn...@isbd.co.uk wrote: I've had this trouble before, how do I find the details of how in works in the documentation. E.g. the details of:- if string in bigstring: It gets a mention in the if section but not a lot. From

Re: How to find in in the documentation

2009-03-13 Thread Benjamin Peterson
tinnews at isbd.co.uk writes: I've had this trouble before, how do I find the details of how in works in the documentation. E.g. the details of:- if string in bigstring: It gets a mention in the if section but not a lot. Look here:

  1   2   3   >