Pyowa Meeting this Thursday

2009-06-03 Thread Mike Driscoll
Hi, Pyowa will be meeting Thursday, June 4th in Ames. We will be meeting at the Ames Public Library from 7 to 8:45 p.m. The current plan for the meeting is to have a code review of sorts on some member submitted GIS-type code. Then we will have a short presentation on one of the modules from

ANN: Numexpr 1.3 released

2009-06-03 Thread Francesc Alted
Announcing Numexpr 1.3 Numexpr is a fast numerical expression evaluator for NumPy. With it, expressions that operate on arrays (like 3*a+4*b) are accelerated and use less memory than doing the same calculation in Python. On this release, and

[ANN] LFS - Lightning Fast Shop presentation at Python User Group Leipzig, 9.6.2009, 20:00 Uhr

2009-06-03 Thread Markus Zapke-Gründemann
Leipzig Python User Group - Next Meeting Tuesday, June 9, 2009 We will meet on June 9 at 8:00 pm at the training center of Python Academy in Leipzig, Germany [1]. There will be a very interesting presentation by Kai Diefenbach (iqplusplus Erfurt): Kai Diefenbach:

itools 0.60.2 released

2009-06-03 Thread J. David Ibáñez
itools 0.60.2 (2009/06/03) == itools is a Python library, it groups a number of packages into a single meta-package for easier development and deployment: itools.abnf itools.i18n itools.stl itools.core itools.ical

Re: Wrapping methods of built-in dict

2009-06-03 Thread shailesh
On May 21, 10:13 pm, George Sakkis george.sak...@gmail.com wrote: On May 21, 5:55 pm, shailesh kochhar...@gmail.com wrote: There doesn't seem to be a predicate returning method wrappers. Is there an alternate way to query an object for attributes that are of method wrappers? Sure:

Python reimport

2009-06-03 Thread peteshinners
I've implemented a working reimport that, does what you want. After a bit of testing with friends, I'm releasing version 1.0 tonight. http://code.google.com/p/reimport/ There's still work to do, but this already does a bit of fancy transmuting to push the reimport changes into the runtime. This

Re: Copying objects and multiple inheritance

2009-06-03 Thread Gabriel Genellina
En Tue, 02 Jun 2009 19:02:47 -0300, Brian Allen Vanderburg II brianvanderbu...@aim.com escribió: What is the best way to copy an object that has multiple inheritance with the copy module. Particularly, some of the instances in the hierarchy (...some of the classes in..., I presume?)

Re: Python reimport

2009-06-03 Thread Ben Finney
peteshinners p...@shinners.org writes: I've implemented a working reimport that, does what you want. After a bit of testing with friends, I'm releasing version 1.0 tonight. When making an announcement of a new version of a project, please summarise in the announcement what that project is

Re: Problem building 64-bit python 2.6.2 on Solaris 10

2009-06-03 Thread Martin v. Löwis
I was able to compile ctypes with gcc4sparc without many changes to the CFLAGS, etc. I had another weird error, but upgrading to the latest gcc4sparc fixed it. One thing I'm not clear about is how extensions are built. I noticed that my CFLAGS are not being passed to gcc when building the

Re: FILE object in Python3.0 extension modules

2009-06-03 Thread Martin v. Löwis
The purpose is to dump the contents of a Python extension type to disk as binary data using C's fwrite() function. This isn't really possible anymore - the Python IO library has stopped using stdio. There are a couple of alternatives: 1. don't use fwrite(3) to write the binary data, but

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-03 Thread Diez B. Roggisch
A. Cavallo schrieb: Mmmm, not really a conspiracy but it is not that trivial In wrapping c++ you might find useful the commands nm with c++filt although they work under linux there is the same pair for every platform (under windows I remember there is objdump): they should only you need

How to get a window ID in linux using python?

2009-06-03 Thread Sandy
Hi all, Is there a way to get window ID in linux using python by just using the window name (say 'VPython')? This can be done in (Microsoft) windows (got it from somewhere else, not tested). import win32gui self.VP = win32gui.FindWindow ( None, 'VPython' ) In Linux, we can get window info

why does my python's program die after change computer system time?

2009-06-03 Thread fuzziy
Microsoft windowsXP 中,在python2.6下运行如下程序,显示一个时间的窗口。当双击桌面右下角的时间,然后更改时间或日 期,多次更改后,我的时间窗口就死机了,时间不变了。好像是after(200, tick)不运行了。不知道为怎么这个定时器会死掉呢。请各位指教, 谢谢!! import Tkinter import time curtime = '' clock_label = Tkinter.Label() clock_label.pack() def tick(): global curtime #print(1:) newtime

Re: How to get a window ID in linux using python?

2009-06-03 Thread Martin v. Löwis
In Linux, we can get window info by executing 'xwininfo' and then selecting the desired window manually. Can this be done automatically in python? You can run xwininfo -tree -root, and then parse the output. HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-03 Thread Lawrence D'Oliveiro
In message ad634d5d- c0e4-479a-85ed-91c26d3bf...@c36g2000yqn.googlegroups.com, Kay Schluehr wrote: On 3 Jun., 05:51, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message h04bjd$n9...@hoshi.visyn.net, Sebastian Wiesner wrote: Nick Craig-Wood – Mittwoch, 3. Juni 2009

unittest - what is the best way to reuse test data?

2009-06-03 Thread Mike
Hello, I'm writing an application that needs to fetch a json file from a webserver. I'm writing the tests and have a question: if I have the following methods: def test_headers(self): headers = libary.get_data(data) check header status def test_get_info info =

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-03 Thread A. Cavallo
No wonder, you have never actually used C++ with C types. An extern C clause tells the compiler to generate C functions (more precisely, functions that conform to the C ABI conventions), so effectively you're calling into C, not into C++. Seems like the only sane way to do it. In

Re: why does my python's program die after change computer system time?

2009-06-03 Thread Gabriel Genellina
En Wed, 03 Jun 2009 04:08:03 -0300, fuzziy zhiyongf...@gmail.com escribió: [why does my python's program die after change computer system time?] def tick(): ...show current time... clock_label.after(200, tick) What do you mean by die? Did you set the system time to an earlier

OT: Can;'t find a Mozilla user group

2009-06-03 Thread Anthra Norell
I can't run Firefox and Thunderbird without getting these upgrade ordering windows. I don't touch them, because I have reason to suspect that they are some (Russian) virus that hijacks my traffic. Occasionally one of these window pops up the very moment I hit a key and next a confirmation

Re: How to get a window ID in linux using python?

2009-06-03 Thread Paul Boddie
On 3 Jun, 10:58, Martin v. Löwis mar...@v.loewis.de wrote: In Linux, we can get window info by executing 'xwininfo' and then selecting the desired window manually. Can this be done automatically in python? You can run xwininfo -tree -root, and then parse the output. The desktop.windows

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-03 Thread Kay Schluehr
On 3 Jun., 11:13, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message ad634d5d- c0e4-479a-85ed-91c26d3bf...@c36g2000yqn.googlegroups.com, Kay Schluehr wrote: On 3 Jun., 05:51, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-03 Thread Roy Smith
In article mailman.1046.1244023834.8015.python-l...@python.org, A. Cavallo a.cava...@mailsnare.com wrote: The following is the STL equivalent of: print [ x*2 for range(10) in data if (x%2 == 0) ] Are you sure about that? I haven't tested the following code, but I believe it is a much more

Re: Copying objects and multiple inheritance

2009-06-03 Thread Brian Allen Vanderburg II
Gabriel Genellina wrote: En Tue, 02 Jun 2009 19:02:47 -0300, Brian Allen Vanderburg II brianvanderbu...@aim.com escribió: What is the best way to copy an object that has multiple inheritance with the copy module. Particularly, some of the instances in the hierarchy (...some of the classes

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-03 Thread A. Cavallo
On Wednesday 03 June 2009 14:05:35 Roy Smith wrote: In article mailman.1046.1244023834.8015.python-l...@python.org, A. Cavallo a.cava...@mailsnare.com wrote: The following is the STL equivalent of: print [ x*2 for range(10) in data if (x%2 == 0) ] Are you sure about that? I haven't

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-03 Thread A. Cavallo
On Wednesday 03 June 2009 14:05:35 Roy Smith wrote: #include iostream int main(int argc, char * argv[]) { std::cout SyntaxError: can't assign to function call; std::cout endl; } Ops, I've forgotten a.cpp: In function ‘int main(int, char**)’: a.cpp:5: error: ‘endl’ was not

Re: is anyone using text to speech to read python documentation

2009-06-03 Thread edexter
On Jun 2, 7:52 pm, eric_dex...@msn.com eric_dex...@msn.com wrote:      I wrote a small pre-processor for python documentation and I am looking for advice on how to get the most natural sounding reading.  I uploaded an example of a reading of lxml documentation as a podcast1

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-03 Thread Lou Pecora
In article h04s0s$7g...@lust.ihug.co.nz, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message h04bjd$n9...@hoshi.visyn.net, Sebastian Wiesner wrote: Nick Craig-Wood ­ Mittwoch, 3. Juni 2009 00:29 That said I've used C++ with ctypes loads of times, but I always wrap

Re: Python reimport

2009-06-03 Thread peteshinners
On Jun 2, 11:54 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: When making an announcement of a new version of a project, please summarise in the announcement what that project is (i.e. what the program does) This module has a reimport function that works as a replacement for the reload

float(1,009.67) error

2009-06-03 Thread Jianli Shen
I want to converter a string 1,009.67 to float, I got: python ValueError: invalid literal for float() how do I handle this. 1,009.67 is generated by some other program. It could be 2,898.88 3,554,545.66 etc. Thanks, -- http://mail.python.org/mailman/listinfo/python-list

ANN: Resolver One 1.5 released

2009-06-03 Thread Giles Thomas
We are proud to announce the release of Resolver One, version 1.5. Resolver One is a Windows-based spreadsheet that integrates Python deeply into its recalculation loop, making the models you build more reliable and more maintainable. For version 1.5, we've added a console; this new command-line

Re: float(1,009.67) error

2009-06-03 Thread Chris Rebert
On Wed, Jun 3, 2009 at 8:29 AM, Jianli Shen wjxiaos...@gmail.com wrote: I want to converter a string 1,009.67 to float, I got: python ValueError: invalid literal for float() how do I handle this. 1,009.67 is generated by some other program. It could be 2,898.88 3,554,545.66 etc. Python's

Re: How do I change the behavior of the 'python-docs' action in IDLE?

2009-06-03 Thread Aahz
In article 16b92b10-95cf-49ed-868c-8f66c8160...@r3g2000vbp.googlegroups.com, samwyse samw...@gmail.com wrote: I just installed Python 3.0.1 via the Windows 32-bit installer. Opening Python Docs takes me to http://docs.python.org/dev/3.0/, which doesn't exist. Renaming python301.chm to

Re: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread Diez B. Roggisch
Esmail wrote: Hi all, I am trying to visualize a number of small objects moving over a 2D surface during run-time. I was wondering what would the easiest way to accomplish this using Python? Ideally I am looking for a shallow learning curve and efficient implementation :-) These objects

Re: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread Gökhan SEVER
It seems like you want to animate your data. You may want to take a look at Matplotlib examples or Mayavi for 3D animations ( http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/mlab_animating.html?highlight=animation ) Gökhan On Wed, Jun 3, 2009 at 10:53 AM, Esmail

Re: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread Esmail
Gökhan SEVER wrote: It seems like you want to animate your data. You may want to take a look at Matplotlib examples or Mayavi for 3D I've used Matplotlib to plot points that were saved during runtime to a file. I wonder if I could skip that step and directly plot during runtime updating the

private pypi repository

2009-06-03 Thread Aljosa Mohorovic
i'm looking for a effective way to setup private pypi repository, i've found: - PloneSoftwareCenter - http://code.google.com/p/pypione/ - http://pypi.python.org/pypi/haufe.eggserver what are you using? what would you recommend? Aljosa Mohorovic --

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-03 Thread Terry Reedy
A. Cavallo wrote: print [ x*2 for range(10) in data if (x%2 == 0) ] I hope you meant print [ x*2 for x in range(10) if (x%2 == 0) ] -- http://mail.python.org/mailman/listinfo/python-list

Re: unittest - what is the best way to reuse test data?

2009-06-03 Thread Terry Reedy
Mike wrote: Hello, I'm writing an application that needs to fetch a json file from a webserver. I'm writing the tests and have a question: if I have the following methods: def test_headers(self): headers = libary.get_data(data) check header status With no json experience

Re: How do I change the behavior of the 'python-docs' action in IDLE?

2009-06-03 Thread Terry Reedy
Aahz wrote: In article 16b92b10-95cf-49ed-868c-8f66c8160...@r3g2000vbp.googlegroups.com, samwyse samw...@gmail.com wrote: I just installed Python 3.0.1 via the Windows 32-bit installer. Opening Python Docs takes me to http://docs.python.org/dev/3.0/, which doesn't exist. Renaming

Re: private pypi repository

2009-06-03 Thread Diez B. Roggisch
Aljosa Mohorovic wrote: i'm looking for a effective way to setup private pypi repository, i've found: - PloneSoftwareCenter - http://code.google.com/p/pypione/ - http://pypi.python.org/pypi/haufe.eggserver what are you using? what would you recommend? We use eggbasket [1], in an actually

Re: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread Esmail
Gökhan SEVER wrote: I don't know how easy to use pygame or pyOpenGL for data animation comparing to Mayavi. Mayavi uses VTK as its visualization engine which is an OpenGL based library. I would like to learn more about how alternative tools might be beneficial say for example atmospheric

Re: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread ma
Try out PyChart, it's a very complete and has a great interface. I use it to generate statistics for some of our production machines: http://home.gna.org/pychart/ On Wed, Jun 3, 2009 at 1:28 PM, Esmail ebo...@hotmail.com wrote: Gökhan SEVER wrote: I don't know how easy to use pygame or

Re: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread Mensanator
On Jun 3, 10:53 am, Esmail ebo...@hotmail.com wrote: Hi all, I am trying to visualize a number of small objects moving over a 2D surface during run-time. I was wondering what would the easiest way to accomplish this using Python? Try Turtle Graphics using goto's. With pen up! :-) Ideally I

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-03 Thread Carl Banks
On Jun 3, 2:13 am, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message ad634d5d- c0e4-479a-85ed-91c26d3bf...@c36g2000yqn.googlegroups.com, Kay Schluehr wrote: On 3 Jun., 05:51, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message

Re: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread Esmail
Mensanator wrote: On Jun 3, 10:53 am, Esmail ebo...@hotmail.com wrote: Hi all, I am trying to visualize a number of small objects moving over a 2D surface during run-time. I was wondering what would the easiest way to accomplish this using Python? Try Turtle Graphics using goto's. With pen

Re: is anyone using text to speech to read python documentation

2009-06-03 Thread Stef Mientki
eric_dex...@msn.com wrote: I wrote a small pre-processor for python documentation and I am looking for advice on how to get the most natural sounding reading. I uploaded an example of a reading of lxml documentation as a podcast1

Re: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread Esmail
ma wrote: Try out PyChart, it's a very complete and has a great interface. I use it to generate statistics for some of our production machines: http://home.gna.org/pychart/ Thanks for the suggestion and link, I'm not familiar with this, but will check it out. If I can get matlibplot to work

Re: Safe to import __builtin__ ?

2009-06-03 Thread Benjamin Peterson
mrstevegross mrstevegross at gmail.com writes: Is it generally safe to explicitly import __builtin__ in python? That is, my code reads like this: ... It seems like it should be a safe import, but I just want to make sure. Yes, that's fine. I'm not sure why you don't just use type(),

Re: private pypi repository

2009-06-03 Thread kiorky
Aljosa Mohorovic a écrit : i'm looking for a effective way to setup private pypi repository, i've found: - PloneSoftwareCenter - http://code.google.com/p/pypione/ - http://pypi.python.org/pypi/haufe.eggserver what are you using? what would you recommend? Aljosa Mohorovic You have also

Project source code layout?

2009-06-03 Thread Allen Fowler
Hello, I'm new to Python, and am looking for some suggestions as to the source code layout for a new project. The project will be a tg/pylons daemon, a static website, and a collection of other scripts that will interact with the app and DB. Here is what I am thinking so far: root_folder/ -

Spring Python 1.0.0-RC2 has been released

2009-06-03 Thread Goldfish
Spring Python takes the concepts implemented by the Java-based Spring Framework, and applies them to Python. This provides a powerful library of functionality to help you get back to writing the code that makes you money. It includes features like data access, transaction management, remoting,

Re: Missing codecs in Python 3.0

2009-06-03 Thread Benjamin Peterson
samwyse samwyse at gmail.com writes: I have a Python 2.6 program (a code generator, actually) that tries several methods of compressing a string and chooses the most compact. It then writes out something like this: { encoding='bz2_codec', data = '...'} In 3.x, all codecs which don't

RE: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread esmail bonakdarian
Hi Brian, Thanks for the code sample, that looks quite promising. I can run it and understand most of it - my knowledge of pylab/matplotlib is still quite rudimentary. I wish there was a good manual/tutorial that could be printed off (or for that matter a book) on this as it seems quite cabable

Re: Illegal seek with os.popen

2009-06-03 Thread Aahz
In article 7c93031a-235e-4e13-bd37-7c9dbc6e8...@r16g2000vbn.googlegroups.com, prueba...@latinmail.com wrote: Should I open a bug report for this? Python 2.5.1 (r251:54863, Sep 19 2007, 14:58:06) [C] on aix5 Type help, copyright, credits or license for more information. import os

Re: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread Brian Blais
On Jun 3, 2009, at 12:15 , Esmail wrote: Gökhan SEVER wrote: It seems like you want to animate your data. You may want to take a look at Matplotlib examples or Mayavi for 3D I've used Matplotlib to plot points that were saved during runtime to a file. I wonder if I could skip that step and

urllib.FancyURLopener.redirect_internal behavior

2009-06-03 Thread Nick Nobody
Hello, I've recently been playing around with urllib.FancyURLopener and noticed that under certain conditions it can block after calling open() on a url. It only happens on specific servers and when the Range HTTP header is in use. The server doesn't close the connection and

Re: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread Scott David Daniels
Esmail wrote: ... Tk seems a bit more complex .. but I really don't know much about it and its interface with Python to make any sort of judgments as to which option would be better. This should look pretty easy: import Tkinter as tk class Mover(object): def __init__(self,

accessing the XML attribute value noNamespaceSchemaLocation thru Python 2.5

2009-06-03 Thread tooshiny
I am currently successfully using lxml and ElementTree to validate and to access the XML contained data. I can however not find any functional call to access the schema location ie the attribute value noNamespaceSchemaLocation. A simple function call would be so much nicer than the other route of

Re: Challenge supporting custom deepcopy with inheritance

2009-06-03 Thread Michael H . Goldwasser
On June 2, 2009, Aahz wrote: class A(object): def __init__(self, aTag): self.__aTag = aTag self.__aList = [] IMO, your problem starts right here. Not only are you using customized attributes for each class, you're using class-private

Re: Copying objects and multiple inheritance

2009-06-03 Thread Gabriel Genellina
En Wed, 03 Jun 2009 10:20:35 -0300, Brian Allen Vanderburg II brianvanderbu...@aim.com escribió: Gabriel Genellina wrote: En Tue, 02 Jun 2009 19:02:47 -0300, Brian Allen Vanderburg II brianvanderbu...@aim.com escribió: What is the best way to copy an object that has multiple inheritance

Re: Get the hard disk hardware serial number

2009-06-03 Thread Terry Reedy
Jorge wrote: Hi there, I need to know how to get the hardware serial number of a hard disk in python. That will be system specific. One semi-general approacy using CPython would be to ask How would I do this with C on this specific system and then use ctypes. --

Re: unittest - what is the best way to reuse test data?

2009-06-03 Thread Mike
On Thu, Jun 4, 2009 at 4:40 AM, Terry Reedy tjre...@udel.edu wrote: Mike wrote: Hello, I'm writing an application that needs to fetch a json file from a webserver. I'm writing the tests and have a question: if I have the following methods: def test_headers(self): headers =

Re: Safe to import __builtin__ ?

2009-06-03 Thread mrstevegross
Yes, it's safe (and this is what the ‘__builtin__’ module is intended for: URL:http://docs.python.org/library/__builtin__). Be careful, though: there's a separate name, ‘__builtins__’, that is *not* meant to be imported. It's also implementation-specific, so shouldn't be relied upon. My

Re: OT: Can;'t find a Mozilla user group

2009-06-03 Thread News123
Anthra Norell wrote: I can't run Firefox and Thunderbird without getting these upgrade ordering windows. I don't touch them, because I have reason to suspect that they are some (Russian) virus that hijacks my traffic. Occasionally one of these window pops up the very moment I hit a key and

Re: Safe to import __builtin__ ?

2009-06-03 Thread Steven D'Aprano
On Wed, 03 Jun 2009 18:57:29 +, Benjamin Peterson wrote: mrstevegross mrstevegross at gmail.com writes: Is it generally safe to explicitly import __builtin__ in python? That is, my code reads like this: ... It seems like it should be a safe import, but I just want to make sure.

Re: Safe to import __builtin__ ?

2009-06-03 Thread Robert Kern
On 2009-06-03 17:54, Steven D'Aprano wrote: On Wed, 03 Jun 2009 18:57:29 +, Benjamin Peterson wrote: mrstevegrossmrstevegrossat gmail.com writes: Is it generally safe to explicitly import __builtin__ in python? That is, my code reads like this: ... It seems like it should be a safe

Re: unittest - what is the best way to reuse test data?

2009-06-03 Thread Terry Reedy
Mike wrote: On Thu, Jun 4, 2009 at 4:40 AM, Terry Reedy tjre...@udel.edu mailto:tjre...@udel.edu wrote: Mike wrote: Hello, I'm writing an application that needs to fetch a json file from a webserver. I'm writing the tests and have a question: if I have

Re: OT: Can;'t find a Mozilla user group

2009-06-03 Thread Terry Reedy
News123 wrote: Anthra Norell wrote: I can't run Firefox and Thunderbird without getting these upgrade ordering windows. I don't touch them, because I have reason to suspect that they are some (Russian) virus that hijacks my traffic. Occasionally one of these window pops up the very moment I

Re: Challenge supporting custom deepcopy with inheritance

2009-06-03 Thread Aahz
In article mailman.1077.1244061915.8015.python-l...@python.org, Michael H. Goldwasser goldw...@slu.edu wrote: On June 2, 2009, Aahz wrote: Michael Goldwasser: class A(object): def __init__(self, aTag): self.__aTag = aTag self.__aList = [] IMO, your problem starts

Re: Generating all combinations

2009-06-03 Thread Steven D'Aprano
On Mon, 01 Jun 2009 22:20:16 -0700, Mensanator wrote: Are you sure that permutations and combinations are subsets of the Cartesian Product? Sure looks that way (SQL examples): [snip] I couldn't do that if they weren't subsets. Permutations and combinations are arrangements of a single set.

Re: unittest - what is the best way to reuse test data?

2009-06-03 Thread Mike
On Thu, Jun 4, 2009 at 11:22 AM, Terry Reedy tjre...@udel.edu wrote: Mike wrote: On Thu, Jun 4, 2009 at 4:40 AM, Terry Reedy tjre...@udel.edu mailto: tjre...@udel.edu wrote: Mike wrote: Hello, I'm writing an application that needs to fetch a json file from a

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-03 Thread Roy Smith
In article mailman.1055.1244038474.8015.python-l...@python.org, A. Cavallo a.cava...@mailsnare.com wrote: On Wednesday 03 June 2009 14:05:35 Roy Smith wrote: #include iostream int main(int argc, char * argv[]) { std::cout SyntaxError: can't assign to function call; std::cout

Re: easiest way to plot x,y graphically during run-time?

2009-06-03 Thread Esmail
Scott David Daniels wrote: Esmail wrote: ... Tk seems a bit more complex .. but I really don't know much about it and its interface with Python to make any sort of judgments as to which option would be better. This should look pretty easy: Thanks Scott for taking the time to share this code

Re: Generating all combinations

2009-06-03 Thread Mensanator
On Jun 3, 6:57 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Mon, 01 Jun 2009 22:20:16 -0700, Mensanator wrote: Are you sure that permutations and combinations are subsets of the Cartesian Product? Sure looks that way (SQL examples): [snip] I couldn't do that if

Re: Generating all combinations

2009-06-03 Thread Raymond Hettinger
What, no partitions? http://en.wikipedia.org/wiki/Partition_of_a_set Seems like you could roll your own (using combinations as a starting point): def pairwise(iterable): a, b = tee(iterable) next(b, None) return izip(a, b) def partition(s): n = len(s) for i in range(n):

Re: Generating all combinations

2009-06-03 Thread Raymond Hettinger
What, no partitions? http://en.wikipedia.org/wiki/Partition_of_a_set Simpler version: def partition(s): n = len(s) parts = range(1, n) for i in range(n): for div in combinations(parts, i): print map(s.__getslice__, chain([0], div), chain(div, [n]))

Re: Generating all combinations

2009-06-03 Thread Steven D'Aprano
On Wed, 03 Jun 2009 20:27:56 -0700, Raymond Hettinger wrote: What, no partitions? http://en.wikipedia.org/wiki/Partition_of_a_set Simpler version: def partition(s): n = len(s) parts = range(1, n) for i in range(n): for div in combinations(parts, i):

Re: OT: Can;'t find a Mozilla user group

2009-06-03 Thread Matt Nordhoff
Anthra Norell wrote: I can't run Firefox and Thunderbird without getting these upgrade ordering windows. I don't touch them, because I have reason to suspect that they are some (Russian) virus that hijacks my traffic. Occasionally one of these window pops up the very moment I hit a key and

Re: Generating all combinations

2009-06-03 Thread Steven D'Aprano
On Wed, 03 Jun 2009 18:21:37 -0700, Mensanator wrote: [mass snippage] What I *was* talking about is this quote from the 3.1 What's New page: quote The itertools.combinations_with_replacement() function is one of four for generating combinatorics including permutations and Cartesian

Re: Project source code layout?

2009-06-03 Thread Lawrence D'Oliveiro
In message mailman.1073.1244055678.8015.python-l...@python.org, Allen Fowler wrote: I'm new to Python, and am looking for some suggestions as to the source code layout for a new project. Is this the development layout or the deployment layout? The two need not bear any resemblance. --

Re: Generating all combinations

2009-06-03 Thread Mensanator
On Jun 3, 10:53�pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Wed, 03 Jun 2009 18:21:37 -0700, Mensanator wrote: [mass snippage] Settle down Mensanator! Don't take it so personally! You're sounding awfully agitated. Don't worry, I'm not. Now that I've narrowed down

Re: Project source code layout?

2009-06-03 Thread Allen Fowler
I'm new to Python, and am looking for some suggestions as to the source code layout for a new project. Is this the development layout or the deployment layout? The two need not bear any resemblance. Looking for suggestions on both. I was hoping to keep the dev layout as close to

import sqlite3

2009-06-03 Thread willgun
Hi,everyone! When i run the following in IDLE: IDLE 2.6.1 import sqlite3 con =sqlite3.connect (r'g:\db1') everything goes well,but when i save these to a .py file and run it: Traceback (most recent call last): File C:\Users\hp\Desktop\SQLite3\sqlite3.py, line 2, in module import sqlite3

Re: import sqlite3

2009-06-03 Thread Gabriel Genellina
En Thu, 04 Jun 2009 02:15:39 -0300, willgun will...@live.cn escribió: Traceback (most recent call last): File C:\Users\hp\Desktop\SQLite3\sqlite3.py, line 2, in module import sqlite3 File C:\Users\hp\Desktop\SQLite3\sqlite3.py, line 3, in module con=sqlite3.connect(r'g:\db1')

[issue6154] Python 3.1 rc1 will not build on OS X 10.5.7

2009-06-03 Thread Brett Cannon
Brett Cannon br...@python.org added the comment: Didn't work when I turned on --enable-framework, but I have no clue how the framework build works so I am of no help with that. -- ___ Python tracker rep...@bugs.python.org

[issue5798] test_asynchat fails on Mac OSX

2009-06-03 Thread Ned Deily
Ned Deily n...@acm.org added the comment: Still happening on 3.1rc1. Should this be considered a release blocker for 3.1? -- nosy: +benjamin.peterson, nad ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5798

[issue6186] test_thread occasionally reports unhandled exceptions on OS X

2009-06-03 Thread Ned Deily
New submission from Ned Deily n...@acm.org: I've recently started seeing occasional regression test error messages on OS X from test_thread. The test reports running OK but tracebacks are displayed. It's not reproducible at will but has shown up on both 10.5 Intel and 10.5 PPC machines with

[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator

2009-06-03 Thread Hagen Fürstenau
Hagen Fürstenau hfuerste...@gmx.net added the comment: I added a simple check for iterables. This is not very elegant, but performance is only affected in the case of an exception. Patch and corresponsing test are attached as TypeError.patch. As I pointed out above, the actual error message

[issue1943] improved allocation of PyUnicode objects

2009-06-03 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: That's unfortunate; it would clearly have been easier to change this in 3.1. That said, I'm not sure anyone *should* be subclassing PyUnicode. Maybe Marc-Andre can explain why he is doing this (or point to the message in this thread

[issue1943] improved allocation of PyUnicode objects

2009-06-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Instead of changing PyUnicodeObject from a PyObject to a PyVarObject, making sub-typing a lot harder, I'd much rather apply a single change for 3.1: raising the KEEPALIVE_SIZE_LIMIT to 32 as explained and motivated here: You make it sound

[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator

2009-06-03 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: This patch leaks a reference on each call to PyObject_GetIter(). And I'm not sure it is a good idea to call this function again: it may be very expensive! I'd prefer a simple check on the tp_iter member. --

[issue1943] improved allocation of PyUnicode objects

2009-06-03 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Antoine Pitrou wrote: Instead of changing PyUnicodeObject from a PyObject to a PyVarObject, making sub-typing a lot harder, I'd much rather apply a single change for 3.1: raising the KEEPALIVE_SIZE_LIMIT to 32 as explained and motivated

[issue6187] Improvement in doc of Extending and Embedding the Python Interpreter, 5.3 Beyond Very High Level Embedding: An overview

2009-06-03 Thread Jon Blubinger
New submission from Jon Blubinger blubdie...@gmail.com: It should me mentioned, that the Python variable PYTHONPATH has to be set to the directory where the multiply.py file is. This can be achieved via export in Linux or via the PySys_SetPath() function in C (see attachment) It should also be

[issue1943] improved allocation of PyUnicode objects

2009-06-03 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Let's apply simple and noncontroversial patches first, and then see if the bigger changes are still worth it. Please open a new ticket. -- ___ Python tracker rep...@bugs.python.org

[issue6185] 2to3 misses buffer slicing

2009-06-03 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- assignee: - benjamin.peterson nosy: +benjamin.peterson priority: - normal ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6185 ___

[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator

2009-06-03 Thread Hagen Fürstenau
Hagen Fürstenau hfuerste...@gmx.net added the comment: Sorry, I had meant to use PyIter_Check instead of PyObject_GetIter. Don't know why I didn't do so... ;-) I corrected the patch. -- Added file: http://bugs.python.org/file14169/TypeError2.patch

[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator

2009-06-03 Thread Hagen Fürstenau
Changes by Hagen Fürstenau hfuerste...@gmx.net: Removed file: http://bugs.python.org/file14166/TypeError.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4806 ___

[issue1943] improved allocation of PyUnicode objects

2009-06-03 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: -haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1943 ___ ___

[issue6188] Error Evaluating float(x) ** float(y)

2009-06-03 Thread Stephen Paul Chappell
New submission from Stephen Paul Chappell noctis.skyto...@gmail.com: This is what I get while the interactive interpreter (IDLE 3.0.1) on the platform Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit (Intel)] on win32 a = -6.276479035564047 b = -5.7974497499584849 a ** b

[issue6188] Error Evaluating float(x) ** float(y)

2009-06-03 Thread Jean-Paul Calderone
Jean-Paul Calderone exar...@divmod.com added the comment: Have you checked to see what the result of a ** b is? -- nosy: +exarkun ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6188 ___

  1   2   >