Re: [Tutor] Python Interest Group Query

2005-05-16 Thread Lee Cullens
Python Interest Group Query I'm aware of the Boston PIG, a smaller one in Amherst and have been told that there is possibly a PIG in Manchester, NH. Basically I'm trying to find out if there are any, or any interest in (or even any other Python users at all :~)) in a PIG in the northern NE

[Tutor] help with my python app

2005-05-16 Thread james middendorff
Hello, I would like to be able to use the arrow keys to control a remote control car, which I can do but only one key at a time. I would like to press the up key, then while it is moving forward, press the left or right key to turn while it is moving forward? I am sure there are probably better way

[Tutor] using counters and timers in text based programs

2005-05-16 Thread T Petersen
Hi, This is my first post here, and I'm new to programming (and therefore Python also:-)) I've made a almost functioning chess program which works in the shell. Now, I would like to add some type of counters, e.g. time used so far and/or move depth searched which should be updated continously. Is

Re: [Tutor] Tkinter questions

2005-05-16 Thread jfouhy
Quoting Alberto Troiano <[EMAIL PROTECTED]>: > How can I change the background color of a label?? > How can I change the font-size and make it BOLD?? Check out Fredrik Lundh's _Introduction to Tkinter_: http://www.pythonware.com/library/tkinter/introduction/ In particular, the section on

Re: [Tutor] Objects in List

2005-05-16 Thread Terry Carroll
On Mon, 16 May 2005, Viljoen, Danie wrote: > My Code: > > class MyObject: > """A simple VO class""" > def setName(self, newName): > self.name=newName > > def getName(self): > return self.name > > def main(): > list=[] >

Re: [Tutor] Objects in List

2005-05-16 Thread Danny Yoo
Hi Danie, The enumerate() function takes a list of elements, and returns a list of (index, element) pairs. For example: ## >>> names = ["wilma", "fred", "betty", "barney"] >>> for p in enumerate(names): ... print p ... (0, 'wilma') (1, 'fred') (2, 'betty') (3, 'barney') ## Note th

Re: [Tutor] How to verify all things are equal to one another

2005-05-16 Thread Terry Carroll
Thanks to all who responded on this. The commonly suggested: > if a == b == c == d == e == f == g: > do stuff Is just what I needed. It never occurred to me that Python supported a construct like that. I would have though this would have evaulated a la: if ((a == b) == c) == d) == e)

[Tutor] Objects in List

2005-05-16 Thread Viljoen, Danie
Title: Objects in List Hi I'm new to python (have a java background).  I'm trying to add object to a list, and afterwards manipulate the object again.  How do a cast a object to another object My Code: class MyObject:        """A simple VO class"""     def setName(self, newNa

Re: [Tutor] Lists of files

2005-05-16 Thread William O'Higgins
Thanks to all who helped me with my questions regarding testing for commandline arguments and list assignment. I have finished my first Python program (included below). It is slightly more secure than the Perl program I rewrote, but also about a tenth of a second slower (0.6 seconds for Perl on a

[Tutor] Tkinter questions

2005-05-16 Thread Alberto Troiano
Hey Tkinter question How can I change the background color of a label?? How can I change the font-size and make it BOLD?? Regards Alberto ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Directory not empty :: Fast mode

2005-05-16 Thread Max Noel
On May 16, 2005, at 18:30, Jonas Melian wrote: > To knowing if a directory isn't empty, I use: > > dir_example = "/usr/foo/" > > if glob.glob(os.path.join(dir_example, "*")): > ... > > > But, as it has to expand all files, i'm supposed that it's a little > slow > to simply knowing if a dire

[Tutor] Directory not empty :: Fast mode

2005-05-16 Thread Jonas Melian
To knowing if a directory isn't empty, I use: dir_example = "/usr/foo/" if glob.glob(os.path.join(dir_example, "*")): ... But, as it has to expand all files, i'm supposed that it's a little slow to simply knowing if a directory is empty. Any improvement? ___

[Tutor] Opinions about this GIS script

2005-05-16 Thread Ron Phillips
I made a script that opens GIS shapefiles and turns them into python objects. I posted it at http://www.geocities.com/tiltbike/GIS/py_shape_files.zip The only one that's mine, really, is the PyShape.py script; the others are there for support/testing.   It's my first real effort at 'shareable' py

[Tutor] YATENJoe

2005-05-16 Thread Joseph Quigley
YATENJoe (Yet Another Text Editor, Named Joe) First off, If this isn't the right place to ask, tell me so. That way I won't make this mistake again :-) I want to make a text editor. I know that there are hundreds out there, but practice makes perfect, and I need the practice. My problem is that I

Re: [Tutor] Simple string processing problem

2005-05-16 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Thanks! > > Your help has made me realise the problem is more complex than I first > though though...I've included a small sample of an actual file I need to > process. The structure is the same as in the full versions though; some > lowercase, some uppercase, then s

Re: [Tutor] URLLIB

2005-05-16 Thread Kent Johnson
Please post the code that gave you the error. Kent Servando Garcia wrote: > I tired that and here is the error I am currently getting: > > assert hasattr(proxies, 'has_key'), "proxies must be a mapping" > > I was trying this: > >>> X=urllib.URLopener(name,proxies={'http':'URL').distutils.copy_

Re: [Tutor] map() and lambda to change class instance attribute (fwd)

2005-05-16 Thread Kent Johnson
Bernard Lebel wrote: > Hi Kent, > > So if I undestand you right, mapping a function with map() when it is > a built-in function will/may be faster than a for loop, but if it's a > custom function (ie. a def one), it will most likely be slower? I guess I didn't proofread that last mail...what I me