Re: [Tutor] About the Mailing List

2011-07-28 Thread Corey Richardson
Excerpts from Steven D'Aprano's message of Fri Jul 29 01:32:36 -0400 2011: > Jordan wrote: > > How do I see what in the mailing list has already been responded too, > > before it sends me the digest? For instance I wanted to respond to one > > of the questions, but seeing that the time was almost t

Re: [Tutor] About the Mailing List

2011-07-28 Thread Steven D'Aprano
Jordan wrote: How do I see what in the mailing list has already been responded too, before it sends me the digest? For instance I wanted to respond to one of the questions, but seeing that the time was almost two hours ago. I am sure someone has already responded. Where could I check to see if th

Re: [Tutor] Running files from command prompt

2011-07-28 Thread Steven D'Aprano
Alexander Quest wrote: To clarify, the particular file that was giving me trouble was the basic "hello world" file. The original code on line 29 read as such: print 'Hello', name When I ran "C:\google-python-exercises> python hello.py, it gave me an error on that line (line 29), but when I change

Re: [Tutor] Mainloop conflict

2011-07-28 Thread Stefan Behnel
Christopher King, 29.07.2011 02:32: I have a socket Gui program. The only problem is that socket.recv waits for a response, which totally screws Tkinter I think. I tried making the timeout extremely small (it was alright if I didn't receive anything, I was excepting that a lot) but I think t

[Tutor] About the Mailing List

2011-07-28 Thread Jordan
How do I see what in the mailing list has already been responded too, before it sends me the digest? For instance I wanted to respond to one of the questions, but seeing that the time was almost two hours ago. I am sure someone has already responded. Where could I check to see if this is true? I as

Re: [Tutor] Running files from command prompt

2011-07-28 Thread Alexander Quest
To clarify, the particular file that was giving me trouble was the basic "hello world" file. The original code on line 29 read as such: print 'Hello', name When I ran "C:\google-python-exercises> python hello.py, it gave me an error on that line (line 29), but when I changed that line to print ('He

Re: [Tutor] Running files from command prompt

2011-07-28 Thread Alexander Quest
Awesome- thanks for that Dave! The programs all work now, except that the google exercise programs are all from Python 2.X and I'm running 3.1, so some of them are giving me errors. Is there a way around this or do I have to download a 2.X version so I can run these without a problem? Thanks again.

Re: [Tutor] Running files from command prompt

2011-07-28 Thread Dave Angel
On 07/28/2011 09:58 PM, Alexander Quest wrote: I downloaded the google's python exercise files from their website ( http://code.google.com/edu/languages/google-python-class/set-up.html), unzipped them, and placed them in C. I then added the following to the PATH variable under system settings so

[Tutor] Running files from command prompt

2011-07-28 Thread Alexander Quest
I downloaded the google's python exercise files from their website ( http://code.google.com/edu/languages/google-python-class/set-up.html), unzipped them, and placed them in C. I then added the following to the PATH variable under system settings so that I could type "python" in command prompt and

Re: [Tutor] Mainloop conflict

2011-07-28 Thread Dave Angel
On 07/28/2011 08:32 PM, Christopher King wrote: Dear Tutor Dudes, I have a socket Gui program. The only problem is that socket.recv waits for a response, which totally screws Tkinter I think. I tried making the timeout extremely small (it was alright if I didn't receive anything, I was excep

[Tutor] Mainloop conflict

2011-07-28 Thread Christopher King
Dear Tutor Dudes, I have a socket Gui program. The only problem is that socket.recv waits for a response, which totally screws Tkinter I think. I tried making the timeout extremely small (it was alright if I didn't receive anything, I was excepting that a lot) but I think that screwed socket. A

Re: [Tutor] Sorting lists both ways at once and programmatically loading a variable.

2011-07-28 Thread Alan Gauld
Prasad, Ramit wrote: I have 2 questions. 1. Is there a way to do a reverse and a normal sort at the same time? I have a list of tuples (there are more than 2 elements in the tuples but I only want to sort by the first two). I want to sort in reverse for the first element (int) and in order for

Re: [Tutor] Getting Idle to work in Win7

2011-07-28 Thread Alan Gauld
Wayne Watson wrote: I tried from the command line to run pythonw.exe, and that gave me the typical >>> input choice. Python at least works at that level. IDLE comes up with idle.pyw. Don't run pythonw to catch bugs, use python (no w). Python script from the command line, as well as starting

Re: [Tutor] Sorting lists both ways at once and programmatically loading a variable.

2011-07-28 Thread Dave Angel
On 07/28/2011 07:05 PM, Prasad, Ramit wrote: I have 2 questions. 1. Is there a way to do a reverse and a normal sort at the same time? I have a list of tuples (there are more than 2 elements in the tuples but I only want to sort by the first two). I want to sort in reverse for the first elemen

[Tutor] Sorting lists both ways at once and programmatically loading a variable.

2011-07-28 Thread Prasad, Ramit
I have 2 questions. 1. Is there a way to do a reverse and a normal sort at the same time? I have a list of tuples (there are more than 2 elements in the tuples but I only want to sort by the first two). I want to sort in reverse for the first element (int) and in order for the second element (st

Re: [Tutor] Don't understand this class/constructor call syntax

2011-07-28 Thread dave
Yes that is roughly what I meant. GNU Radio uses a lot of sub-classing--if this is the correct term. For example all blocks inherit hier_block2 which has methods such as connect for connecting two blocks together. I wondered if the instance named self wasn't being passed as a replacement for the

[Tutor] Fwd: KeyError?

2011-07-28 Thread James Reynolds
-- Forwarded message -- From: Shwinn Ricci Date: Thu, Jul 28, 2011 at 1:13 PM Subject: Re: [Tutor] KeyError? To: James Reynolds On Thu, Jul 28, 2011 at 12:42 PM, James Reynolds wrote: > > > On Thu, Jul 28, 2011 at 12:11 PM, Prasad, Ramit > wrote: > >> *From:* tutor-bounces+

Re: [Tutor] Sum files' size

2011-07-28 Thread Steven D'Aprano
Susana Iraiis Delgado Rodriguez wrote: I want to get the size of 3 files. I already completed this step. Then I need to sum the 3 results I got. In order to do it I have the next code: [...] #Finally I want to sum the 3 terms: total = kb+kb2+kb3 But the output I got is : 15.5KB108.0bytes169.0b

Re: [Tutor] Getting Idle to work in Win7

2011-07-28 Thread Alexander
Hi Wayne. I'm interested in the issues your facing. Could you right click on the IDLE shortcut in your start menu and tell me the details? Specifically under: *General*:* type of file, description, location, attributes*, (any *advanced * attributes?); *Shortcut*: tab, the *Target type*, *Target loc

Re: [Tutor] Sum files' size

2011-07-28 Thread Prasad, Ramit
>kb = sizeof_fmt(s) >shx1 = os.path.getsize(shx) >kb2 = sizeof_fmt(shx1) > total = kb+kb2+kb3 Instead only retrieve the formatted output at the end. That way you will not have to worry about converting back from strings, nor have to worry about adding number with different units (e.g. 10KB + 10M

Re: [Tutor] Getting Idle to work in Win7

2011-07-28 Thread Wayne Watson
I decided to re-install.  It looks like I'm in the same boat as before.  Edit with IDLE isn't even a choice. I tried from the command line to run pythonw.exe, and that gave me the typical >>> input choice. Python at least works at that level. IDLE comes up with idle.

Re: [Tutor] Sum files' size

2011-07-28 Thread Alan Gauld
Susana Iraiis Delgado Rodriguez wrote: I want to get the size of 3 files. I already completed this step. Then I need to sum the 3 results I got. In order to do it I have the next code: import os file_list = [] folders = None for root, folders, files in os.walk('C:\\'): file_list.ext

[Tutor] Sum files' size

2011-07-28 Thread Susana Iraiis Delgado Rodriguez
I want to get the size of 3 files. I already completed this step. Then I need to sum the 3 results I got. In order to do it I have the next code: import os file_list = [] folders = None for root, folders, files in os.walk('C:\\'): file_list.extend(os.path.join(root,fi) for fi in files

Re: [Tutor] OT: Drag and Drop GUI IDE ideas

2011-07-28 Thread Adam Bark
Rance Hall gmail.com> writes: > We want the students to develop a small app in the process, It could > be a firefox extension, mobile phone app, or any other type simple > structure. > > The catch is that the class is for non-programmers to try to get them > introduced to the field. We would lik

Re: [Tutor] Assigning range :p:

2011-07-28 Thread Christopher King
On Wed, Jul 27, 2011 at 9:11 PM, Thomas C. Hicks wrote: > On Wed, 27 Jul 2011 20:16:31 -0400 > Alexander Quest wrote: x=range(1,50) > mid=x[len(x)/2] > > You would have to make sure there is a way to work around decimal points in the division. Also, I would try it in practice. (remember range(

Re: [Tutor] how to temporarily disable a function

2011-07-28 Thread Christopher King
On Thu, Jul 28, 2011 at 5:08 AM, Peter Otten <__pete...@web.de> wrote: > Pete O'Connell wrote: > > > Hi I was wondering if there is a way to disable a function. > > You could use this decorator: class Disabler(object): def __init__(self, old_function): self.__old = old_function

Re: [Tutor] KeyError?

2011-07-28 Thread James Reynolds
On Thu, Jul 28, 2011 at 12:11 PM, Prasad, Ramit wrote: > *From:* tutor-bounces+ramit.prasad=jpmchase@python.org [mailto: > tutor-bounces+ramit.prasad=jpmchase@python.org] *On Behalf Of *Shwinn > Ricci > *Sent:* Thursday, July 28, 2011 10:51 AM > *To:* tutor@python.org > *Subject:* [Tutor]

Re: [Tutor] KeyError?

2011-07-28 Thread Prasad, Ramit
From: tutor-bounces+ramit.prasad=jpmchase@python.org [mailto:tutor-bounces+ramit.prasad=jpmchase@python.org] On Behalf Of Shwinn Ricci Sent: Thursday, July 28, 2011 10:51 AM To: tutor@python.org Subject: [Tutor] KeyError? I have an excel file that I am reading cell values from and puttin

Re: [Tutor] KeyError?

2011-07-28 Thread Walter Prins
On 28 July 2011 16:50, Shwinn Ricci wrote: > I have an excel file that I am reading cell values from and putting them > into a dictionary. the dictionary looks like this: > > scafPositions = {position[j]: direction[j]} > > where position[j] is exclusively floating/numerical values and direction[j

Re: [Tutor] KeyError?

2011-07-28 Thread James Reynolds
On Thu, Jul 28, 2011 at 11:50 AM, Shwinn Ricci wrote: > I have an excel file that I am reading cell values from and putting them > into a dictionary. the dictionary looks like this: > > scafPositions = {position[j]: direction[j]} > > where position[j] is exclusively floating/numerical values and

[Tutor] KeyError?

2011-07-28 Thread Shwinn Ricci
I have an excel file that I am reading cell values from and putting them into a dictionary. the dictionary looks like this: scafPositions = {position[j]: direction[j]} where position[j] is exclusively floating/numerical values and direction[j] is exclusively strings. When I try to find whether a

Re: [Tutor] python Module for Windows Active Directory

2011-07-28 Thread Tim Golden
On 28/07/2011 07:28, qbits...@gmail.com wrote: Hi, Which is the best package/module in Python to work with Windows Active Directory? I may need to create multiple OUs, set different users and computers and fill their individual attributes. Later i may need to modify/delete and then may need to

Re: [Tutor] Is it bad practise to write __all__ like that

2011-07-28 Thread Steven D'Aprano
Karim wrote: Hello, __all__ = 'api db input output tcl'.split() Yes, it's lazy, no it is not bad practice. I wouldn't do it myself, but I wouldn't object if somebody else did it. -- Steven ___ Tutor maillist - Tutor@python.org To unsubscribe

[Tutor] Is it bad practise to write __all__ like that

2011-07-28 Thread Karim
Hello, __all__ = 'api db input output tcl'.split() or __all__ = """ api db input output tcl """.split() for lazy boy ;o). It is readable as well. What do you think? Cheers Karim

Re: [Tutor] how to temporarily disable a function

2011-07-28 Thread Peter Otten
Pete O'Connell wrote: > Hi I was wondering if there is a way to disable a function. > Hi have a GUI grid snapping function that I use in a program called Nuke > (the film compositing software) > > Here is the function (which loads when Nuke loads): > ### > def theAutoplaceSnap

Re: [Tutor] how to temporarily disable a function

2011-07-28 Thread Dave Angel
On 07/27/2011 09:58 PM, Pete O'Connell wrote: Hi I was wondering if there is a way to disable a function. Hi have a GUI grid snapping function that I use in a program called Nuke (the film compositing software) Here is the function (which loads when Nuke loads): ### def theAu

Re: [Tutor] how to temporarily disable a function

2011-07-28 Thread Alan Gauld
Pete O'Connell wrote: Hi I was wondering if there is a way to disable a function. Hi have a GUI grid snapping function that I use in a program called Nuke (the film compositing software) simply change the binding of widget to function. Then change it back to re-enable it. You don't say which G