[Tutor] help

2006-08-24 Thread Jonathon Sisson
Gah! Seems I sent that reply before stepping through my code a bit... The last section of that code should be: else:# kl and ll contain the same number here both.append(kl[indexK]) if indexK < indexL: # this block is needed so we indexL = indexL + 1 # don't enter an endles

Re: [Tutor] help

2006-08-24 Thread Jonathon Sisson
Hi Mike, I'm not sure I'm understanding exactly what it is you're looking for here, but from what I can tell you're looking for something such as: num(220, 330) #for example input a range of 10 # again, for example which would result in an output of 0, 660, 1320 and 1980 (because these four numb

Re: [Tutor] help

2006-08-24 Thread Bob Gailer
wesley chun wrote: > On 8/24/06, mike viceano <[EMAIL PROTECTED]> wrote: > >> hello i need a little help with a common multiple module i am haveing >> problems with the best i can get it is to show the least common multiple i >> think the problem is eather the and command ot the if command >>

Re: [Tutor] Query to the tutor mailing list

2006-08-24 Thread R. Alan Monroe
> On 8/24/06, John Fouhy <[EMAIL PROTECTED]> wrote: >> On 25/08/06, Joe Gamman <[EMAIL PROTECTED]> wrote: >> > Anyway, would appreciate any comments on the idea. >> >> It seems like the sort of thing you find in textbooks or "learn to >> program" books -- most books of this nature have suitable exe

Re: [Tutor] editors

2006-08-24 Thread wesley chun
On 8/18/06, anil maran <[EMAIL PROTECTED]> wrote: > what editors do you guys use? your question crosses boundaries between text editors and IDEs. you list editors specifically. i believe that *emacs and *vim can do what you ask, but IDEs can do even more. popular IDEs include: IDLE, PythonWin, K

Re: [Tutor] What's the invalid syntax?

2006-08-24 Thread Nathan Pinno
I sure did. It was choking because it was the wrong format. - Original Message - From: "Bob Gailer" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]> Cc: "Tutor mailing list" Sent: Thursday, August 24, 2006 12:56 PM Subject: Re: [Tutor] What's the invalid syntax? > My apology t

Re: [Tutor] help

2006-08-24 Thread wesley chun
On 8/24/06, mike viceano <[EMAIL PROTECTED]> wrote: > hello i need a little help with a common multiple module i am haveing > problems with the best i can get it is to show the least common multiple i > think the problem is eather the and command ot the if command some suggestions and reading: 1.

[Tutor] help

2006-08-24 Thread mike viceano
hello i need a little help with a common multiple module i am haveing problems with the best i can get it is to show the least common multiple i think the problem is eather the and command ot the if command # finds common multiples def nums(a,b): # assigns numbers to a and b print "enter

Re: [Tutor] Query to the tutor mailing list

2006-08-24 Thread wesley chun
On 8/24/06, John Fouhy <[EMAIL PROTECTED]> wrote: > On 25/08/06, Joe Gamman <[EMAIL PROTECTED]> wrote: > > Anyway, would appreciate any comments on the idea. > > It seems like the sort of thing you find in textbooks or "learn to > program" books -- most books of this nature have suitable exercises

Re: [Tutor] tkinter events:

2006-08-24 Thread Mike Hansen
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Zsiros Levente > Sent: Thursday, August 24, 2006 2:21 PM > To: Danny Yoo > Cc: python tutor > Subject: Re: [Tutor] tkinter events: > > If we're talking about data hiding, let me ask: why Python doe

Re: [Tutor] [Fwd: [Fwd: self-modification]]

2006-08-24 Thread Zsiros Levente
Alan Gauld wrote: > >> Why does the python shell says this: >> > print exec.__doc__ >> File "", line 1 >>print exec.__doc__ >> ^ >> SyntaxError: invalid syntax > > > exec, like print, is a statement, or command, not a function. > > You get the same response if you try > >

Re: [Tutor] Displaying in columnar / tabular form

2006-08-24 Thread John Fouhy
On 25/08/06, Vincent Gulinao <[EMAIL PROTECTED]> wrote: > Anyone knows a neat way of displaying output in columnar/tabular form? > > Say you have a list with both dictionary and string members; you want to > print the data, dictionary being one element per line, and the string on the > next "column

Re: [Tutor] tkinter events:

2006-08-24 Thread Zsiros Levente
If we're talking about data hiding, let me ask: why Python doesn't implement data hiding (I mean 'private' and 'protected')? I consider it a very important OOP feature, because that makes OOP different from structural programming. Danny Yoo wrote: >> def handler(event): >> if buttonpressed

Re: [Tutor] Query to the tutor mailing list

2006-08-24 Thread John Fouhy
On 25/08/06, Joe Gamman <[EMAIL PROTECTED]> wrote: > Anyway, would appreciate any comments on the idea. It seems like the sort of thing you find in textbooks or "learn to program" books -- most books of this nature have suitable exercises at the end of each chapter, or spread throughout each chapt

Re: [Tutor] What's the invalid syntax?

2006-08-24 Thread Bob Gailer
My apology to you, Nathan. When I requested a traceback I did not realize you were using an IDE. But do realize that an IDE reporting a syntax error should point to (in some way) to the offending line of code. It's always a good idea to examine (as already suggested) that line to attempt to spo

Re: [Tutor] how to set time limit before downloading file

2006-08-24 Thread kulibin da-da!
> > I had to download some files. > > > > Using the code below I could download almost all I had to download, but I > > have a problem > >: > > r = urllib.urlopen(url) > >: > > And the problem is that the script sleeps for some hours. And thats > > all - no data is read. > > > is there a

Re: [Tutor] Adding the current working directory to the Windows path

2006-08-24 Thread Terry Carroll
On Wed, 23 Aug 2006, Terry Carroll wrote: > I believe that the path for a new process is taken from the registry, in > particular from > HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session > Manager\Environment\Path More at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/416087

Re: [Tutor] how to set time limit before downloading file

2006-08-24 Thread wesley chun
On 8/24/06, kulibin da-da! <[EMAIL PROTECTED]> wrote: > I had to download some files. > > Using the code below I could download almost all I had to download, but I > have a problem >: > r = urllib.urlopen(url) >: > And the problem is that the script sleeps for some hours. And thats > all

Re: [Tutor] Displaying in columnar / tabular form

2006-08-24 Thread wesley chun
On 8/24/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > Vincent Gulinao wrote: > > > > Anyone knows a neat way of displaying output in columnar/tabular form? > > You might like this recipe: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/267662 > > Another option is to write an HTML file co

[Tutor] prob with 64 encoded email attachement

2006-08-24 Thread shawn bright
hello there, i am having a bit o trouble being able to read a base64 encoded email attachement. here is the script. import email import poplib import base64 import os email_folder = 'emails/' mime = "application/octet-stream" def WriteAttachment(msg):     for part in msg.walk():     print p

[Tutor] Query to the tutor mailing list

2006-08-24 Thread Joe Gamman
hi,long time lurker, first time poster. i apologise in advance if this has come up before and i haven't seen it.i'm interested in learning python purely as an intellectual excercise - writing small scripts in a 'crossword puzzle per day' kind of thing (i have a long train commute ;-).  if i get to

Re: [Tutor] how to set time limit before downloading file

2006-08-24 Thread kulibin da-da!
Thanks for your help, Kent - everything is working now :) > > I had to download some files. > > > > Using the code below I could download almost all I had to download, but I > > have a problem with 'http://18wheels.wz.cz/csszengarden/back-con.jpg' > > > > And the problem is that the script sleep

Re: [Tutor] Displaying in columnar / tabular form

2006-08-24 Thread Kent Johnson
Vincent Gulinao wrote: > > Anyone knows a neat way of displaying output in columnar/tabular form? > > Say you have a list with both dictionary and string members; you want > to print the data, dictionary being one element per line, and the > string on the next "column" aligned on the first elemen

Re: [Tutor] how to set time limit before downloading file

2006-08-24 Thread Kent Johnson
kulibin da-da! wrote: > I had to download some files. > > Using the code below I could download almost all I had to download, but I > have a problem with 'http://18wheels.wz.cz/csszengarden/back-con.jpg' > > And the problem is that the script sleeps for some hours. And thats > all - no data is re

[Tutor] Displaying in columnar / tabular form

2006-08-24 Thread Vincent Gulinao
Anyone knows a neat way of displaying output in columnar/tabular form? Say you have a list with both dictionary and string members; you want to print the data, dictionary being one element per line, and the string on the next "column" aligned on the first element of the dictionary

[Tutor] how to set time limit before downloading file

2006-08-24 Thread kulibin da-da!
I had to download some files. Using the code below I could download almost all I had to download, but I have a problem with 'http://18wheels.wz.cz/csszengarden/back-con.jpg' This is my code for downloading 'http://18wheels.wz.cz/csszengarden/back-con.jpg' # -*- coding: windows-1251 -*- import

Re: [Tutor] Adding the current working directory to the Windows path

2006-08-24 Thread ALAN GAULD
Hi John,The OP wants to do it from a Python program.Thats why I suggested using the registry.Alan GJohn Fouhy <[EMAIL PROTECTED]> wrote: On 24/08/06, Alan Gauld <[EMAIL PROTECTED]> wrote:> PATH is an environment variable and therefore changing it only> affects the current process environment. You n