Re: a splitting headache

2009-10-22 Thread David C . Ullrich
On Wed, 21 Oct 2009 14:43:48 -0700 (PDT), Mensanator wrote: >On Oct 21, 2:46 pm, David C Ullrich wrote: >> On Tue, 20 Oct 2009 15:22:55 -0700, Mensanator wrote: >> > On Oct 20, 1:51 pm, David C Ullrich wrote: >> >> On Thu, 15 Oct 2009 18:18:09 -0700, Mensanator

Re: Your beloved python features

2010-02-05 Thread Bruce C. Baker
"George Sakkis" wrote in message news:de06116c-e77c-47c4-982d-62b48bca5...@j31g2000yqa.googlegroups.com... I'll give the benefit of doubt and assume you're joking rather than trolling. George * Not trolling, my friend! GvR got it

Re: Your beloved python features

2010-02-06 Thread Bruce C. Baker
"Terry Reedy" wrote in message news:[email protected]... > Iterators, and in particular, generators. > A killer feature. > > Terry Jan Reedy > Neither unique to Python. And then're the other killer "features" superfluous ":"s and rigid formatting! -- http

String is ASCII or UTF-8?

2010-03-09 Thread C. Benson Manica
Hours of Googling has not helped me resolve a seemingly simple question - Given a string s, how can I tell whether it's ascii (and thus 1 byte per character) or UTF-8 (and two bytes per character)? This is python 2.4.3, so I don't have getsizeof available to me. -- http://mail.python.org/mailman/l

Re: String is ASCII or UTF-8?

2010-03-09 Thread C. Benson Manica
On Mar 9, 12:07 pm, Tim Golden wrote: > You can't. You can apply one or more heuristics, depending on exactly > what your requirement is. But any valid ASCII text is also valid > UTF8-encoded text since UTF-8 isn't "two bytes per char" but a variable > number of bytes per char. Hm, well that's v

Re: String is ASCII or UTF-8?

2010-03-09 Thread C. Benson Manica
On Mar 9, 12:24 pm, "Richard Brodie" wrote: > "C. Benson Manica" wrote in > messagenews:98375575-1071-46af-8ebc-f3c817b47...@q23g2000yqd.googlegroups.com... > > >The strings come from the same place, i.e. they're exclusively > > normal ASCII charac

Re: Python for newbies (Pythno users group in Macedonia)

2010-03-13 Thread Mike C. Fletcher
108/ HTH, Mike -- ____ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com -- http://mail.python.org/mailman/listinfo/python-list

Re: PyDispatcher on sourceforge doesn't play nice with easy_install

2010-03-30 Thread Mike C. Fletcher
PyPI. That should now work properly with easy_install. HTH, Mike -- ____ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com -- http://mail.python.org/mailman/listinfo/python-list

Bug in fixed_point?!

2010-12-20 Thread C Barrington-Leigh
I cannot figure out what I'm doing wrong. The following does not return a fixed point: from scipy import optimize xxroot= optimize.fixed_point(lambda xx: exp(-2.0*xx)/2.0, 1.0, args=(), xtol=1e-12, maxiter=500) print ' %f solves fixed point, ie f(%f)=%f ?'% (xxroot,xxroot,exp(-2.0*xxroot)/2.0) C

Re: Bug in fixed_point?!

2010-12-21 Thread C Barrington-Leigh
On Dec 21, 9:36 am, Robert Kern wrote: > When you do, please provide the information that Terry Reedy asked for. > Sorry; quite right. For completeness I'll post here as well as over on scipy. Here's the actual code: - from scipy import optimize from math import exp xxroot= o

HTSQL 2.0 RC1 -- a Query Language for the Accidental Programmer

2011-01-21 Thread Clark C. Evans
Kirill Simonov and myself would like to introduce HTSQL, a novel approach to relational database access which is neither an ORM nor raw SQL. HTSQL is a URI-based high-level query language for relational databases. It's implemented as a Python WSGI application. Currently it supports PostgreSQL an

Re: HTSQL 2.0 RC1 -- a Query Language for the Accidental Programmer

2011-01-22 Thread Clark C. Evans
On Fri, 21 Jan 2011 21:25 -0800, "rusi" wrote: > On Jan 22, 2:45 am, "Clark C. Evans" wrote: > > Kirill Simonov and myself would like to introduce HTSQL, a novel > > approach to relational database access which is neither an ORM > > nor raw SQL. >

Re: Python fails on math

2011-02-22 Thread David C. Ullrich
are "definitive" wrong. Anyway, I don't know why you're jumping to the conclusion that it's Python that's wrong here. Could be the math you learned in school is wrong. I mean you're assuming that (*) a(b+c) = ab + ac but what makes you so certain (*) is correct?

xml.dom.minidom character encoding

2010-04-21 Thread C. Benson Manica
I have the following simple script running on 2.5.2 on a machine where the default character encoding is "ascii": #!/usr/bin/env python #coding: utf-8 import xml.dom.minidom import codecs str=u"" doc=xml.dom.minidom.parseString( str ) xml=doc.toxml( encoding="utf-8" ) file=codecs.open( "foo.xml"

Re: xml.dom.minidom character encoding

2010-04-21 Thread C. Benson Manica
On Apr 21, 1:58 pm, Peter Otten <[email protected]> wrote: > C. Benson Manica wrote: >> (snip) > > It seems that parseString() doesn't like unicode Yes, I noticed that, and I already tried... > -- let's try a byte string > then: > > >>&g

Re: xml.dom.minidom character encoding

2010-04-21 Thread C. Benson Manica
On Apr 21, 2:25 pm, Peter Otten <[email protected]> wrote: > Are you sure that your script has > > str = u"..." > > like in your post and not just > > str = "..." No :-) str=u"" doc=xml.dom.minidom.parseString( str.encode("utf-8") ) xml=doc.toxml( encoding="utf-8") file=codecs.open( "foo.xml", "w

Re: Observer implementations

2009-06-16 Thread Mike C. Fletcher
, but I haven't had to change anything in a rather long time. It pretty much just works. Enjoy, Mike -- ____ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Measuring Fractal Dimension ?

2009-06-16 Thread David C . Ullrich
On 15 Jun 2009 04:55:03 GMT, Steven D'Aprano wrote: >On Sun, 14 Jun 2009 14:29:04 -0700, Kay Schluehr wrote: > >> On 14 Jun., 16:00, Steven D'Aprano >> wrote: >> >>> Incorrect. Koch's snowflake, for example, has a fractal dimension of >>> log 4/log 3 ? 1.26, a finite area of 8/5 times that of t

Re: Observer implementations

2009-06-17 Thread Mike C. Fletcher
Tobias Weber wrote: > In article , > "Mike C. Fletcher" wrote: > > >> See PyDispatcher for code to do this. >> > > That was the original problem. Got it now: if used inside the class > definition dispatcher.connect will raise "cannot

Re: Measuring Fractal Dimension ?

2009-06-18 Thread David C . Ullrich
On Wed, 17 Jun 2009 14:50:28 +1200, Lawrence D'Oliveiro wrote: >In message <[email protected]>, wrote: > >> Lawrence D'Oliveiro writes: >> >>> I don't think any countable set, even a countably-infinite set, can have >>> a fractal dimension. It's got to be uncountably infinite,

Re: Measuring Fractal Dimension ?

2009-06-18 Thread David C . Ullrich
On Wed, 17 Jun 2009 14:50:28 +1200, Lawrence D'Oliveiro wrote: >In message <[email protected]>, wrote: > >> Lawrence D'Oliveiro writes: >> >>> I don't think any countable set, even a countably-infinite set, can have >>> a fractal dimension. It's got to be uncountably infinite,

Re: Measuring Fractal Dimension ?

2009-06-18 Thread David C . Ullrich
On Wed, 17 Jun 2009 14:50:28 +1200, Lawrence D'Oliveiro wrote: >In message <[email protected]>, wrote: > >> Lawrence D'Oliveiro writes: >> >>> I don't think any countable set, even a countably-infinite set, can have >>> a fractal dimension. It's got to be uncountably infinite,

Re: Measuring Fractal Dimension ?

2009-06-18 Thread David C . Ullrich
On Wed, 17 Jun 2009 07:35:35 +0200, Jaime Fernandez del Rio wrote: >On Wed, Jun 17, 2009 at 4:50 AM, Lawrence >D'Oliveiro wrote: >> In message <[email protected]>,  wrote: >> >>> Lawrence D'Oliveiro writes: >>> I don't think any countable set, even a countably-infinite set,

Re: Measuring Fractal Dimension ?

2009-06-18 Thread David C . Ullrich
On Wed, 17 Jun 2009 07:37:32 -0400, Charles Yeomans wrote: > >On Jun 17, 2009, at 2:04 AM, Paul Rubin wrote: > >> Jaime Fernandez del Rio writes: >>> I am pretty sure that a continuous sequence of >>> curves that converges to a continuous curve, will do so uniformly. >> >> I think a typical exam

Re: Measuring Fractal Dimension ?

2009-06-18 Thread David C . Ullrich
On Wed, 17 Jun 2009 08:18:52 -0700 (PDT), Mark Dickinson wrote: >On Jun 17, 3:46 pm, Paul Rubin wrote: >> Mark Dickinson writes: >> > It looks as though you're treating (a portion of?) the Koch curve as >> > the graph of a function f from R -> R and claiming that f

Re: Measuring Fractal Dimension ?

2009-06-19 Thread David C . Ullrich
Evidently my posts are appearing, since I see replies. I guess the question of why I don't see the posts themselves \is ot here... On Thu, 18 Jun 2009 17:01:12 -0700 (PDT), Mark Dickinson wrote: >On Jun 18, 7:26 pm, David C. Ullrich wrote: >> On Wed, 17 Jun 2009 08:18:52 -07

Re: Measuring Fractal Dimension ?

2009-06-19 Thread David C . Ullrich
On Wed, 17 Jun 2009 05:46:22 -0700 (PDT), Mark Dickinson wrote: >On Jun 17, 1:26 pm, Jaime Fernandez del Rio >wrote: >> On Wed, Jun 17, 2009 at 1:52 PM, Mark Dickinson wrote: >> > Maybe James is thinking of the standard theorem >> > that says that if a sequence of continuous functions >> > on an

Re: Measuring Fractal Dimension ?

2009-06-22 Thread David C . Ullrich
On Mon, 22 Jun 2009 05:46:55 -0700 (PDT), pdpi wrote: >On Jun 19, 8:13 pm, Charles Yeomans wrote: >> On Jun 19, 2009, at 2:43 PM, David C. Ullrich wrote: >> >> >> >> >> >> > Evidently my posts are appearing, since I see replies. >> > I g

Re: Measuring Fractal Dimension ?

2009-06-22 Thread David C . Ullrich
On Mon, 22 Jun 2009 10:31:26 -0400, Charles Yeomans wrote: > >On Jun 22, 2009, at 8:46 AM, pdpi wrote: > >> On Jun 19, 8:13 pm, Charles Yeomans wrote: >>> On Jun 19, 2009, at 2:43 PM, David C. Ullrich wrote: >>> >>> >>> >>> >>&

Re: Measuring Fractal Dimension ?

2009-06-22 Thread David C . Ullrich
On Fri, 19 Jun 2009 12:40:36 -0700 (PDT), Mark Dickinson wrote: >On Jun 19, 7:43 pm, David C. Ullrich wrote: >> Evidently my posts are appearing, since I see replies. >> I guess the question of why I don't see the posts themselves >> \is ot here... > >Judging b

Re: Remoting over SSH

2009-07-08 Thread Raúl Gómez C .
You also could use TwistedConch, which is an implementation of the SSH2 protocol for Python. I've done something with it, you can read my first questions on the TwistedConch list here

Re: language analysis to enforce code standards

2009-07-09 Thread Bruce C. Baker
"Jason S. Friedman" wrote in message news:[email protected]... > Hello, I administer the Informatica ETL tool at my company. Part of that > role involves creating and enforcing standards. I want the Informatica > developers to add comments to certain key obj

Re: AP -- MeAmI.org Paces Google

2009-07-09 Thread Bruce C. Baker
wrote in message news:defacf35-6149-485a-8f03-15472d63d...@a39g2000pre.googlegroups.com... Oh, puh-LEEZ, Martin! A two-year-old wouldn't be fooled by this! -- http://mail.python.org/mailman/listinfo/python-list

Re: AP -- MeAmI.org Paces Google

2009-07-09 Thread Bruce C. Baker
"Floetry" wrote in message news:[email protected]... On Jul 9, 8:33 pm, "Bruce C. Baker" wrote: > wrote in message > > news:defacf35-6149-485a-8f03-15472d63d...@a39g2000pre.googlegroups.com... > > > > Oh,

Re: AP -- MeAmI.org Paces Google

2009-07-10 Thread Bruce C. Baker
"Musatov" wrote in message news:[email protected]... [snip-a-rooney] > violator." Google could not be reached for comment. Possibly because they were laughing so hard they couldn't hear their cell phones ringing ...? -- http://mail.python.org

Re: how to use "exec" stmt to get input from user

2009-08-10 Thread David C Ullrich
What you're trying to do and what's not working isn't entirely clear to me. But if I had a wxPython application and I wanted to execute user input (note the _if_) I'd just pop up a window (I forget how "ShowModal" is spelled in wx right now) with a text box and an Execute button and a Cancel butt

Re: Scraping Wikipedia with Python

2009-08-11 Thread David C Ullrich
On Tue, 11 Aug 2009 21:29:40 +0300, Dotan Cohen wrote: >>    Wikipedia has an API for computer access.  See >> >>        http://www.mediawiki.org/wiki/API >> >> > Yes, I am aware of this as well. Does anyone know of a python class for > easily interacting with it, or do I need to roll my own. Try

Re: trouble with reload

2009-08-13 Thread David C Ullrich
On Thu, 13 Aug 2009 12:05:26 -0700, Dr. Phillip M. Feldman wrote: > According to the Python documentation, 'reload' reloads a previously > imported module (so that changes made via an external editor will be > effective). But, when I try to use this command, I get the following > error message: >

Komodo(!)

2009-08-14 Thread David C Ullrich
Probably this isn't news to anyone but me, but just in case: Last I heard Komodo was a very highly regarded IDE that unfortunately cost money. Yesterday I discovered that they now have an editor available for free. Doesn't contain all the features of the IDE, but just having glanced at it it seem

Silly question

2009-08-20 Thread David C Ullrich
I just noticed that sequence[i:j:k] syntax in a post here. When did this happen? (I'm just curious whether it existed in 1.5.x or not. If so I'm stupid - otoh if it was introduced in 2.x I'm just slow...) -- http://mail.python.org/mailman/listinfo/python-list

Re: Silly question

2009-08-20 Thread David C Ullrich
On Thu, 20 Aug 2009 18:41:34 +, Duncan Booth wrote: > David C Ullrich wrote: > >> I just noticed that >> >> sequence[i:j:k] >> >> syntax in a post here. When did this happen? >> >> (I'm just curious whether it existed in 1.5.x or no

Re: Silly question

2009-08-20 Thread David C Ullrich
On Thu, 20 Aug 2009 14:36:35 -0400, Benjamin Kaplan wrote: > On Thu, Aug 20, 2009 at 2:13 PM, David C Ullrich > wrote: >> I just noticed that >> >>  sequence[i:j:k] >> >> syntax in a post here. When did this happen? >> >> (I'm just curious

Re: Silly question

2009-08-21 Thread David C Ullrich
On Thu, 20 Aug 2009 17:45:11 -0700, John Machin wrote: > On Aug 21, 5:33 am, David C Ullrich wrote: > >> So I'm slow, fine. (There were several times when I was using 1.5.3 and >> wished they were there - transposing matrices, etc.) > > 1.5.THREE ?? Not sure.

Re: Silly question

2009-08-21 Thread David C Ullrich
On Thu, 20 Aug 2009 16:51:00 -0700, Aahz wrote: > In article , > Benjamin Kaplan wrote: >>On Thu, Aug 20, 2009 at 2:13 PM, David C Ullrich >>wrot= e: >>> >>> I just noticed that >>> sequence[i:j:k] >> >>Well, I got some good news and some

Re: Silly question

2009-08-21 Thread David C Ullrich
On Fri, 21 Aug 2009 14:40:30 -0500, David C Ullrich wrote: > On Thu, 20 Aug 2009 16:51:00 -0700, Aahz wrote: > >> In article , >> Benjamin Kaplan wrote: >>>On Thu, Aug 20, 2009 at 2:13 PM, David C Ullrich >>>wrot= e: >>>> >>>> I ju

Re: Silly question

2009-08-21 Thread David C . Ullrich
On Fri, 21 Aug 2009 14:45:55 -0500, David C Ullrich wrote: >[...] > >Oops. Should have tested that a little more carefully >before posting. No time to fix it right now, customer just >got here. Let's just say we're looking for the primes >between sqrt(n) and n...

Re: Python for professsional Windows GUI apps?

2009-08-26 Thread David C Ullrich
On Mon, 24 Aug 2009 22:22:20 -0700, sturlamolden wrote: > On 25 Aug, 05:56, Peter Decker wrote: > >> I use the Dabo Class Designer to visually design my forms. So what's >> you're point?  :) > > Nothing, except lobbying for wxFormBuilder for anyone who still doesn't > know of it. :) That's gre

Re: What python can NOT do?

2009-08-28 Thread Bruce C. Baker
"qwe rty" wrote in message news:[email protected]... >i know that an interpreted language like python can't be used to make > an operating system or system drivers. > > what else can NOT be done in python? what are the limitations of the > language?

Re: Why does this group have so much spam?

2009-08-29 Thread Bruce C. Baker
"casebash" wrote in message news:[email protected]... > So much of it could be removed even by simple keyword filtering. Assuming this is a serious question: 1. comp.lang.python has relatively little spam, compared to others. 2. The spam posters

Re: Permanently adding to the Python path in Ubuntu

2009-09-01 Thread David C. Ullrich
in wing-ide. > > Is there a way to fix this so that the local dist-packages is added to > sys.path before the system directory ALWAYS? I can do this by editing > site.py but I think it's kind of bad form to do it this way. I feel > there has to be a way to do this without

Video?

2009-09-03 Thread David C Ullrich
Not at all important, just for fun (at least for me): It seems to me, looking at various docs, that wxWidgets includes a "media control" that can play video files, but it's not included in wxPython. (There's something in wxPython with a promising name but it seems to be just audio.) Is that corre

Re: Video?

2009-09-04 Thread David C . Ullrich
On Thu, 03 Sep 2009 23:04:45 +0200, Avell Diroll wrote: >David C Ullrich wrote: >... >> Is that correct? If so is there some other standard Python >> windowing kit that does include some sort of video functionality? >> >> (Talking Ubuntu Linux if it matters.) &

Re: Video?

2009-09-04 Thread David C . Ullrich
On Thu, 3 Sep 2009 16:24:44 -0700 (PDT), Che M wrote: >On Sep 3, 4:11 pm, David C Ullrich wrote: >> Not at all important, just for fun (at least for me): >> >> It seems to me, looking at various docs, that wxWidgets >> includes a "media control" that

Re: Q on explicitly calling file.close

2009-09-09 Thread David C Ullrich
On Sat, 05 Sep 2009 23:41:08 +, Steven D'Aprano wrote: > On Sat, 05 Sep 2009 16:14:02 +, kj wrote: > >> Finally, I was under the impression that Python closed filehandles >> automatically when they were garbage-collected. [...] > > (3) For quick and dirty scripts, or programs that only u

Re: Q on explicitly calling file.close

2009-09-10 Thread David C . Ullrich
en you _always_ have to check the return value of egor_read_file and take appropriate action - complicates the code everywhere the function is called as well as making the function more complicated. Doing it as in UseResource() above you don't need to worry about whether UseResource() failed _excep

Mapping in python? Transforming shapefile so that basemap can read them?

2009-09-11 Thread C Barr Leigh
I'm trying to get started with plotting maps in python. I need to read "shape files" (.shp) and make maps. There seem to be many efforts but none is complete? I'm looking for suggestions and troubleshooting. The basemap package is obviously at an impressive stage and comes with some data: http://w

Re: Python and 3d

2009-09-13 Thread Mike C. Fletcher
ceneGraph, Crystal Space, etc) should all have content loaders, though I haven't played with them enough to be able to say what formats they support. HTH, Mike -- ____ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplu

Re: str.split() with empty separator

2009-09-17 Thread David C Ullrich
On Tue, 15 Sep 2009 14:31:26 +0200, Ulrich Eckhardt wrote: > Hi! > > "'abc'.split('')" gives me a "ValueError: empty separator". However, > "''.join(['a', 'b', 'c'])" gives me "'abc&#

Re: easy question, how to double a variable

2009-09-21 Thread David C Ullrich
On Sun, 20 Sep 2009 13:27:07 -0700, daggerdvm wrote: > Write the definition of a function twice , that receives an int > parameter and returns an int that is twice the value of the parameter. > > how can i do this I don't think this can be done in Python. Looking at the Subject line I though

Re: Twisted 100% event driven or hybrid?

2009-09-23 Thread Mike C. Fletcher
ey will let your application remain responsive to network events during the processing. HTH, Mike -- Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com -- http://mail.python.org/mailman/listinfo/python-list

Re: easy question, how to double a variable

2009-09-23 Thread David C Ullrich
On Tue, 22 Sep 2009 02:34:53 +, Steven D'Aprano wrote: > On Mon, 21 Sep 2009 13:50:23 -0500, David C Ullrich wrote: > >> But you actually want to return twice the value. I don't see how to do >> that. > > What? > > Seriously? You're saying it

weighted mean; weighted standard error of the mean (sem)

2010-09-09 Thread C Barrington-Leigh
I am looking for some reaally basic statistical tools. I have some sample data, some sample weights for those measurements, and I want to calculate a mean and a standard error of the mean. Here are obvious places to look: numpy scipy.stats statsmodels It seems to me that numpy's "mean" and "aver

Re: weighted mean; weighted standard error of the mean (sem)

2010-09-09 Thread C Barrington-Leigh
appy to have > new contributors, but be sure to discuss the problem first, as the > folk over there might be able to provide a solution which doesn't > require a new patch. Thanks, Tim, Ooops -- the sem() I mentioned is sciypy.stats.sem, not in numpy... Does your advice hold? Thanks, c --

"pointlabel"-like function for Python: distribute text labels on a 2-d scatter plot to avoid overlapping labels

2010-09-12 Thread C Barrington-Leigh
Python? Thanks, c -- http://mail.python.org/mailman/listinfo/python-list

Re: "pointlabel"-like function for Python: distribute text labels on a 2-d scatter plot to avoid overlapping labels

2010-09-12 Thread C Barrington-Leigh
http://meta.wikimedia.org/wiki/Map_generator#Placing_labels Anything better? c -- http://mail.python.org/mailman/listinfo/python-list

SysLogHandler message formatting

2010-10-06 Thread Dustin C. Hatch
compatibility with all syslog daemons. I found a couple of examples[2][3] of people describing the usage of SysLogHandler, but none of them mention a problem with formatting. Any thoughts or suggestions would be appreciated. I will patch my program to use the latter format string for now, but I would still

Re: SysLogHandler message formatting

2010-10-08 Thread Dustin C. Hatch
On Oct 7, 6:18 am, Vinay Sajip wrote: > Thanks for the detailed report. I tried posting a response a couple of times, > but Google appears to have swallowed it ... trying again. Sorry if it results > in > multiple responses. I tried to respond yesterday, but I also noticed this probelm. > The S

Re: SysLogHandler message formatting

2010-10-08 Thread Dustin C. Hatch
On Oct 7, 6:18 am, Vinay Sajip wrote: > Thanks for the detailed report. I tried posting a response a couple of times, > but Google appears to have swallowed it ... trying again. Sorry if it results > in > multiple responses. Hmm, I too seem to be experiencing this problem... > The SysLogHandler

Re: SysLogHandler message formatting

2010-10-08 Thread Dustin C. Hatch
On Oct 7, 6:18 am, Vinay Sajip wrote: > Thanks for the detailed report. I tried posting a response a couple of times, > but Google appears to have swallowed it ... trying again. Sorry if it results > in > multiple responses. Hmm, I too seem to be experiencing this problem... > The SysLogHandler

Mathematical Operations on Array

2011-04-01 Thread Fodness, Bryan C - GS
) does not. I receive the following Traceback (most recent call last): File "C:\ test.py", line 6, in ? mincos=degrees(acos(float(data[:,0]))) TypeError: only length-1 arrays can be converted to Python scalars Can anyone tell me what I am doing wrong?

EuroPython 2018: First list of accepted sessions available

2018-05-31 Thread Alexander C. S. Hendorf
We have received an amazing collection of 376 proposals. Thank you all for your contributions! Given the overwhelming quality of the proposals, we had some very difficult decisions to make. Nonetheless we are happy to announce we have published the first 120+ sessions. https://ep2018.europython.eu

RE: Developing Commercial Applications in Python

2005-01-03 Thread Delaney, Timothy C (Timothy)
Christophe Cavalaria wrote: > [EMAIL PROTECTED] wrote: > >> Hello All, >> I am trying to convince my client to use Python in his new product. >> He is worried about the license issues. Can somebody there to point >> me any good commercial applications developed using python ?. The >> licence clea

RE: interpreter Py_Initialize/Py_Finalize mem leak?

2005-01-09 Thread Delaney, Timothy C (Timothy)
Roman Suzi wrote: > In pure curiosity I tried to compile loop.c from Demo/embed > and started it with 'print 2+2'. It seems, that both 2.3 and 2.4 > pythons have memory leaks in Py_Initialize/Py_Finalize calls. > (That is, interpreter doesn't clean up well after itself). What's your evidence for

RE: shutil.move has a mind of its own

2005-01-10 Thread Delaney, Timothy C (Timothy)
Daniel Bickett wrote: > shutil.move( "C:\omg.txt" , "C:\folder\subdir" ) ^ ^^ ^ The problem is that backslash is the escape character. In particular, '\f' is a form feed. >>> '\o' '\\o' &

RE: sorted (WAS: lambda)

2005-01-13 Thread Delaney, Timothy C (Timothy)
Terry Reedy wrote: > No, not same difference. A list method would only operate on lists, > as is true of all list methods. Being a function lets it work for > any iterable, as is true of any function of iterable. Big > difference. And consistent. One could argue though that it should > have be

RE: generator expressions: performance anomaly?

2005-01-16 Thread Delaney, Timothy C (Timothy)
Raymond Hettinger wrote: > Check out the current source. The time machine beat you to it. Nick's other suggestion - that genexps propagate __len__ - might still be interesting. Of course, it would only be applicable for unconditional genexps(i.e. no if clause). Tim Delaney -- http://mail.python

RE: fefinining % of c'm'y and k

2005-01-16 Thread Delaney, Timothy C (Timothy)
orang defin the cmyk in % > like that: (example) > c: 30% > m:56% > y:78% > k: 10% This site will assist you greatly. http://www.catb.org/~esr/faqs/smart-questions.html Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Distutils: blurring the file==module borders

2005-01-24 Thread Delaney, Timothy C (Timothy)
Frans Englich wrote: > in ./foo/ I have an __init__.py and a handful of files named > ClassA.py, ClassB.py, ClassC.py and so forth. > > import foo.ClassA > > var = foo.ClassA.ClassA() > > while I want to do var = foo.ClassA() > > In other words, the result I want can be achieved by putting all

RE: On benchmarks, heaps, priority queues

2005-01-26 Thread Delaney, Timothy C (Timothy)
ter there ... (Raymond Hettinger rewrote it all in C). http://www.python.org/2.4/highlights.html Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Which is faster?

2005-01-26 Thread Delaney, Timothy C (Timothy)
Aggelos I. Orfanakos wrote: > Any idea which of the following is faster? > > 'a/b/c/'[:-1] > > or > > 'a/b/c/'.rstrip('/') > > Thanks in advance. > > P.S. I could time it but I thought of trying my luck here first, in > case

RE: Pystone benchmark: Win vs. Linux (again)

2005-01-30 Thread Delaney, Timothy C (Timothy)
Franco Fiorese wrote: > * Windows XP Pro: 16566.7 pystones/second > * Linux (kernel 2.6.9 NPTL): 12346.2 pystones/second First of all, realise that pystone is not meant to be a general-purpose benchmarking program. It test a specific, *small* subset of the functionality available in Python.

RE: Next step after pychecker

2005-02-01 Thread Delaney, Timothy C (Timothy)
huy wrote: > do not yet have good coverage. TDD is a quite hard to practice as a > beginner. It's even harder to bolt onto an existing codebase :( Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Why does super() require the class as the first argument?

2005-02-06 Thread Delaney, Timothy C (Timothy)
Nick Coghlan wrote: > It *is* possible to eliminate the explicit class argument, but it > takes a bit (*cough*) of work: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286195 Nick - you stole my thunder ;) Note that my recipe uses a sys._getframe() hack, so it will never be in Python

RE: Alternative to standard C "for"

2005-02-06 Thread Delaney, Timothy C (Timothy)
[EMAIL PROTECTED] wrote: > 2) for i in range(A, B, STEP): > ...do something... Note that the most common use of this is something like: t = 1, 2, 3 for i in range(len(t)): print i, t[i] This is best accomplished as: t = 1, 2, 3 for i, e in enumerate(t): p

RE: strange behaviour with decorators.

2005-02-09 Thread Delaney, Timothy C (Timothy)
Antoon Pardon wrote: > Ah, yes, the penny dropped. The try: except where there because > originally there were other statements I wanted to test and I > didn't want the raise exception by the inc(-2) stop the script. > I completely forget to consider it would also catch the > error I was expecting

RE: [N00B] What's %?

2005-02-10 Thread Delaney, Timothy C (Timothy)
Harlin wrote: > In the mode of anticipating another question... I get these all the > time at work of all places! You'd think IT workers would know the > answer to these... > > What good is the modulus operator? What would I ever need it for? # Print a summary every 100 rows for i in range(1, 10

RE: custom classes in sets

2005-02-13 Thread Delaney, Timothy C (Timothy)
vegetax wrote: > def __hashcode__(s): return s.path.__hashcode__() Try __hash__ ... Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-14 Thread Delaney, Timothy C (Timothy)
Stephen Kellett wrote: > In message <[EMAIL PROTECTED]>, Ilias Lazaridis > <[EMAIL PROTECTED]> writes >>> And yet there is not one company that has someone devoted full-time >>> to developing Python. Not even Guido. >> >> Who's "Guido"? > > LOL Falling off my chair!! See, the problem is t

RE: Inheritance error in python 2.3.4???

2005-02-14 Thread Delaney, Timothy C (Timothy)
[EMAIL PROTECTED] wrote: > I guess I could just use one underscore but that means it is > easier for other people to get at my implementation details (which, > coming from a C++ background really bothers me). This is the correct solution, and getting over being bothered about

RE: Why doesn't join() call str() on its arguments?

2005-02-16 Thread Delaney, Timothy C (Timothy)
John Roth wrote: > result = "".join([str(x) for x in list]) As of 2.4, you should use a generator expression here instead (unless you require backwards-compatibility with 2.3). result = ''.join(str(x) for x in iterable) Easier to read, more memory-efficient, potentially faster (depending on

RE: parameter name conflict. How to solve?

2005-03-07 Thread Delaney, Timothy C (Timothy)
Steven Bethard wrote: >> If you ask: why do you choose these names? The answer is: they need >> to be conformable with other functions, parameter names. Is this a style guide thing? >> I have a function that pretty much like: >> >> def output(output=''): >> print output >> >> and now in anot

RE: Default function arguments, KURL::cleanPath() -- a bindings bug?

2005-03-07 Thread Delaney, Timothy C (Timothy)
Frans Englich wrote: > Apparently, cleanPath /requires/ a boolean argument, but the C++ > function definition says: > > void cleanPath(bool cleanDirSeparator = true); Most likely that cleanPath's default parameter hasn't been declared to *Python*. If so, I expect this

RE: Best way to make a list unique?

2005-03-08 Thread Delaney, Timothy C (Timothy)
Diez B. Roggisch wrote: > No. But I doubt that that is what you actually want, as listA will > lose its order afterwards. Typically, something like that gets > written like this: This is actually one thing that Java 1.5 has that I'd like to see in Python - the LinkedHashSet and LinkedHashMap. Ve

RE: parameter name conflict. How to solve?

2005-03-08 Thread Delaney, Timothy C (Timothy)
Bo Peng wrote: >> Is this a style guide thing? >> >> Why not just: >> >> def func(output_param=''): >> output(output=output_param) >> > > This is exactly the problem. There are a bunch of other functions that > use output='' parameter. Changing parameter name for this single > function may

RE: Best way to make a list unique?

2005-03-08 Thread Delaney, Timothy C (Timothy)
Steven Bethard wrote: > Sounds like a good candidate for the collections module. Of course > someone will need to implement it. ;) I'll suggest it to Raymond ... ;) Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Best way to make a list unique?

2005-03-08 Thread Delaney, Timothy C (Timothy)
Michael Hoffman wrote: >>> For those who don't know, these implement a hash set/map which >>> iterates in the order that the keys were first added to the set/map. > > I would love to see such a thing. I've proposed this on python-dev, but the general feeling so far is against it. So far the only

RE: Conversion to string: how do `s work?

2005-03-14 Thread Delaney, Timothy C (Timothy)
Chris Lasher wrote: > I'm working my way through _Learning_Python_ 2nd ed., and I saw > something peculiar which is not explained anywhere in the text. > > print " " + file + " size=" + `size` > > The `s appear to somehow automagically convert the integer to a string > for concatenation. How doe

RE: code for Computer Language Shootout

2005-03-16 Thread Delaney, Timothy C (Timothy)
Jacob Lee wrote: >> # alias methods to avoid repeated lookup >> join = ''.join I would actually do the alias here sometimes, but give it a semantically-useful name ... nosep_join = ''.join ... Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: decorators ?

2004-12-02 Thread Delaney, Timothy C (Timothy)
Michael Hudson wrote: > Skip Montanaro <[EMAIL PROTECTED]> writes: > >> Jacek> Anything you can do with decorators, you could do before >> (with Jacek> the exception of rebinding the __name__ of >> functions). >> >> And while that feature was added because we realized it would be >> nic

RE: How is Python designed?

2004-12-02 Thread Delaney, Timothy C (Timothy)
Roy Smith wrote: > As far as I can tell, the process works like this: > > Guido has an idea for something he wants to do and announces it. > > Everybody beats him up about it. > > He goes ahead and does it anyway. > > It's a strange process, but it seems to work. It's not quite that straightf

<    6   7   8   9   10   11   12   >