Re: reduce to be removed?

2006-11-11 Thread Paddy
Dustan wrote: > Anyway, I figured out a way to get the builtin > function 'sum' to work as I need: > sum([[1,2,3],[4,5,6],[7,8,9]], []) > Hah! No-one expects sum to be used on anything but numbers. Except lists as above. No-one expects sum to be used on anything but numbers, and maybe lists t

Lisp additions to Docstring Wikipedia entry?

2006-11-11 Thread paddy3118
Hello, I have just expanded the Wikipedia stub article on docstrings at http://en.wikipedia.org/wiki/Docstring. Unfortunately I do not know about Lisp, but took the time to google and found a link to the GNU Emacs Lisp entry: documentation at: http://ftp.gnu.org/gnu/Manuals/elisp-manual-20-2.5/html

Re: Py3K idea: why not drop the colon?

2006-11-11 Thread Ron Adam
[EMAIL PROTECTED] wrote: > > I'm not sure why '\'s are required to do multi-line before the > colon. > Special cases aren't special enough to break the rules. > > Georg > >>> A bit of a circular answer. > >>> > >>> Why the rule? -> So not to break t

Re: odd problem with watsup and VB6 application with modal dialog

2006-11-11 Thread ina
At my work we had the same problem. We found that the best solution was to use a thread with the code to handle the model dialog. This worked best for us because the only models in our product are the error messages, and using a thread gave us the ability to check and see if the modal dialog was

Re: reduce to be removed?

2006-11-11 Thread Robert Kern
Dustan wrote: > Robert Kern wrote: >> Dustan wrote: >>> Fredrik Lundh wrote: if you care about writing robust code, why not just use a for-loop, and the list extend method? >>> Because I'm embedding this expression in a list comprehension (as I >>> stated in my original post), and last ti

Re: explicit self revisited

2006-11-11 Thread Steven D'Aprano
On Sat, 11 Nov 2006 22:39:37 +0100, Peter Maas wrote: [snip] > let self be represented by the dot, e.g. replace > > class someTest(unittest.TestCase): > def setUp(self): > self.ly = yList() > self.m1 = self.ly[0].message > self.m2 = self.ly[1].message > self.m3

Re: reduce to be removed?

2006-11-11 Thread Dustan
Fredrik Lundh wrote: > Dustan wrote: > > foo =\ > > [[[1,2,3],[4,5,6],[7,8,9]], > > [[3,2,1],[6,5,4],[9,8,7]]] > > > > Here, foo appears to be a 3-dimensional list - except it's supposed to > > be 2-dimensional. The inner-list-of-lists is a result of how I'm > > producing the data, and now I

Re: reduce to be removed?

2006-11-11 Thread Dustan
Robert Kern wrote: > Dustan wrote: > > Fredrik Lundh wrote: > > >> if you care about writing robust code, why not just use a for-loop, > >> and the list extend method? > > > > Because I'm embedding this expression in a list comprehension (as I > > stated in my original post), and last time I check

Re: how is python not the same as java?

2006-11-11 Thread Bryan
Jorge Vargas wrote: > > the pyc files are just a "catching" system for the common python > developer, as for the java developer the .class files are executable > code. In python noone runs the pyc files, the interpreter takes care > of this for you. > this is an incorrect statement. we (the c

Re: reduce to be removed?

2006-11-11 Thread Steven D'Aprano
On Sat, 11 Nov 2006 17:42:32 -0800, Dustan wrote: >> alright, let's try again: why do you need a self-contained reduce >> replacement that can be embedded inside a list comprehension ? >> >> > > foo =\ > [[[1,2,3],[4,5,6],[7,8,9]], > [[3,2,1],[6,5,4],[9,8,7]]] > > Here, foo appears to be

Re: reduce to be removed?

2006-11-11 Thread Fredrik Lundh
Dustan wrote: foo =\ > [[[1,2,3],[4,5,6],[7,8,9]], > [[3,2,1],[6,5,4],[9,8,7]]] > > Here, foo appears to be a 3-dimensional list - except it's supposed to > be 2-dimensional. The inner-list-of-lists is a result of how I'm > producing the data, and now I want to do a mass-concatenation (or >

Re: Decimal() instead of float?

2006-11-11 Thread Steven D'Aprano
On Sun, 12 Nov 2006 02:31:04 +0100, Fredrik Lundh wrote: >> For example, I have a ZIP code >> database that can do some processing on its numbers, and the numbers are >> stored as floating point values (exactly) but Python doesn't get them >> right > > sounds odd. are you sure you don't mean

Re: reduce to be removed?

2006-11-11 Thread Robert Kern
Dustan wrote: > Fredrik Lundh wrote: >> if you care about writing robust code, why not just use a for-loop, >> and the list extend method? > > Because I'm embedding this expression in a list comprehension (as I > stated in my original post), and last time I checked, it's not possible > to treat a

Re: reduce to be removed?

2006-11-11 Thread Dustan
Fredrik Lundh wrote: > Dustan wrote: > > >> > Because I'm embedding this expression in a list comprehension > >> > >> because? > > > > Because I thought I would be able to get an answer without revealing > > the exact details of what I am doing. > > alright, let's try again: why do you need a se

Re: Py3K idea: why not drop the colon?

2006-11-11 Thread Dan Lenski
Hendrik van Rooyen wrote: > "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > 8<--- > > >>> color = "blue" > > >>> if color == "red" or "green" or "yellow": > > ... print color, "is red or green or yellow" > > ... > > blue is red or green or yellow

Re: Decimal() instead of float?

2006-11-11 Thread Fredrik Lundh
Michael B. Trausch wrote: > Is there a way to use Decimal() by default in Python instead of float? nope. > For example, I have a ZIP code > database that can do some processing on its numbers, and the numbers are > stored as floating point values (exactly) but Python doesn't get them > righ

Re: odd problem with watsup and VB6 application with modal dialog

2006-11-11 Thread Grumman
Rob Williscroft wrote: > Here's a rewrite of the winGuiAuto.clickButton function, > post_clickButton() that uses PostMessage: Thanks for the info, I'll give it a try. -- http://mail.python.org/mailman/listinfo/python-list

Decimal() instead of float?

2006-11-11 Thread Michael B. Trausch
Is there a way to use Decimal() by default in Python instead of float?  I've no use for the float type, and I have some stuff that would require Decimal(), but it is kind of a pain to try and cast things all over the place all the time.  Float is just way too inexact for me. I am searching aro

Re: explicit self revisited

2006-11-11 Thread Fredrik Lundh
Dennis Lee Bieber wrote: >> one article at a time. who's going to be the first one to argue that >> Python needs a goto statement ? >> > Especially since there is a comefrom ah, good point. I've updated the FAQ. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does this code crash python?

2006-11-11 Thread Mythmon
On Nov 11, 3:23 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > I have no knowledge of Console, but under Windows I was able to hack > this (see bottom of post) together using only one non-portable library > -- msvcrt. Oh, and an ActiveState 2.4 build. I'm not touching 2.5 until > a lot of 3rd

Re: explicit self revisited

2006-11-11 Thread Steven D'Aprano
On Sat, 11 Nov 2006 18:09:59 -0600, skip wrote: > > Doug> The explicit self is there simply because OOP was tacked onto > Doug> python as an afterthought. > > Got a reference to support that claim? Of course not, since it is a classic example of trolling. By comparison, the way I read

Re: reduce to be removed?

2006-11-11 Thread Fredrik Lundh
Dustan wrote: >> > Because I'm embedding this expression in a list comprehension >> >> because? > > Because I thought I would be able to get an answer without revealing > the exact details of what I am doing. alright, let's try again: why do you need a self-contained reduce replacement that ca

Re: py2exe console removing

2006-11-11 Thread Fredrik Lundh
Croteam wrote: > Can somebody tell me how to I remove console at script installing? what does "installing" mean in this context? if the problem is that you get a console window when you run the program without a console (e.g. if you start it from the explorer), use "windows=" instead of "conso

Re: reduce to be removed?

2006-11-11 Thread Dustan
Fredrik Lundh wrote: > Dustan wrote: > > > Because I'm embedding this expression in a list comprehension > > because? > > Because I thought I would be able to get an answer without revealing the exact details of what I am doing. I didn't realize that wasn't an option. I'll try once more to give

Re: explicit self revisited

2006-11-11 Thread skip
Doug> The explicit self is there simply because OOP was tacked onto Doug> python as an afterthought. Got a reference to support that claim? Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: explicit self revisited

2006-11-11 Thread Fredrik Lundh
Doug (Holton?) wrote: >> and before anyone complains; please note that they're working through >> >> http://www.effbot.org/pyfaq/design-index.htm > > That site is a bunch of FUD - the official FAQ is a bunch of FUD? are you sure you know what FUD means? -- http://mail.python.org/mailma

Re: reduce to be removed?

2006-11-11 Thread Fredrik Lundh
Dustan wrote: > Because I'm embedding this expression in a list comprehension because? -- http://mail.python.org/mailman/listinfo/python-list

Re: reduce to be removed?

2006-11-11 Thread Dustan
Fredrik Lundh wrote: > Dustan wrote: > > > It's always nice to know there are such good-natured people ready to > > help on this group. > > any special reason why you keep pretending that some random wikipedia > editor knows more about a future Python release than the people that > develops Python

Re: httplib continuation packets

2006-11-11 Thread Haakon Riiser
[Fredrik Lundh] > Haakon Riiser wrote: > >> Yes, and it doesn't help. > > then the server is mostly likely broken beyond repair. It's not in my power to upgrade the server, unfortunately. Guess I'll have to use Perl. > to see if this really is the problem, you could try moving the call to > sel

Re: explicit self revisited

2006-11-11 Thread Doug
Fredrik Lundh wrote: > Fredrik Lundh wrote: > > cannot all you clueless trolls who cannot think of a single useful thing > > to contribute to Python start your own newsgroup? > > and before anyone complains; please note that they're working through > > http://www.effbot.org/pyfaq/design-index

Re: Python Parallel Paradigm

2006-11-11 Thread Fredrik Lundh
Sandy wrote: > I usually lurk on the comp.lang.python newsgroup. I'm not an expert > in the slightest, but I have had a growing feeling that there's > something definitely lacking in the concurrency aspects of Python. the culprit in this case appears to be Microsoft's console library, thoug

Re: reduce to be removed?

2006-11-11 Thread Fredrik Lundh
Dustan wrote: > It's always nice to know there are such good-natured people ready to > help on this group. any special reason why you keep pretending that some random wikipedia editor knows more about a future Python release than the people that develops Python ? > Anyway, I figured out a way

Re: Py3K idea: why not drop the colon?

2006-11-11 Thread skip
> I'm not sure why '\'s are required to do multi-line before the colon. Special cases aren't special enough to break the rules. Georg >>> A bit of a circular answer. >>> >>> Why the rule? -> So not to break the rule? >> >> You proposed to a

Python Parallel Paradigm

2006-11-11 Thread Sandy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote >Well, I tried that, and it did something. It made it so the space bar >switched the clock once, but not a second time. And it still crashed, >but not always at the same time, sometimes it would do it the second >time I hit the space bar, som

Re: numpy/scipy: correlation

2006-11-11 Thread Robert Kern
robert wrote: > Is there a ready made function in numpy/scipy to compute the correlation > y=mx+o of an X and Y fast: > m, m-err, o, o-err, r-coef,r-coef-err ? And of course, those three parameters are not particularly meaningful together. If your model is truly "y is a linear response given x w

Re: httplib continuation packets

2006-11-11 Thread Fredrik Lundh
Haakon Riiser wrote: > Yes, and it doesn't help. then the server is mostly likely broken beyond repair. > By the way, this is the closest thing I've found in the bug tracker: > https://sourceforge.net/tracker/?func=detail&atid=105470&aid=547093&group_id=5470 > The bug was closed in 2002 with thi

Re: reduce to be removed?

2006-11-11 Thread Virgil Dupras
Dustan wrote: > According to the following page on Wikipedia: > http://en.wikipedia.org/wiki/Python_%28programming_language%29#Future_development > reduce is going to be removed in python 3.0. It talks of an > accumulation loop; I have no idea what that's supposed to mean. So, > >

Re: reduce to be removed?

2006-11-11 Thread Dustan
Fredrik Lundh wrote: > Dustan wrote: > > > What's an accumulation loop, and how would I convert this code so it's > > compatible with the future 3.0 > > the release of Python 3.0 is far away, and nobody knows how it's going > to look. trying to be future-compatible at this time is a major waste >

Re: How to choose the right GUI toolkit ?

2006-11-11 Thread Jussi Salmela
John Henry wrote: > BTW: I did a search and found the testnotebook example from: > > http://prdownloads.sourceforge.net/pythoncard/testNotebook.zip?download > > and tried it out. There is one error in the widget.py that I have to > get around. Changed from: > > canvas.setFillColor('gra

Re: httplib continuation packets

2006-11-11 Thread Haakon Riiser
[Fredrik Lundh] > Haakon Riiser wrote: > >> Is this a bug in httplib or the web server? > > it could be that they're blocking requests from Python's urllib, of > course. have you tried overriding the user-agent string ? Yes, and it doesn't help. By the way, this is the closest thing I've found

Re: httplib continuation packets

2006-11-11 Thread Fredrik Lundh
Haakon Riiser wrote: > Is this a bug in httplib or the web server? it could be that they're blocking requests from Python's urllib, of course. have you tried overriding the user-agent string ? -- http://mail.python.org/mailman/listinfo/python-list

Re: reduce to be removed?

2006-11-11 Thread Fredrik Lundh
Dustan wrote: > What's an accumulation loop, and how would I convert this code so it's > compatible with the future 3.0 the release of Python 3.0 is far away, and nobody knows how it's going to look. trying to be future-compatible at this time is a major waste of time and (not quite as wastefu

Re: explicit self revisited

2006-11-11 Thread Fredrik Lundh
> cannot all you clueless trolls who cannot think of a single useful thing > to contribute to Python start your own newsgroup? and before anyone complains; please note that they're working through http://www.effbot.org/pyfaq/design-index.htm one article at a time. who's going to be the f

Re: explicit self revisited

2006-11-11 Thread Fredrik Lundh
Peter Maas wrote: > What do you think? cannot all you clueless trolls who cannot think of a single useful thing to contribute to Python start your own newsgroup? -- http://mail.python.org/mailman/listinfo/python-list

reduce to be removed?

2006-11-11 Thread Dustan
According to the following page on Wikipedia: http://en.wikipedia.org/wiki/Python_%28programming_language%29#Future_development reduce is going to be removed in python 3.0. It talks of an accumulation loop; I have no idea what that's supposed to mean. So, === >>> x =\ [

Re: Py3K idea: why not drop the colon?

2006-11-11 Thread Ron Adam
Georg Brandl wrote: > Ron Adam wrote: >> Georg Brandl wrote: >>> Ron Adam wrote: Michael Hobbs wrote: > The same problem that is solved by not having to type parens around the > 'if' conditional, a la C and its derivatives. That is, it's unnecessary > typing to no good advan

explicit self revisited

2006-11-11 Thread Peter Maas
The Python FAQ 1.4.5 gives 3 reasons for explicit self (condensed version): 1. Instance variables can be easily distinguished from local variables. 2. A method from a particular class can be called as baseclass.methodname(self, ). 3. No need for declarations to disambiguate assignments to loc

RE: Python opening multiple thread of matlab

2006-11-11 Thread Stefan Schukat
Hello, you just forgot to initialize the COM runtime for the separate thread. try following: def __init__(self,matlab_command): self.matlab_command = matlab_command threading.Thread.__init__(self) def run(self): import pythoncom pythoncom.CoInitiali

Re: handling many default values

2006-11-11 Thread Alan Isaac
"Steven D'Aprano" wrote > (1) If there really is no alternative to a class with many arguments; > (2) and instances can vary those arguments unpredictably; > then this approach seems reasonable to me. But I really suggest you > rethink your class design. Thanks to all who replied and to George for

Re: Py3K idea: why not drop the colon?

2006-11-11 Thread Georg Brandl
Ron Adam wrote: > Georg Brandl wrote: >> Ron Adam wrote: >>> Michael Hobbs wrote: >>> The same problem that is solved by not having to type parens around the 'if' conditional, a la C and its derivatives. That is, it's unnecessary typing to no good advantage, IMHO. I was coding in R

Close program built with py2exe

2006-11-11 Thread Steve Ingram
Hiya, I've got a problem with a program I've written and want to distribute. It uses a wxPython dialog and I've built a distribution version with py2exe. Problem is when I run the .exe under windows I can only stop the program completely using the task manager. When I close the dialog and check th

Re: Py3K idea: why not drop the colon?

2006-11-11 Thread Ron Adam
Georg Brandl wrote: > Ron Adam wrote: >> Michael Hobbs wrote: >> >>> The same problem that is solved by not having to type parens around the >>> 'if' conditional, a la C and its derivatives. That is, it's unnecessary >>> typing to no good advantage, IMHO. I was coding in Ruby for several >>> mon

httplib continuation packets

2006-11-11 Thread Haakon Riiser
After a long debugging session while scripting my webmail, I believe I have traced the problem to the way httplib sends POST requests. I have compared tcpdump listings from Python 2.4.3 and 2.5.0's httplib (via urllib/urllib2), Perl's LWP::UserAgent 2.033 and Firefox 2.0. Only Python sends the re

Re: How to choose the right GUI toolkit ?

2006-11-11 Thread John Henry
BTW: I did a search and found the testnotebook example from: http://prdownloads.sourceforge.net/pythoncard/testNotebook.zip?download and tried it out. There is one error in the widget.py that I have to get around. Changed from: canvas.setFillColor('gray') to: try:

Re: Why does this code crash python?

2006-11-11 Thread Mythmon
On Nov 11, 11:28 am, Irmen de Jong <[EMAIL PROTECTED]> wrote: > You're creating a console object "c" and use it in both threads. > > Try creating the console object for each thread by itself, > i.e. remove the global "c = Console.getconsole()" and replace > it by a getconsole() inside each thread c

Your message to IIU awaits moderator approval

2006-11-11 Thread iiu-bounces
Your mail to 'IIU' with the subject Returned mail: Data format error Is being held until the list moderator can review it for approval. The reason it is being held: ClamAV identified this message as a virus (Worm.Mydoom.M) Either the message will get posted to the list, or you will rec

Re: Py3K idea: why not drop the colon?

2006-11-11 Thread Georg Brandl
Ron Adam wrote: > Michael Hobbs wrote: > >> The same problem that is solved by not having to type parens around the >> 'if' conditional, a la C and its derivatives. That is, it's unnecessary >> typing to no good advantage, IMHO. I was coding in Ruby for several >> months and got very comfortabl

Re: handling many default values

2006-11-11 Thread George Sakkis
Ben Finney wrote: > "Alan Isaac" <[EMAIL PROTECTED]> writes: > > > There are *many* parameters, and the list can change, so I want to > > avoid listing them all in the Param class's __init__ function, using > > the strategy above. > > > > Q1: Is this approach reasonable? > > (This is a newbie

Re: Why does this code crash python?

2006-11-11 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: > I am trying to make a program that will basically simulate a chess > clock in python. To do this I have two threads running, one that > updates the currently running clock, and one that watches for a > keypress. I am using the effbot Console module, and that is where I ge

Re: handling many default values

2006-11-11 Thread Ben Finney
"Alan Isaac" <[EMAIL PROTECTED]> writes: > There are *many* parameters, and the list can change, so I want to > avoid listing them all in the Param class's __init__ function, using > the strategy above. > > Q1: Is this approach reasonable? > (This is a newbie question about unforseen hazards.)

Why does this code crash python?

2006-11-11 Thread Mythmon
I am trying to make a program that will basically simulate a chess clock in python. To do this I have two threads running, one that updates the currently running clock, and one that watches for a keypress. I am using the effbot Console module, and that is where I get the events for the keypresses.

Re: Py3K idea: why not drop the colon?

2006-11-11 Thread Ron Adam
Steven D'Aprano wrote: > On Sat, 11 Nov 2006 01:13:03 -0600, Ron Adam wrote: > >> Steven D'Aprano wrote: >>> On Fri, 10 Nov 2006 21:24:50 +0100, Bjoern Schliessmann wrote: >>> Marc 'BlackJack' Rintsch wrote: > No it doesn't -- look again at the example given above. It's > legal

py2exe console removing

2006-11-11 Thread Croteam
Hello, Can somebody tell me how to I remove console at script installing? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Assistance needed with PyCon sponsorship system

2006-11-11 Thread Steve Holden
It's that time of year again and the Python Software Foundation is cranking up for the fifth PyCon, again this year in Texas. I am responsible for bringing in the sponsorship funds that help to keep this event so reasonably priced, and last year I built a PostgreSQL database to help with the em

Re: odd problem with watsup and VB6 application with modal dialog

2006-11-11 Thread Rob Williscroft
Grumman wrote in news:[EMAIL PROTECTED] in comp.lang.python: [snip] > Roughly, I have a script that fills in a field, sets a combobox, then > clicks a button via clickButton. At this point, the python interpreter > hangs. The only thing I've been able to identify as different about > this form i

Re: Tkinter: How do I change the actual width of a widget?

2006-11-11 Thread Mudcat
Fredrik Lundh wrote: > > look for "pack_propagate" on this page for one way to do it: > > http://effbot.org/tkinterbook/button.htm > > Thanks! I had actually seen this, but on the pythonware site where it looks like this: f = Frame(master, height=32, width=32) f.pack_propagate(0) # d

Re: How to choose the right GUI toolkit ?

2006-11-11 Thread Florian Diesch
"Dan Lenski" <[EMAIL PROTECTED]> wrote: > So, is there another toolkit I should be looking at? Having something > that can run easily on Cygwin and native Windows is a priority so that > I can quickly move programs to new measurement computers. I like GTK a > lot and Tk is growing on me too.. ar

Re: newbie: minidom

2006-11-11 Thread Fredrik Lundh
Paul Watson wrote: >> why? the documents are equivalent, and any XML application that >> requires an explicit UTF-8 encoding declaration is broken. > > Explicit is better than implicit. inventing your own XML standard is no way better than using the existing one. -- http://mail.python.org

Re: newbie: minidom

2006-11-11 Thread Paul Watson
Fredrik Lundh wrote: > Danny Scalenotti wrote: > >> I'm not able to get out of this ... >> >> from xml.dom.minidom import getDOMImplementation >> >> impl = getDOMImplementation() // default UTF-8 >> doc = impl.createDocument(None, "test",None) >> root = doc.documentElement >> root.setAttribu

Re: import parser does not import parser.py in same dir on win

2006-11-11 Thread Joel Hedlund
> the table of built-in modules are checked before searching the path. I figured as much. But why is the behavior different on linux/win? Is this documented somewhere? /Joel -- http://mail.python.org/mailman/listinfo/python-list

Re: import parser does not import parser.py in same dir on win

2006-11-11 Thread Fredrik Lundh
Joel Hedlund wrote: > It turns out that on Windows, the builtin parser module is imported > instead. Why? the table of built-in modules are checked before searching the path. > Why is there a difference? What other names are "taken"? depends on how the interpreter is built; there's a sys varia

Re: range syntax

2006-11-11 Thread Colin J. Williams
Fredrik Lundh wrote: > Colin J. Williams wrote: > >> One of the little irritants of Python is that the range syntax is rather >> long-winded: >> [Dbg]>>> range(3, 20, 6) >> [3, 9, 15] >> [Dbg]>>> >> It would be nice if one could have something like 3:20:6. > > if you find yourself using range a

Re: handling many default values

2006-11-11 Thread pgarrone
Alan Isaac wrote: > > At Friday 10/11/2006 14:11, Alan G Isaac wrote: > > >class Params: > > > def __init__(self,**kwargs): > > > #set lots of default values > > > ... > > > #set the deviations from defaults > > > self.__dict__.update(kwargs) > > > > > >Is

Re: handling many default values

2006-11-11 Thread Steven D'Aprano
On Fri, 10 Nov 2006 17:11:24 +, Alan G Isaac wrote: > My class MyClass reuses many default parameters > with a small number of changes in each instance. Let me see that I understand. Are you doing something like this? # Class takes a lot of arguments a = MyClass(0, 1, 2, 3, 4, 5, ..., 99) #

Python opening multiple thread of matlab

2006-11-11 Thread tsjuan
Hello Python Users, I've been trying to run multiple thread of Matlab by calling its com object via python. However, I keep getting error message that says Python can't find the attribute of certain function that I want to execute in Matlab. I know the com function is exist, it works just fine if

Re: Py3K idea: why not drop the colon?

2006-11-11 Thread Steven D'Aprano
On Sat, 11 Nov 2006 01:13:03 -0600, Ron Adam wrote: > Steven D'Aprano wrote: >> On Fri, 10 Nov 2006 21:24:50 +0100, Bjoern Schliessmann wrote: >> >>> Marc 'BlackJack' Rintsch wrote: >>> No it doesn't -- look again at the example given above. It's legal syntax in Python but doesn't have

Re: handling many default values

2006-11-11 Thread Alan Isaac
> At Friday 10/11/2006 14:11, Alan G Isaac wrote: > >class Params: > > def __init__(self,**kwargs): > > #set lots of default values > > ... > > #set the deviations from defaults > > self.__dict__.update(kwargs) > > > >Is this a reasonable approach overall? >

Re: numpy/scipy: correlation

2006-11-11 Thread Robert Kern
Robert Kern wrote: > robert wrote: >> Is there a ready made function in numpy/scipy to compute the correlation >> y=mx+o of an X and Y fast: >> m, m-err, o, o-err, r-coef,r-coef-err ? > scipy.optimize.leastsq() can be told to return the covariance matrix of the > estimated parameters (m and o in

plasTeX doesn't load LaTeX packages

2006-11-11 Thread giovanni gherdovich
Hello, first of all: Is this the right place to ask plastek-related questions? I'm trying to make plastex work on my Ubuntu Dapper Drake. For LaTeX, I have the all-in-one package tetex. Everything is ok with this simple helloword code: \documentclass{article} \author{Au. Thor} \title{Title} \da

Re: numpy/scipy: correlation

2006-11-11 Thread Robert Kern
robert wrote: > Is there a ready made function in numpy/scipy to compute the correlation > y=mx+o of an X and Y fast: > m, m-err, o, o-err, r-coef,r-coef-err ? numpy and scipy questions are best asked on their lists, not here. There are a number of people who know the capabilities of numpy and s

import parser does not import parser.py in same dir on win

2006-11-11 Thread Joel Hedlund
Hi! I have a possibly dumb question about imports. I've written two python modules: parser.py class Parser(object): "my parser" app.py from parser import Parser print "import succ

Re: MySQLdb windows binaries for Python 2.5??

2006-11-11 Thread Jan Dries
[EMAIL PROTECTED] wrote: > I'm also looking for a MySQLdb binary for windows. This is holding me > from upgrading from Python 2.4 to Python 2.5 ! > If you search the Help Forum of the MySQLdb project on SourceForge, you will find a couple of people who have successfully built MySQLdb on Windows

Re: how is python not the same as java?

2006-11-11 Thread Ben Finney
Jacques Naude <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: > > They have pearl, c, basic, cobol also but no python. > > Pearl? Practical Extraction And Reporting Language. http://en.wikipedia.org/wiki/Perl#Name> -- \ Lucifer: "Just sign the Contract, sir, and the Piano i

numpy/scipy: correlation

2006-11-11 Thread robert
Is there a ready made function in numpy/scipy to compute the correlation y=mx+o of an X and Y fast: m, m-err, o, o-err, r-coef,r-coef-err ? Or a formula to to compute the 3 error ranges? -robert PS: numpy.corrcoef computes only the bare coeff: >>> numpy.corrcoef((0,1,2,3.0),(2,5,6,7.0),) arra

Re: Inheritance Question

2006-11-11 Thread Carl Banks
Jackson wrote: > For a more "concrete" example: > > Suppose all the animals in the world have only 1 or 2 legs. > > class Legs(object) > def run(): pass > def walk(number_of_legs): > # lots of commands > # that do not depend on the > # number of legs but definitely > # have to d

Re: urlretrieve get file name

2006-11-11 Thread Sven
> You can use the geturl() method to obtain the true URL used (that > would behttp://page.com/filename.zip) and then rename the file. Thanks mate, this was exactly what I needed. A realy clean and simple solution to my problem. :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: service windows avec py2exe

2006-11-11 Thread DarkPearl
I found the function which starts the error ** class Win32ProcessUsage: def __init__(self): self.lstProcess=[] self.WMIService = win32com.client.GetObject(r"winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") self.reset() def r

Re: Py3K idea: why not drop the colon?

2006-11-11 Thread Antoon Pardon
On 2006-11-11, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Fri, 10 Nov 2006 13:16:32 -0600, Michael Hobbs wrote: > >> Yeah, okay, I didn't read through the details of the PEP. I picked a bad >> example to illustrate a point that is still true. The FAQ also tries to >> argue that it's a Good T

Re: UnboundLocalError

2006-11-11 Thread Camellia
Oh thank you for pointing that out Fredrik, you made the case more clear:) On Nov 11, 7:19 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Camellia wrote: > > Oh how can I thank you enough, you make my day:) > > According to what you said I finally figure it out, it is the same as: > > > > > b = 1

Re: MySQLdb windows binaries for Python 2.5??

2006-11-11 Thread Robin Becker
[EMAIL PROTECTED] wrote: > I'm also looking for a MySQLdb binary for windows. This is holding me > from upgrading from Python 2.4 to Python 2.5 ! > > Or does anybody know of alternatives ? I have to connect directly to > an MySQL database. > > Henk > >> HI All, >> Does such a beast exist? Hav

Re: MySQLdb windows binaries for Python 2.5??

2006-11-11 Thread Henk . van . Asselt
I'm also looking for a MySQLdb binary for windows. This is holding me from upgrading from Python 2.4 to Python 2.5 ! Or does anybody know of alternatives ? I have to connect directly to an MySQL database. Henk > HI All, > Does such a beast exist? Have been looking but haven't seen any. Any >

Re: how is python not the same as java?

2006-11-11 Thread Jacques Naude
[EMAIL PROTECTED] wrote: > You can get educated in java through manpower for free just apply for a > job(through thier online learning thing) but you can't add python to > your plan. :( They have pearl, c, basic, cobol also but no > python. > > https://sourceforge.net/project/showfiles.php?g

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-11 Thread Robin Becker
Andrew MacIntyre wrote: >> I guess the freebsd limits must be different to the original >> development environment. > > The number of semaphores is certainly tunable - the SYSV IPC KERNEL > PARAMETERS section in the file /usr/src/sys/conf/NOTES lists the SYSV > semaphore parameters that ca

Re: Inheritance Question

2006-11-11 Thread Frank Millman
Gabriel Genellina wrote: > At Saturday 11/11/2006 03:31, Frank Millman wrote: > > >Continuing your analogy of animals, assume a class A with a 'walk' > >method and an 'eat' method. > > > >Most animals walk the same way, but a few don't, so I create a subclass > >AW and override the walk method. >

Re: UnboundLocalError

2006-11-11 Thread Fredrik Lundh
Camellia wrote: > Oh how can I thank you enough, you make my day:) > According to what you said I finally figure it out, it is the same as: > > > b = 1 > def a(): > b = b #no good:) > if you really want to modify a variable that lives outside the function, you can use the "global" directi

Re: Tkinter: How do I change the actual width of a widget?

2006-11-11 Thread Fredrik Lundh
Mudcat wrote: > I am trying to change the width of a widget based on pixel size and not > on characters. I can't figure out how to do this. > > Normally to change to the size of a widget it looks like: > > widget.configure(width = x) > > However that is in characters, not in pixels. To retrieve

Re: UnboundLocalError

2006-11-11 Thread Camellia
Oh how can I thank you enough, you make my day:) According to what you said I finally figure it out, it is the same as: b = 1 def a(): b = b #no good:) So in every day programming I should avoid using the same name for different types of objects because they will step on each other, right?

Re: UnboundLocalError

2006-11-11 Thread Camellia
Oh how can I thank you enough, you make my day:) According to what you said I finally figure it out, it is the same as: b = 1 def a(): b = b #no good:) So in every day programming I should avoid using the same name for different objects because they will step on each other, right? On Nov 1