Re: [Tutor] Python's OOP-Inheritance make me confuse.

2013-01-19 Thread Dave Angel
On 01/19/2013 02:08 AM, Moore John wrote: Hi, I am new to Python language. I have only 10 days experience on it. When I start learning there is no difficult, but it make me slow down when I reach Object Oriented Concept, especially Inherited. Some of my background knowledge about Inherited is

[Tutor] Struggling with logic .....

2013-01-19 Thread Barry Drake
Hi there Some months ago I decided to have a crack at Python. I set myself the task of coding the 'Mastermind' game and got into great problems where the random generated number contained duplicated digits. I recently decided to get back to it as I have volunteered to introduce the

Re: [Tutor] Set LD_LIBRARY_PATH and equivalents platform-independently

2013-01-19 Thread Albert-Jan Roskam
On Thu, Jan 17, 2013 at 10:33 AM, Albert-Jan Roskam fo...@yahoo.com wrote: The goal is to load the C libraries (dll, so, dylib, etc) that my program needs. Anyway, I looked up your two suggestions about library_dirs and runtime_library_dirs. What is meant by at link time?

Re: [Tutor] Struggling with logic .....

2013-01-19 Thread Alan Gauld
On 19/01/13 11:14, Barry Drake wrote: I noticed it doesn't get the scoring right when there are duplicate digits! You haven't given an example with duplicate digits so I'll need to take your word for it! line is: ['1', '2', '3', '4'] Length: 4 Random Code: (3, 4, 2, 3) Result: 0 - you

Re: [Tutor] Set LD_LIBRARY_PATH and equivalents platform-independently

2013-01-19 Thread Alan Gauld
On 19/01/13 12:24, Albert-Jan Roskam wrote: Thank you! I am getting a whole lot wiser wrt Linux. I checked 'man ld' and 'man ldconfig'. Especially the ld command is pretty extensive. The Rpath/Runpath solution seems nice in that no wrapper is needed (contrary to when one uses

Re: [Tutor] Set LD_LIBRARY_PATH and equivalents platform-independently

2013-01-19 Thread eryksun
On Fri, Jan 18, 2013 at 4:07 PM, Albert-Jan Roskam fo...@yahoo.com wrote: Alan said: Support for changing environment variables on the fly is iffy in most languages and is not something I'd ever do lightly. If you put it that way... yes, I now realize that it could be (and in fact is)

Re: [Tutor] Set LD_LIBRARY_PATH and equivalents platform-independently

2013-01-19 Thread eryksun
On Sat, Jan 19, 2013 at 7:24 AM, Albert-Jan Roskam fo...@yahoo.com wrote: But is Windows the only exception in the way that libraries are dealt with? Or do DLLs also have a dynamic area? DLLs can have an embedded manifest. To solve the DLL Hell problem, Windows introduced side-by-side

Re: [Tutor] list of references to object properties

2013-01-19 Thread Jose Amoreira
Thanks for the explanation, Alan Is there a good reason to want to do such a thing? There is a reason, but maybe you won't consider it a good one... I was writing a small program to simulate the gravitational dynamics of a system of many planets, using scipy's odeint to solve the equations

Re: [Tutor] Struggling with logic .....

2013-01-19 Thread Barry Drake
On 19/01/13 14:33, Alan Gauld wrote: line is: ['1', '2', '3', '4'] Length: 4 Random Code: (3, 4, 2, 3) Result: 0 - you have a correct number in an incorrect position Result: 0 - you have a correct number in an incorrect position Result: 0 - you have a correct number in an incorrect

Re: [Tutor] list of references to object properties

2013-01-19 Thread Alan Gauld
On 19/01/13 15:47, Jose Amoreira wrote: motion. I defined a class, CelestialBody, that describes objects that represent planets in my simulation. These objects have three attributes: position, velocity and mass (the first two are 3D-vectors; as such, the number of attributes is actually 7). The

Re: [Tutor] Struggling with logic .....

2013-01-19 Thread Alan Gauld
On 19/01/13 16:50, Barry Drake wrote: has much nicer features for a novice. Incidentally, if I re-code the example, should I alter it to Python3 syntax while I'm at it? Is there any good reason to move away from Python2? Python 3 is the future so getting used to it sooner rather than later

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-19 Thread Scurvy Scott
[SNIP] Thank you guys so much, sorry for the delayed response. It's awesome being able to learn a thing or two from people who know so much about their craft. I've got the code working the way I envisioned it now and probably couldn't without y'alls help. I'm so glad this mailing list exists,

[Tutor] Traffic Light

2013-01-19 Thread anthonym
Hello All, I am new to Python and taking a course now. One of my exercises is to create a traffic light using tkinter. The exercise also requires that I create radio buttons that allow the user to click on the color and the corresponding light will come on. I followed some examples in my book

Re: [Tutor] Traffic Light

2013-01-19 Thread Alan Gauld
On 19/01/13 20:31, anthonym wrote: rbRed = Radiobutton(frame1, text = Red, bg = red, variable = self.v2, value = 1, command = self.processRadiobutton) Here you assign your method to the button # Add Radio Button process

Re: [Tutor] Traffic Light

2013-01-19 Thread anthonym
Thanks again for the info Alan. I am still passing the button process until I can get my rectangle and ovals on the canvass. The program runs and produces a window with the radio buttons on top. I would like them on the bottom but changes to the row field have no effect. Anybody have any ideas

Re: [Tutor] list of references to object properties

2013-01-19 Thread DoanVietTrungAtGmail
Hi Jose, have you thought about shallow copying? I am learning Python too, so I can be wrong here. But I have just tried the idea and it worked for me: class celestialBody(object): def __init__(self, m, x, y, z): self.mass = m self.pos = [x, y, z] def __str__(self):

Re: [Tutor] Traffic Light

2013-01-19 Thread Matthew Ngaha
On Sat, Jan 19, 2013 at 10:56 PM, anthonym antho...@att.net wrote: Thanks again for the info Alan. I am still passing the button process until I can get my rectangle and ovals on the canvass. The program runs and produces a window with the radio buttons on top. I would like them on the

Re: [Tutor] Traffic Light

2013-01-19 Thread anthonym
Sure thing. Here is the code. And after that is the box I get with the radio buttons but no shapes. from tkinter import * # Import tkinter class Trafficlight: def __init__(self): window = Tk()# Create a window window.title(Traffic Light) # Set a title #

[Tutor] Python gmail script for conky

2013-01-19 Thread Polo Heysquierdo
I'm getting the following error on my script for conky. Traceback (most recent call last): File /home/troll/.gmail/gmail.py, line 1, in module import urllib.request ImportError: No module named request code below: import urllib.request from xml.etree import ElementTree as etree # Enter

Re: [Tutor] Traffic Light

2013-01-19 Thread Matthew Ngaha
On Sun, Jan 20, 2013 at 12:05 AM, Matthew Ngaha chigga...@gmail.com wrote: On Sat, Jan 19, 2013 at 11:29 PM, anthonym antho...@att.net wrote: Sure thing. Here is the code. And after that is the box I get with the radio buttons but no shapes. i might be way off as im struggling to understand

Re: [Tutor] Traffic Light

2013-01-19 Thread Alan Gauld
On 19/01/13 23:29, anthonym wrote: Sure thing. Here is the code. And after that is the box I get with the radio buttons but no shapes. It all runs fine for me. I'm not sure what you are expecting but it does exactly what I'd expect... The shapes aren't there because you don't draw them.

Re: [Tutor] list of references to object properties

2013-01-19 Thread eryksun
On Sat, Jan 19, 2013 at 10:47 AM, Jose Amoreira ljmamore...@gmail.com wrote: I defined a class, CelestialBody, that describes objects that represent planets in my simulation. These objects have three attributes: position, velocity and mass (the first two are 3D-vectors; as such, the number of

Re: [Tutor] list of references to object properties

2013-01-19 Thread Oscar Benjamin
On 19 January 2013 15:47, Jose Amoreira ljmamore...@gmail.com wrote: Thanks for the explanation, Alan Is there a good reason to want to do such a thing? There is a reason, but maybe you won't consider it a good one... I was writing a small program to simulate the gravitational dynamics of a

Re: [Tutor] Python gmail script for conky

2013-01-19 Thread Andreas Perstinger
On 20.01.2013 00:27, Polo Heysquierdo wrote: I'm getting the following error on my script for conky. Traceback (most recent call last): File /home/troll/.gmail/gmail.py, line 1, in module import urllib.request ImportError: No module named request What's your python version? (Type

Re: [Tutor] Traffic Light

2013-01-19 Thread ALAN GAULD
That must be what I am missing.  How do I call the functions so I can have the shapes appear on the canvas? AG the same way you call all the other functions. AG The bit I can't answer is *where* you call them. I'm not sure AG where in your code you want them. AG Is it before you press the