Re: py2exe compression not working with Python 2.5

2006-09-22 Thread nikie
Thomas Heller wrote: > nikie schrieb: > > When I try to compress the output of py2exe like this: > > > > from distutils.core import setup > > import py2exe > > > > setup(console=['hello.py'], options={"py2exe": {"compre

py2exe compression not working with Python 2.5

2006-09-22 Thread nikie
When I try to compress the output of py2exe like this: from distutils.core import setup import py2exe setup(console=['hello.py'], options={"py2exe": {"compressed": 1}}) I get strange error messages: Adding zlib.pyd to C:\tests\CanControllerTest\New Folder (2)\dist\library.zip Traceback (m

Re: Fastest Way To Loop Through Every Pixel

2006-07-31 Thread nikie
Paul McGuire wrote: > "Chaos" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > > Paul McGuire wrote: > > > "Paul McGuire" <[EMAIL PROTECTED]> wrote in message > > > news:[EMAIL PROTECTED] > > > > "Chaos" <[EMAIL PROTECTED]> wrote in message > > > > news:[EMAIL PROTECTED] > > > >

Re: Fastest Way To Loop Through Every Pixel

2006-07-31 Thread nikie
Chaos wrote: > nikie wrote: > > Chaos wrote: > > > > > As my first attempt to loop through every pixel of an image, I used > > > > > > for thisY in range(0, thisHeight): > > > for thisX in range(0, thisWidth): > >

Re: Fastest Way To Loop Through Every Pixel

2006-07-28 Thread nikie
Chaos wrote: > As my first attempt to loop through every pixel of an image, I used > > for thisY in range(0, thisHeight): > for thisX in range(0, thisWidth): > #Actions here for Pixel thisX, thisY > > But it takes 450-1000 milliseconds > > I want speeds less t

Re: Wxpython, using more than 1 timer?

2006-07-22 Thread nikie
janama wrote: > Hi all, > > Using wx > When adding a second timer as i have the first, the second timer > adding stops the first timer (updating or stops?) . In this example im > updating a uptime and localtime label. It works fine for displaying the > last "self.startTimer2()" called. But preve

Re: Which compiler will Python 2.5 / Windows (Intel) be built with?

2006-06-15 Thread nikie
[EMAIL PROTECTED] wrote: > Hi everyone, > > which compiler will Python 2.5 on Windows (Intel) be built with? I > notice that Python 2.4 apparently has been built with the VS2003 > toolkit compiler, and I read a post from Scott David Daniels [1] where > he said that probably the VS2003 toolkit will

Re: Python less error-prone than Java

2006-06-04 Thread nikie
Christoph Zwerschke wrote: > nikie wrote: > > Let's look at two different examples: Consider the following C# code: > > > > static decimal test() { > >decimal x = 10001; > >x /= 100; > >x -= 100; > >return x; > > &g

Re: Python less error-prone than Java

2006-06-04 Thread nikie
Let's look at two different examples: Consider the following C# code: static decimal test() { decimal x = 10001; x /= 100; x -= 100; return x; } It returns "0.01", as you would expect it. Now, consider the python equivalent: def test(): x = 10001 x /= 100 x -= 100 ret

Re: Watching serial port activity.

2006-05-30 Thread nikie
xkenneth wrote: > Hi, > >I'm writing a couple python applications that use the serial port > (RS-232) quite extensively. Is there any way I can monitor all activity > on the serial port and have it printed as the transactions occur? I'm > trying to reverse engineer a microcontroller serial rou

Re: Watching serial port activity.

2006-05-30 Thread nikie
xkenneth wrote: > Hi, > >I'm writing a couple python applications that use the serial port > (RS-232) quite extensively. Is there any way I can monitor all activity > on the serial port and have it printed as the transactions occur? I'm > trying to reverse engineer a microcontroller serial rou

Re: Software Needs Philosophers

2006-05-21 Thread nikie
Xah Lee wrote: > Software Needs Philosophers > > by Steve Yegge, 2006-04-15. > > Software needs philosophers. > > This thought has been nagging at me for a year now, and recently it's > been growing like a tumor. One that plenty of folks on the 'net would > love to see kill me. No, we all wish yo

Re: which windows python to use?

2006-05-11 Thread nikie
Brian Blais wrote: > Hello, > > Are there any recommendations for which Windows python version to use? I'd > like to > see a pros-and-cons description of each, given that different uses might > dictate > different versions. The versions I know (and there are surely more) are: > > 1) download f

Re: Multi-line lambda proposal.

2006-05-10 Thread nikie
Kaz Kylheku wrote: > Kaz Kylheku wrote: > > But suppose that the expression and the multi-line lambda body are > > reordered? That is to say, the expression is written normally, and the > > mlambda expressions in it serve as /markers/ indicating that body > > material follows. This results in the

Re: How to get a part of string which follows a particular pattern using shell script

2006-05-08 Thread nikie
Hari wrote: > Hi all, > > I need to get a part of string which follows a pattern 'addr=' > > > For example: > > > a)test="192.168.1.17:/home/ankur/nios_fson/mnt/tmptype > nfs(rw,addr=192.168.1.17)" > b)test="/dev/root on / typr nfs > (rw,v2,rsize=1024,wsize=1024,hard,udp,nolock,addr=192.168.1.93)"

Re: Can I use python for this .. ??

2006-05-05 Thread nikie
san wrote: > Hi > > I am using windows xp and have installed python and win32. I am > familiar with basic Python. I wanted to control some of the > applications via python script. > > I would like to write a python script to say: > 1. Open firefox and log on to gmail > 2. Another firefox window to

Re: best way to determine sequence ordering?

2006-04-29 Thread nikie
Steven Bethard wrote: > nikie wrote: > > Steven Bethard wrote: > > > >> nikie wrote: > >>> Steven Bethard wrote: > >>> > >>>> John Salerno wrote: > >>>>> If I want to make a list of four items, e.g. L = ['

Re: self modifying code

2006-04-29 Thread nikie
Robin Becker schrieb: > When young I was warned repeatedly by more knowledgeable folk that self > modifying code was dangerous. > > Is the following idiom dangerous or unpythonic? > > def func(a): > global func, data > data = somethingcomplexandcostly() > def func(a): > ret

Re: best way to determine sequence ordering?

2006-04-29 Thread nikie
Steven Bethard wrote: > nikie wrote: > > Steven Bethard wrote: > > > >> John Salerno wrote: > >>> If I want to make a list of four items, e.g. L = ['C', 'A', 'D', 'B'], > >>> and then figure out if

Re: best way to determine sequence ordering?

2006-04-28 Thread nikie
I V wrote: > On Fri, 28 Apr 2006 14:27:00 -0700, nikie wrote: > > Steven Bethard wrote: > > > >> >>> L = ['C', 'A', 'D', 'B'] > >> >>> positions = dict((item, i) for i, item in enumerate(L)) > > D

Re: best way to determine sequence ordering?

2006-04-28 Thread nikie
Steven Bethard wrote: > John Salerno wrote: > > If I want to make a list of four items, e.g. L = ['C', 'A', 'D', 'B'], > > and then figure out if a certain element precedes another element, what > > would be the best way to do that? > > > > Looking at the built-in list functions, I thought I could

Re: Events in Python?

2006-04-26 Thread nikie
[EMAIL PROTECTED] wrote: > Here is another non-pythonic question from the Java Developer. (I beg > for forgiveness...) > > Does Python have a mechanism for events/event-driven programming? > > I'm not necessarily talking about just GUIs either, I'm interested in > using events for other parts of a

Re: Best way to have a for-loop index?

2006-04-05 Thread nikie
Roy Smith wrote: > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] wrote: > > > I write a lot of code that looks like this: > > > > for myElement, elementIndex in zip( elementList, > > range(len(elementList))): > > print "myElement ", myElement, " at index: ",elementIndex > > > > > > My q

Re: Identifying filled circles in a scanned image

2006-03-30 Thread nikie
Douglas Douglas schrieb: > Hi everybody. > > I have a paper form that I scan into an image. My user fills some circles in > this paper form using black ink. Every form has ten rows with five circles > each > and the user fills only one circle for each row. > > I was wondering if I could use the P

Re: PIL ImageDraw line not long enough

2006-03-30 Thread nikie
Bob Greschke wrote > I've resorted to actually drawing all of the characters of the alphabet on a > graph to avoid having to drag around font files. It's mostly just uppercase > characters, so it's not too bad. > > But I noticed that some of the line segments have to be extended one pixel > longe

Re: Find similar images using python

2006-03-29 Thread nikie
> How can I use python to find images that looks quite similar? Thought > I'd scale the images down to 32x32 and convert it to use a standard > palette of 256 colors then compare the result pixel for pixel etc, but > it seems as if this would take a very long time to do when processing > lots of im

Re: encode short string as filename (unix/windows)

2006-03-27 Thread nikie
> want to encode/decode an arbitrary short 8-bit string as save filename. > is there a good already builtin encoding to do this (without too much > inflation) ? or re.sub expression? > > or which characters are not allowed in filenames on typical OS? On Windows, / \ : * ? " < > | are forbidden, a

Re: PIL & image size reduction script

2006-03-27 Thread nikie
Philippe Martin wrote: > PS: where can I find those extra parameters in the doc (ex: quality) ... I > must be blind. In the http://www.pythonware.com/library/pil/handbook/formats.htm page. Look in the "JPEG" section. Different file formats support different options. -- http://mail.python.org/mail

Re: PIL & image size reduction script

2006-03-26 Thread nikie
Philippe Martin wrote: > Hi, > > Thanks to the NG, I got the script hereunder working. > > 1) I am not certain that the call to convert does much (checking the doc) I think you only need it if your source image comes in a format that can't be stored into a jpeg file (e.g. 8-bit paletted). You'll n

Re: Python float representation error?

2006-03-26 Thread nikie
> try running this in python: > > print [39.95] > > the output i get is: > [39.953] > > what's up with that? That's perfectly normal - some numbers aren't exactly expressible as binary floating points, just like 1/3 isn't expressible as a decimal floating point number. Here's a good l

Re: using "else: interactive programme

2006-03-26 Thread nikie
I guess the indention got mixed up in your post, if I try to run it, I get error messages at each of the "else:" lines, because they're mis-indented. "else" should be indented like the "if" it belongs to, e.g (using underscores for spaces): if s=='10': print "well done" else: print "somethi

Re: Linear regression in NumPy

2006-03-24 Thread nikie
> The version I have in front of me is a bit shorter, 252 pages, but describes > polyfit in section 5.3 on page 91 along with the other polynomial functions. > lstsq (linear_least_squares is a backwards-compatibility alias that was > recently > moved to numpy.linalg.old) is described in section 10

Re: Linear regression in NumPy

2006-03-24 Thread nikie
Robert Kern wrote: > Both functions are described in the full book. Were you just looking at the > sample chapter? No, I've got the full PDF by mail a few days ago, "numpybook.pdf", 261 pages (I hope we're talking about the same thing). I entered "linear_least_squares" and "polyfit" in acrobat's "

Re: Linear regression in NumPy

2006-03-23 Thread nikie
Although I think it's worth reading, it only covers the fundamental structure (what arrays are, what ufuncs are..) of NumPy. Neither of the functions dicussed in this thread (polyfit/linear_least_squares) is mentioned in the file. -- http://mail.python.org/mailman/listinfo/python-list

Re: Linear regression in NumPy

2006-03-18 Thread nikie
Thank you! THAT's what I've been looking for from the start! -- http://mail.python.org/mailman/listinfo/python-list

Re: Linear regression in NumPy

2006-03-17 Thread nikie
I still don't get it... My data looks like this: x = [0,1,2,3] y = [1,3,5,7] The expected output would be something like (2, 1), as y[i] = x[i]*2+1 (An image sometimes says more than 1000 words, so to make myself clear: this is what I want to do: http://www.statistics4u.info/fundstat_eng/cc_regr

Linear regression in NumPy

2006-03-17 Thread nikie
I'm a little bit stuck with NumPy here, and neither the docs nor trial&error seems to lead me anywhere: I've got a set of data points (x/y-coordinates) and want to fit a straight line through them, using LMSE linear regression. Simple enough. I thought instead of looking up the formulas I'd just se