[Tutor] suggestion for group project

2004-12-17 Thread Brian van den Broek
Hi all, A while ago, in a response: Danny Yoo said unto the world upon 2004-11-29 17:14: I just got in contact with Nick Parlante of the Nifty Assignments project; he's been collecting material on fun projects: http://nifty.stanford.edu/ The projects there look pretty nice. In fact, I'm thinking o

Re: [Tutor] "TypeError: 'int' object is not callable"??

2004-12-17 Thread Kent Johnson
Jacob S. wrote: Ha! That's what I was looking for! The builtin apply function! The only way I could send the *args to the function was through a list, and function calls see a list as one argument. The apply argument doesn't! Thanks Bob. apply() is deprecated; it has been replaced by 'extended call

Re: [Tutor] dbcp module

2004-12-17 Thread Kent Johnson
Please describe what you are looking for. A python version of the Jakarta Database Connection Pool? Kent Rene Bourgoin wrote: Yah i came across that site and was trying to learn from that code. I just cant seem to find a download for a python version. i came across this site while searching. htt

[Tutor] Nifty

2004-12-17 Thread Matt Williams
I'd be interested, Matt On Fri, 2004-12-17 at 11:01, [EMAIL PROTECTED] wrote: > Send Tutor mailing list submissions to > [EMAIL PROTECTED] > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/tutor > or, via email, send a message with

Re: [Tutor] Nifty

2004-12-17 Thread David Broadwell
>> I just got in contact with Nick Parlante of the Nifty >> Assignments project; he's been collecting material on fun >> projects: >> >> http://nifty.stanford.edu/ > What do others think? Private channel or not, I'm in. (at least until classes spike up again in early February) Sounds like a good w

Re: [Tutor] A little Tkinter question

2004-12-17 Thread Marilyn Davis
On Wed, 15 Dec 2004, Gregor Lingl wrote: > > > Marilyn Davis schrieb: > > Hi Tutors, > > > > I'm reviewing GUIs and wondering: > > > > When you pack a component, and you specify fill = BOTH, how is this > > different from expand = YES? > > > Hi Marilyn, > This is a bit tricky and hard to exp

[Tutor] boa constructor font?

2004-12-17 Thread Jeff Peery
my eyes are going bad... anyone know how to change the font size in the editor window of the boa constructor? this seems to be a simple but not easy thing to do. thanks!   Jeff___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinf

Re: [Tutor] Python structure advice ?

2004-12-17 Thread Dave S
Kent Johnson wrote: Dave S wrote: Dave S wrote: The 'remembering where is was' seems a continuous stumbling block for me. I have though of coding each module as a class but this seems like a cheat. I could declare copious globals, this seems messy, I could define each module as a thread & get th

RE: [Tutor] least squares

2004-12-17 Thread Danny Yoo
On Thu, 16 Dec 2004, mdcooper wrote: > I am trying to get a corrolation between a large number of variables and for > many similar equations : >(Ca1 * xa^2) + (Ca2 * ya^2) + (Ca3 * za^2) + ... = ta >(Cb1 * xb^2) + (Cb2 * yb^2) + (Cb3 * zb^2) + ... = tb > > which is solved to get: >(

Re: [Tutor] Python structure advice ?

2004-12-17 Thread Jeff Shannon
Dave S wrote: Kent Johnson wrote: Why do you say this is 'cheaty'? A class is basically a collection of data (state) and functions to operate on that state. Sorry for the delay, real world work got in the way ... Well I understand classes to be used when multiple instances are required, I will o

[Tutor] Re: Opening and reading .cvs files in Python

2004-12-17 Thread Shantanoo Mahajan
+++ Johan Geldenhuys [14-12-04 15:18 +0200]: | Hi, | I want to find out how to open a .cvs file on a remote Windows machine | and get file to my local linux folder. .cvs file?? | | Any help would be appreciated. | -- |Johan | | -- | This E-Mail has been scanned. | Enjoy Your Day. |

[Tutor] Polish translation of my tutor

2004-12-17 Thread Alan Gauld
Are there any Polish speakers on the tutor list who would like to check a new version of my tutorial? There are no formal links to it yet as there are only a few pages but it can be found at: http://www.freenetpages.co.uk/hp/alan.gauld/polish/ And any feedback can be sent to me and I'll forward

[Tutor] About Perl's Integer module

2004-12-17 Thread Mohamed Lrhazi
Hello all, I ported to python a little Perl script that applies some math algorithm that I do not understand... My version seems to give the same results as the Perl version... but just to make sure I am asking the following: The Perl version starts by testing whether Perl is in integer mode or

Re: [Tutor] Python structure advice ?

2004-12-17 Thread Dave S
Sorry for the delay, real world work took me away ... everything was global, how you guys handle a modern structured language Don't worry this is one of the hardest bad habits to break. You are not alone. The easiest way is to just pass the data from function to function in the function pa

Re: [Tutor] Python structure advice ?

2004-12-17 Thread Dave S
Jeff Shannon wrote: Dave S wrote: Kent Johnson wrote: Why do you say this is 'cheaty'? A class is basically a collection of data (state) and functions to operate on that state. Sorry for the delay, real world work got in the way ... Well I understand classes to be used when multiple instances are

Re: [Tutor] About Perl's Integer module

2004-12-17 Thread Jeff Shannon
Mohamed Lrhazi wrote: Hello all, I ported to python a little Perl script that applies some math algorithm that I do not understand... My version seems to give the same results as the Perl version... but just to make sure I am asking the following: The Perl version starts by testing whether Perl

[Tutor] Tkinter questions

2004-12-17 Thread Mark Kels
Hi all , I got some Tkinter related questions for a project that I'm making: 1. How to add an image to a button ? 2. How can I print text using Tkinter (I want it to be cross platform, so I cant use modules like win32print ) ? 3. How to I make the program to always open in a full window ? Thanks a

Re: [Tutor] "TypeError: 'int' object is not callable"??

2004-12-17 Thread Jacob S.
Hey, could you give an example? Thanks, Jacob > > apply() is deprecated; it has been replaced by 'extended call syntax'. Instead of >apply(fn, args, kwds) > you can now write >fn(*args, **kwds) > > Kent > ___ > Tutor maillist - [EMAIL PROTECTED

RE: [Tutor] "TypeError: 'int' object is not callable"??

2004-12-17 Thread Christian Wyglendowski
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Jacob S. > Sent: Friday, December 17, 2004 3:54 PM > To: Kent Johnson > Cc: [EMAIL PROTECTED] > Subject: Re: [Tutor] "TypeError: 'int' object is not callable"?? > > Hey, could you give an example? > Th

Re: [Tutor] Python structure advice ?

2004-12-17 Thread Kent Johnson
Dave S wrote: Separate modules is good. Separate directories for anything other than big programs (say 20 or more files?) is more hassle than its worth. The files are better kept in a single directory IMHO. The exception being modules designed for reuse... It just makes life simpler! Ive tried t

Re: [Tutor] Polish translation of my tutor

2004-12-17 Thread Pawel Kraszewski
Dnia piątek, 17 grudnia 2004 20:59, Alan Gauld napisał: |Are there any Polish speakers on the tutor list who would like |to check a new version of my tutorial? There are no formal links |to it yet as there are only a few pages but it can be found at: That would be me. First of all content="text

Re: [Tutor] "TypeError: 'int' object is not callable"??

2004-12-17 Thread Kent Johnson
Jacob S. wrote: Hey, could you give an example? I'll try... Here is range with three explicit arguments >>> range(1, 10, 2) [1, 3, 5, 7, 9] Here is range with the arguments supplied in a list; it does the same thing >>> args = [1, 10, 2] >>> range(*args) [1, 3, 5, 7, 9] Here is an example with z

Re: [Tutor] "TypeError: 'int' object is not callable"??

2004-12-17 Thread Jacob S.
Thank you! Wait, though. How do I do this? def differentnoofvars(*args,**kwargs): ## By the way, is it **kwargs or **kwds? print kwargs another(kwargs) def another(**kwargs): for x,y in kwagrs.items(): print "%s = %s" % (x,y) a = ['a=2','f=3','t=[1,2,3]'] ## A list of kwa

Re: [Tutor] "TypeError: 'int' object is not callable"??

2004-12-17 Thread Jacob S.
Sorry about that last message. Kent just posted and answered my question with his example. Thank you all! Jacob > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Jacob S. > > Sent: Friday, December 17, 2004 3:54 PM > > To: Kent Johnson > > Cc: [

Re: [Tutor] "TypeError: 'int' object is not callable"??

2004-12-17 Thread Kent Johnson
Jacob S. wrote: Thank you! Wait, though. How do I do this? def differentnoofvars(*args,**kwargs): ## By the way, is it **kwargs or **kwds? Call it what you like, it's an ordinary function parameter. kwds is commonly used but you can use kwargs. print kwargs another(kwargs) Should be anoth

Re: [Tutor] Python structure advice ?

2004-12-17 Thread Alan Gauld
> For what it's worth, it seems to me to be perfectly normal to have > classes that are only ever intended to have a single instance. For > example, you're never likely to need more than one HTML parser, and > yet htmllib.HTMLParser is a class... That's true but the argument for a class in that c

Re: [Tutor] dbcp module

2004-12-17 Thread Rene Bourgoin
Yes i believe im looking for the python version of the Jakarta databse connection pool!! --- On Fri 12/17, Kent Johnson < [EMAIL PROTECTED] > wrote: From: Kent Johnson [mailto: [EMAIL PROTECTED] To: Cc: [EMAIL PROTECTED] Date: Fri, 17 Dec 2004 07:12:40 -0500 Subject: Re: [Tutor] dbcp m

Re: [Tutor] Python structure advice ?

2004-12-17 Thread Alan Gauld
> >1) batch oriented - each step of the process produces its own > >output file or data structure and this gets picked up by the > >next stage. Tis usually involved processing data in chunks > >- writing the first dump after every 10th set of input say. > > > I see your point, like a static chain,

Re: [Tutor] Tkinter questions

2004-12-17 Thread Alan Gauld
> I got some Tkinter related questions for a project that I'm making: > 1. How to add an image to a button ? I find the easiest way is to create an PhotoImage object attach the graphic file(jpg,bmp,gif) to that and assign the PhotoImage object to the Button.image property. You can "animate" the im

Re: [Tutor] dbcp module

2004-12-17 Thread Danny Yoo
On Fri, 17 Dec 2004, Rene Bourgoin wrote: > Yes i believe im looking for the python version of the Jakarta databse > connection pool!! Hi Rene, I haven't looked at this too closely yet, but there are projects out there for connection pools. For example: http://sqlrelay.sourceforge.net/

Re: [Tutor] Python structure advice ?

2004-12-17 Thread Dave S
Alan Gauld wrote: 1) batch oriented - each step of the process produces its own output file or data structure and this gets picked up by the next stage. Tis usually involved processing data in chunks - writing the first dump after every 10th set of input say. I see your point, like a static

Re: [Tutor] Python structure advice ?

2004-12-17 Thread Dave S
Kent Johnson wrote: Dave S wrote: Separate modules is good. Separate directories for anything other than big programs (say 20 or more files?) is more hassle than its worth. The files are better kept in a single directory IMHO. The exception being modules designed for reuse... It just makes life sim

Re: [Tutor] About Perl's Integer module

2004-12-17 Thread Mohamed Lrhazi
--On Friday, December 17, 2004 1:49 PM -0800 Jeff Shannon <[EMAIL PROTECTED]> wrote: I don't know perl, so I can't tell for certain, but I think so. However, there are many ways in which this could become more idiomatic Python code, and more efficient. Thanks so much for all the comments and the

Re: [Tutor] dbcp module

2004-12-17 Thread Rene Bourgoin
Ive been learning to interact with databases using python and i was looking for ways to return a SELECT query result in a plain format. what i mean by plain format is : name numberaddress Fred Smith 2125553243 1 main st All the pratices ive done return the results in tu

Re: [Tutor] dbcp module

2004-12-17 Thread Kent Johnson
The recipe you cite has the pp() function and an example of its use. It sounds like that is what you want. Kent Rene Bourgoin wrote: Ive been learning to interact with databases using python and i was looking for ways to return a SELECT query result in a plain format. what i mean by plain form

Re: [Tutor] least squares

2004-12-17 Thread Kent Johnson
Have you tried contacting the author of the Scientific package? His email address is on the main web page. Kent mdcooper wrote: Hi Danny, Thanks for the reply - I was purposely vague just to see what people would ask for. The code uses LinearAlgebra.py from Numeric and LeastSquares.py from Sci

Re: [Tutor] dbcp module

2004-12-17 Thread Danny Yoo
On Fri, 17 Dec 2004, Rene Bourgoin wrote: > Ive been learning to interact with databases using python and i was > looking for ways to return a SELECT query result in a plain format. what > i mean by plain format is : > > name numberaddress > Fred Smith 2125553243 1 main st

Re: [Tutor] dbcp module

2004-12-17 Thread Danny Yoo
On Fri, 17 Dec 2004, Kent Johnson wrote: > The recipe you cite has the pp() function and an example of its use. It > sounds like that is what you want. Part of the pandemonium was my fault. I completely missed your earlier post here: http://mail.python.org/pipermail/tutor/2004-December/0

Re: [Tutor] am I missing another simpler structure?

2004-12-17 Thread Terry Carroll
On Thu, 16 Dec 2004, Alan Gauld wrote: > In most debiggers ... So *that's* the trick to writing compact code! ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor