Re: [Tutor] Posting a large amount of code?

2005-01-16 Thread Alan Gauld
> Actually according to the above paragraph, he suggests putting them all in > a seperate class. So pseudo-code... > > class Pipe: > All things related to pipe program here. > > class GUI: Exactly so. The rationale for that was that you could work with a collection of pipes each with their own

Re: [Tutor] Objects, persistence & getting

2005-01-16 Thread Alan Gauld
> Well, one thing learning Java is good for is for thoroughly > demystifying OOP. I'd have to disagree here because Java's version of OOP has very little to do with real OOP. Java just uss classes as a kind of modularisation mechanism and does not make much use of tthe real OO features. In fact i

[Fwd: Re: [Tutor] py2exe]

2005-01-16 Thread Ismael Garrido
Forgot to forward it to the list... Here it goes: Original Message Subject: Re: [Tutor] py2exe Date: Mon, 17 Jan 2005 05:40:44 -0200 From: Ismael Garrido <[EMAIL PROTECTED]> To: Guillermo Fernandez Castellanos <[EMAIL PROTECTED]> References: <[EMAIL PROTECTED]> <[EMAIL PROT

Re: [Tutor] py2exe

2005-01-16 Thread Guillermo Fernandez Castellanos
Hi, Thanks for the quick answer. Unfortunatelly, it does not work... I still have the same problem. I though Tix was shipped with the Python distribution. And i have the Tix.pyc file in my computer, so I don't really undesrtand... My setup.py: from distutils.core import setup import py2exe im

Re: [Tutor] py2exe

2005-01-16 Thread Chad Crabtree
Try something like. import mx import Tix Sometimes py2exe will not gather up all the modules that it depends on. It does an admirable job but still needs some help. Perhaps you are in advertently using mx? Well try that and see what happens. Guillermo Fernandez Castellanos wrote: >Hi, > >

[Tutor] py2exe

2005-01-16 Thread Guillermo Fernandez Castellanos
Hi, I've done a GUI program and it works perfectly. but when I try to package it with py2exe, I obtain the following result: The following modules appear to be missing ['mx'] And when i run it, it crashes with this error message: Traceback (most recent call last): File "openwar.py", line 41, i

Re: [Tutor] Tkinter Radiobutton

2005-01-16 Thread Ismael Garrido
Ismael Garrido wrote: Hello. I can't figure out what's wrong in here! For some reason I can't understand, the radiobuttons don't work. The code itself is correct, the problem arises when I tell them that their master is self.configurar. I don't know why, but they don't like it. After changing t

Re: [Tutor] sockets, files, threads

2005-01-16 Thread Marilyn Davis
On Sat, 15 Jan 2005, Danny Yoo wrote: > > > > I have only wrapped my lock around file-descriptor creations. Should I > > wrap it around closings too? Or the whole open -> close transaction? > > It sounds like error-prone work to do the latter. What am I missing? > > Hi Marilyn, > > Can you

Re: [Tutor] Tkinter Radiobutton

2005-01-16 Thread jfouhy
Quoting Ismael Garrido <[EMAIL PROTECTED]>: > I can't figure out what's wrong in here! For some reason I can't > understand, the radiobuttons don't work. The code itself is correct, the What is the error message? > Button(self.configurar, command=lambda: self._configurarOk(), > text="Ok").gri

[Tutor] Tkinter Radiobutton

2005-01-16 Thread Ismael Garrido
Hello. I can't figure out what's wrong in here! For some reason I can't understand, the radiobuttons don't work. The code itself is correct, the problem arises when I tell them that their master is self.configurar. I don't know why, but they don't like it. Any help is welcome Thanks Ismael d

Re: [Tutor] How to create a key-value pairs with alternative elements in a list ... please help.

2005-01-16 Thread Patrick Hall
Hi! >>> while True: > ... try: > ... d[slice0.next()] = slice1.next() > ... except: StopIteration > ... break > ... ### while True: try: d[s0.next()] = s1.next() except StopIteration: # wherein we point out a wayward colon break ### Took me a while to figure out

Re: [Tutor] Posting a large amount of code?

2005-01-16 Thread Jacob S.
> > It would be a god excercise to extract all the p[ipe code into > > a separate class and the GUI methods call those class methods > > to get the work done. THis would allow for a fairly easy port > > to a different GUI or even the creation of a command line > > version, so you could do: Actuall

Re: [Tutor] Lights game

2005-01-16 Thread Jacob S.
Kent's suggestions are great, but I wanted to add two. > Hello list. > > I'd really appreciate any comments, particulary regarding style > corrections. I'm a newbie... > > Thanks! > Ismael > > > import random > import tkMessageBox > from Tkinter import * > > class GUI: > def __init__(sel

Re: [Tutor] Setting the focus to a window

2005-01-16 Thread Alan Gauld
> me in the past 2 days or so), I need to change the focus from the > current window to another window (from Windows Media Player to Audacity > so that the simulated keypress will have an effect). There are a couple of options and its a wee while since I did any deep windows hacking. But I think t

Re: [Tutor] Objects, persistence & getting

2005-01-16 Thread Max Noel
On Jan 16, 2005, at 21:13, Liam Clarke wrote: If I understand correctly, once an object is created, as long as references to it exist, it isn't garbage collected. Correct, more or less (in the exception case where a references b, b references a but nothing else references either, both are GC'd if

Re: [Tutor] Objects, persistence & getting

2005-01-16 Thread Kent Johnson
I'm not sure I understand your question. but if I do, the answer is, sometimes you can do it, but it is rarely a good idea. Liam Clarke wrote: If I understand correctly, once an object is created, as long as references to it exist, it isn't garbage collected. That's right. So, if module a.py crea

Re: [Tutor] Lights game

2005-01-16 Thread Kent Johnson
Ismael Garrido wrote: Kent Johnson wrote: If you make _cambiarCelda() check for out-of-range indices then you could get rid of _descartarNegativos() and clean up click() considerably. def _cambiarCelda(self, i, j): if not (0<=i<3 and 0<=j<3): return Without the 'not' (it was

[Tutor] Objects, persistence & getting

2005-01-16 Thread Liam Clarke
Hi all, Well, one thing learning Java is good for is for thoroughly demystifying OOP. It's not some magical acronym of programming goodness, it's just an 'organic' way to organise code. That, and it looks good on your CV, even if you won't be using it. Like XML. It's got me thinking about object

Re: [Tutor] Posting a large amount of code?

2005-01-16 Thread Bill Burns
On Sunday 16 January 2005 1:28 pm, Alan Gauld wrote: > Some quick feedback based on a quick scim through. > > It looks like your pipe logic is all mixed up with the GUI vpde. > > It would be a god excercise to extract all the p[ipe code into > a separate class and the GUI methods call those class m

[Tutor] Setting the focus to a window

2005-01-16 Thread Liam Clarke
Oops, to the list also. -- Forwarded message -- From: Liam Clarke <[EMAIL PROTECTED]> Date: Mon, 17 Jan 2005 09:49:48 +1300 Subject: Re: [Tutor] Setting the focus to a window To: Orri Ganel <[EMAIL PROTECTED]> Hi Orri, What Alan said earlier in the topic. You want to use the Wi

Re: [Tutor] Posting a large amount of code?

2005-01-16 Thread Liam Clarke
http://www.rafb.net/paste/ is good for when you need to make your code accessible - best of all it formats the code for you. Just copy & paste your code, and distribute the link it gives you. Your 'pasted' code expires after 24 hours though. Regards, Liam Clarke On Sun, 16 Jan 2005 02:39:20 -05

[Tutor] Setting the focus to a window

2005-01-16 Thread Orri Ganel
Hello all, As part of a project I'm working on (see archive of previous emails from me in the past 2 days or so), I need to change the focus from the current window to another window (from Windows Media Player to Audacity so that the simulated keypress will have an effect). I have googled and

Re: [Tutor] Posting a large amount of code?

2005-01-16 Thread Alan Gauld
Some quick feedback based on a quick scim through. It looks like your pipe logic is all mixed up with the GUI vpde. It would be a god excercise to extract all the p[ipe code into a separate class and the GUI methods call those class methods to get the work done. THis would allow for a fairly ea

Re: [Tutor] Posting a large amount of code?

2005-01-16 Thread Bill Burns
On Sunday 16 January 2005 10:53 am, Orri Ganel wrote: > For future reference, you can always post code to paste: > > http://rafb.net/paste/ > > Cheers, > Orri Thanks Orri! I didn't know there was a site like that. I'll check it out and see how it works! Thanks again. Bill ___

Re: [Tutor] Posting a large amount of code?

2005-01-16 Thread Bill Burns
[Bill] > I guess my question is, would it be acceptable to post this much code to > the list? [Alan] > Probably about the limit for posting, but if you can put it on > a web site somewhere and post a URL that would be fine... [Bill] Kent had made the same suggestion as well but alas I have no si

Re: [Tutor] Posting a large amount of code?

2005-01-16 Thread Orri Ganel
Bill Burns wrote: I accidentally sent my reply to Kent only. So I'm forwarding it to the list. Bill -- Forwarded Message -- Subject: Re: [Tutor] Posting a large amount of code? Date: Sunday 16 January 2005 10:14 am From: Bill Burns <[EMAIL PROTECTED]> To: Kent Johnson <[EM

Re: Sending a command to a program using os.system (was [Tutor]: Using os.popen*() and os.spawn*() to interact with a DOS box)

2005-01-16 Thread Orri Ganel
Kent Johnson wrote: Can you say something about why you want to do this? If you are trying to turn Audacity into a programmable sound processor, you might do better with something that is designed as a library for programmatic use. Googling 'python sound library' gives some promising hints. The

Re: [Tutor] Posting a large amount of code?

2005-01-16 Thread Bill Burns
I accidentally sent my reply to Kent only. So I'm forwarding it to the list. Bill -- Forwarded Message -- Subject: Re: [Tutor] Posting a large amount of code? Date: Sunday 16 January 2005 10:14 am From: Bill Burns <[EMAIL PROTECTED]> To: Kent Johnson <[EMAIL PROTECTED]> [Bill]

Re: [Tutor] Posting a large amount of code?

2005-01-16 Thread Alan Gauld
> I guess my question is, would it be acceptable to post this much code to the > list? Probably about the limit for posting, but if you can put it on a web site somewhere and post a URL that would be fine... > the body of the message or as an attachment? I would think an attachment > would be bet

Re: Sending a command to a program using os.system (was [Tutor]: Using os.popen*() and os.spawn*() to interact with a DOS box)

2005-01-16 Thread Kent Johnson
Can you say something about why you want to do this? If you are trying to turn Audacity into a programmable sound processor, you might do better with something that is designed as a library for programmatic use. Googling 'python sound library' gives some promising hints. The Snack Sound Toolkit

Re: [Tutor] Lights game

2005-01-16 Thread Kent Johnson
Nice work overall! A few comments inline... Kent Ismael Garrido wrote: Hello list. I'd really appreciate any comments, particulary regarding style corrections. I'm a newbie... Thanks! Ismael import random import tkMessageBox from Tkinter import * lights is only needed by GUI(), it is a helper cla

Re: Sending a command to a program using os.system (was [Tutor]: Usingos.popen*() and os.spawn*() to interact with a DOS box)

2005-01-16 Thread Alan Gauld
> import os > os.system('c:\\abaqus\\5.8-14\\abaqus.exe post') > > , where post was a command, *not* a file. Now, I tried something > similar, since essentially what I wish to be able to do is have Audacity > think I typed the 'R' key: > > os.system(r'c:\progra~1\audacity/audacity.exe R') > > All

Re: [Tutor] Using os.popen*() and os.spawn*() to interact with a dos-box

2005-01-16 Thread Alan Gauld
> Hoo boy . . . Looking at the 'help' of the win32api has left this newbie > hopelessly confused . . . Anyone who knows of a good Win32 tutorial, > please let me know! Frankly, anyone doing anything serious on Win32 in Python should buy Mark Hammond's book. It covers most things to do with Windows

Re: [Tutor] Faster procedure to filter two lists . Please help

2005-01-16 Thread Alan Gauld
> It's educational to look at the code anyway . Here it is, from > Python's listobject.c: Its been on my list of things to do for a long time. The biggest problem with C code is usually finding the bit you want, unless there is a good roadmap (aka design document) > static int > list_length(PyLi