Re: [Tutor] os.listdir fn

2004-12-10 Thread Nandan
> It does if you use the glob module :-) > > Python, with batteries included. > But sometimes finding the right battery can be challenging... > Muttering 'globbing is a Perl concept, listing dirs must be in file ops' I turned first to the Files section of the Nutshell book :-) But I came up with t

Re: [Tutor] Complex roots

2004-12-10 Thread Tim Peters
[Dick Moores] > Aw, that's just amazing. Well, complex numbers are amazing in many ways. The code is actually obvious, if you understand the motivation. Polar coordinates are more natural for complex * / and **. If you a view a complex number c as a vector in the complex plane (from the origin

Re: [Tutor] Python 2.4 IDLE Windows 2000

2004-12-10 Thread EJP
Mike Hansen <[EMAIL PROTECTED]> wrote of an idle IDLE: > That rooted out the problem. A while ago, I changed the colors to kind > of match my VIM color theme(ps_color). When I did > idlelib.PyShell.main(), IDLE came up with my custom color theme. > However, there was a bunch of warnings about m

[Tutor] (Self resolved) os.spawn behaviorism issue

2004-12-10 Thread David Broadwell
Further note: widen the window, this has long strings in it ... and is PURELY for edification. To work around a problem between my ISP and my router, I have to make my router RELogin the PPPoE every time the wan ip changes. Which is not hard, it's a http string in a browser to log in, followed by

Re: [Tutor] Re: Could I have used time or datetime modules here?

2004-12-10 Thread Liam Clarke
Hi Dick, I'm ccing this to the list, for the experienced people to comment on . Traceback (most recent call last): >File "", line 1, in -toplevel- > import pygame >File "C:\Python24\lib\site-packages\pygame\__init__.py", line 64, in > -toplevel- > from pygame.base import * > Im

Re: [Tutor] os.listdir fn

2004-12-10 Thread Alan Gauld
> That is, filename globbing doesn't seem to work. Looks like I'll have to > use map/filter to do this. Is there a better way? It does if you use the glob module :-) Python, with batteries included. But sometimes finding the right battery can be challenging... Alan G. > > Thanks, > N > > -- >

Re: [Tutor] maximum value in a Numeric array

2004-12-10 Thread Alan Gauld
> I am trying to get the maximum value in a 2-D array. I can use max but it > returns the 1-D array that the max value is in and I then I need to do max > again on that array to get the single max value. > > There has to be a more straightforward way...I have just not found it. > I could also flat

RE: [Tutor] maximum value in a Numeric array

2004-12-10 Thread Ertl, John
All, Thanks for the help...I am using the older Numeric 23.4. I have some stuff that cannot use Numarray yet. Numeric does not seam to have the same functionality. Happy Holidays. John Ertl -Original Message- From: Danny Yoo [mailto:[EMAIL PROTECTED] Sent: Friday, December 10, 2004 11

[Tutor] (Self resolved) os.spawn behavior issue

2004-12-10 Thread David Broadwell
Further note: widen the window, this has long strings in it ... and is PURELY for edification. To work around a problem between my ISP and my router, I have to make my router RELogin the PPPoE every time the wan ip changes. Which is not hard, it's a http string in a browser to log in, followed by

Re: [Tutor] maximum value in a Numeric array

2004-12-10 Thread Danny Yoo
On Fri, 10 Dec 2004, Ertl, John wrote: > I am trying to get the maximum value in a 2-D array. I can use max but > it returns the 1-D array that the max value is in and I then I need to > do max again on that array to get the single max value. > > There has to be a more straightforward way...I h

Re: [Tutor] maximum value in a Numeric array

2004-12-10 Thread Kent Johnson
Are you using numarray? If so, there appears to be a max method of an array, so you can try b = array([[1,2],[3,4]]) b.max() Note that your method of finding the max row, then finding the max in the row, will not in general give the correct result. Sequences are compared lexicographically - the f

[Tutor] maximum value in a Numeric array

2004-12-10 Thread Ertl, John
All, I am trying to get the maximum value in a 2-D array. I can use max but it returns the 1-D array that the max value is in and I then I need to do max again on that array to get the single max value. There has to be a more straightforward way...I have just not found it. >>> b = array([[1,2],

Re: [Tutor] os.listdir fn

2004-12-10 Thread Kent Johnson
Have you looked at the glob module? >>> import glob >>> glob.glob('src/*.properties') ['src\\jdbc.properties', 'src\\jdbc_local.properties', 'src\\jdbc_qa.properties', 'src\\jdbc_test.properties', 'src\\log4j.jnlp.properties', 'src\\log4j.properties', 'src\\version.properties'] Kent Nandan wrote

[Tutor] How to get input from Tkinter app ?

2004-12-10 Thread David Holland
Here is an example create a function eg createwidgets(self) with code like     self.question_ent = Entry(self)    self.question_ent.grid(row=0, column = 4, columnspan = 2, sticky = W) Then in another function eg getinfo(self) which is fired off by a button or something write code like :-

[Tutor] os.listdir fn

2004-12-10 Thread Nandan
Hello I need to get the equivalent of 'ls script.icons/*.script' I looked around in the os module but can't find anything appropriate. That is, filename globbing doesn't seem to work. Looks like I'll have to use map/filter to do this. Is there a better way? Thanks, N -- Nandan Bagchee Patri

Re: [Tutor] Complex roots

2004-12-10 Thread Dick Moores
Oops. Make that croots3.py (). I forgot a couple of abs's. For example, "if n.imag < 1e-13:" is changed to "if abs(n.imag) < 1e-13:" Dick Dick Moores wrote at 07:38 12/10/2004: I've modified croots.py to croots2.py (

Re: [Tutor] Complex roots

2004-12-10 Thread Dick Moores
I've modified croots.py to croots2.py () The only changes are in the testCrootsResult function. It will ignore very small .imag or .real when printing. Thus this result: Enter either a complex number in form x + yj, or a

Re: [Tutor] MemoryError

2004-12-10 Thread Liam Clarke
Yeah, that's a bit of a brute force approach alright. Mainly all the (\n)?(=\n)?... I, personally, intend to have words with a Mr William Gates regarding just what horrors Frontpage inflicts. I also intend to discuss this with gmail.google.com, as they parsed the text attachment I sent myself, add

[Tutor] Graphics coordinates (bump?)

2004-12-10 Thread Ron Phillips
I sent the following yesterday, but since it was my first request to the list, I got an autoreply. It never showed up in my digest of the list, and I haven't seen a response. It's in the archives, but I am thinking that archiving/autoreply was all that happened (no actual posting.)    Anyway,

Re: [Tutor] MemoryError

2004-12-10 Thread Kent Johnson
Well, that's a regex only a mother could love. :-) I can see why you were happy to find the (?P) form of grouping. You should compile textObj and urlObj outside of getVals. You could just pull the four lines that create textObj and urlObj outside of the function (into global scope). You just hav

[Tutor] How to get input from Tkinter app ?

2004-12-10 Thread Mark Kels
Hi all, I got 2 questions: 1. How to get input from Tkinter widgets like Text, Entry, Checkbutton, Scale etc (almost any widget that isn't a button) ? for some reason its not explained clearly in any tutor I looked in... 2. How to print text using python ( through the printer ) ? __

[Tutor] Re: PDF and Python

2004-12-10 Thread Ron Phillips
I just happened across an answer yesterday. PIL writes PDF s.   http://www.pythonware.com/products/pil/   Ron ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] MemoryError

2004-12-10 Thread Liam Clarke
Hi Kent, Thanks for the help, it worked third time around! The final product is here if you have an interest - http://www.rafb.net/paste/results/XCYthC70.html But, I think I found a new best friend for this sort of thing - (?P.*?) Being able to label stuff is brilliant. But yeah, thanks fo

Re: [Tutor] Complex roots

2004-12-10 Thread Dick Moores
Aw, that's just amazing. I put your function in http://www.rcblue.com/Python/croots.py, which gets c and n from user and adds a test function. Here's what one run produces: Enter either a complex number in form x + yj, or a real number: 3.1 -1j Enter an intege

Re: [Tutor] PDF and Python

2004-12-10 Thread nick
Quoting Kent Johnson <[EMAIL PROTECTED]>: > The reportlab toolkit is frequently recommended, though I haven't tried it > myself. > http://www.reportlab.org/ > > Kent Whoa ! Just has a play with that ReportLab toolkit and it looks well funky. It makes creating simple PDF's a doddle. Thanks for th