Re: [Tutor] How is "tuple" pronounced?

2007-12-10 Thread Eric Brunson
earlylight publishing wrote: > Is it tuh-ple (rhymes with supple) > > or is it two-ple (rhymes with nothing that I can think of)? As a mathematician, I've always heard it pronounced "toople", even though when you put a prefix on it (quintuple, sextuple, octuple) it becomes "tuhple". We're mat

Re: [Tutor] How is "tuple" pronounced?

2007-12-10 Thread Jeff Stevens
On Mon, 2007-12-10 at 20:14 -0800, earlylight publishing wrote: > Is it tuh-ple (rhymes with supple) > > or is it two-ple (rhymes with nothing that I can think of)? It it probably Latin so: A. Pronounce it the same way you would in the words quintuple, sextuple, septuple, etc. B. Latin is no

Re: [Tutor] Noob question

2007-12-10 Thread Amit Saxena
Hi Eric, Thanks for the information..since i m new to Python so didnt knew about this fact...thanks again for it, will keep it in mind while writing such a program. Amit On Dec 10, 2007 8:57 PM, Eric Brunson <[EMAIL PROTECTED]> wrote: > > Hi Amit, > > This is fairly ineffici

Re: [Tutor] How is "tuple" pronounced?

2007-12-10 Thread Michael Langford
Tuple, rhymes with "you pull" --Michael On 12/10/07, earlylight publishing <[EMAIL PROTECTED]> wrote: > Is it tuh-ple (rhymes with supple) > > or is it two-ple (rhymes with nothing that I can think of)? > > Please visit our website www.earlylightpublishing.com > > _

Re: [Tutor] How is "tuple" pronounced?

2007-12-10 Thread steve reighard
On Dec 10, 2007 11:14 PM, earlylight publishing < [EMAIL PROTECTED]> wrote: > Is it tuh-ple (rhymes with supple) > > or is it two-ple (rhymes with nothing that I can think of)? > > How unscrupulous of you! > > > ___ Tutor maillist - Tutor@python.org h

[Tutor] How is "tuple" pronounced?

2007-12-10 Thread earlylight publishing
Is it tuh-ple (rhymes with supple) or is it two-ple (rhymes with nothing that I can think of)? Please visit our website www.earlylightpublishing.com - Never miss a thing. Make Yahoo your homepage.___ Tutor

Re: [Tutor] Windows Os Programming

2007-12-10 Thread ALAN GAULD
From: John Fouhy <[EMAIL PROTECTED]> >> Finally investigate the MSDN web site for WSH which gives > >Also the Microsoft Script Centre has a repository of python scripts: > http://www.microsoft.com/technet/scriptcenter/scripts/python/default.mspx?mfr=true Wow! That's new since I last looked. A

Re: [Tutor] Beat me over the head with it

2007-12-10 Thread wesley chun
> Hello everyone, names Theyain. I want to learn Python. But I am one of > those people who needs some one to "Beat me over the head" to actually > learn something. pick up a copy of "Core Python Programming" and do every single exercise in it. i need an answer key. ;-) there are more than 30

Re: [Tutor] Formatting timedelta objects

2007-12-10 Thread wesley chun
>This is probably something simple but I can't seem to find a way to > format a timedelta object for printing? I need to be able to print it in > a HH:MM:SS format but without the microseconds part (which is what you > get if you str() it). hi noufal, there's no real easy way to do this sinc

Re: [Tutor] Windows Os Programming

2007-12-10 Thread John Fouhy
On 11/12/2007, Alan Gauld <[EMAIL PROTECTED]> wrote: > Finally investigate the MSDN web site for WSH which gives > you relatively easy access to windows files, printers, registry and > processes via a set of COM objects that can be instantiated from > Python. Also the Microsoft Script Centre has a

Re: [Tutor] Formatting timedelta objects

2007-12-10 Thread John Fouhy
On 11/12/2007, Noufal Ibrahim <[EMAIL PROTECTED]> wrote: > Hello everyone, >This is probably something simple but I can't seem to find a way to > format a timedelta object for printing? I need to be able to print it in > a HH:MM:SS format but without the microseconds part (which is what you > g

Re: [Tutor] updating a print statement

2007-12-10 Thread Kent Johnson
This works for me: import sys import time for i in range(5): print '\rIndex =', i, sys.stdout.flush() time.sleep(1) Kent Bryan Fodness wrote: > I ran it both in IDLE and Command Prompt > > On Dec 10, 2007 5:02 PM, Kent Johnson <[EMAIL PROTECTED] > > wro

Re: [Tutor] updating a print statement

2007-12-10 Thread Bryan Fodness
It works now. Closed everything down and reopened. Thanks. On Dec 10, 2007 5:07 PM, Bryan Fodness <[EMAIL PROTECTED]> wrote: > I ran it both in IDLE and Command Prompt > > > On Dec 10, 2007 5:02 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > > > How are you running the program? > > > > Bryan Fod

Re: [Tutor] updating a print statement

2007-12-10 Thread Bryan Fodness
I ran it both in IDLE and Command Prompt On Dec 10, 2007 5:02 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > How are you running the program? > > Bryan Fodness wrote: > > > > for line in file('test.txt'): > > the_line = line.split() > > if the_line: > > if the_line[0] == 'Index': >

Re: [Tutor] updating a print statement

2007-12-10 Thread Kent Johnson
How are you running the program? Bryan Fodness wrote: > > for line in file('test.txt'): > the_line = line.split() > if the_line: > if the_line[0] == 'Index': > index = float(the_line[-1]) > print ("\rIndex = %.3f ") %index, > raw_input("\nExit") > Here is

Re: [Tutor] updating a print statement

2007-12-10 Thread Bryan Fodness
for line in file('test.txt'): the_line = line.split() if the_line: if the_line[0] == 'Index': index = float(the_line[-1]) print ("\rIndex = %.3f ") %index, raw_input("\nExit") Here is my output, Index = 0.000 Index = 0.400 Index = 0.800 Index = 1.000

Re: [Tutor] updating a print statement

2007-12-10 Thread Kent Johnson
Bryan Fodness wrote: > Here is the code. > > for line in file('test.txt'): > the_line = line.split() > if the_line: > if the_line[0] == 'Index': > index = float(the_line[-1]) > print ("\rIndex = %.3f") %index Add a comma at the end of the above line to sup

Re: [Tutor] updating a print statement

2007-12-10 Thread Bryan Fodness
Here is the code. for line in file('test.txt'): the_line = line.split() if the_line: if the_line[0] == 'Index': index = float(the_line[-1]) print ("\rIndex = %.3f") %index raw_input("\nExit") Here is the output. Index = 0.000 Index = 0.400 Index = 0.800 In

Re: [Tutor] updating a print statement

2007-12-10 Thread Kent Johnson
Bryan Fodness wrote: > I do want to overwrite the same line. > > I do not see a difference between using the \r and not using it. How are you running the program? Try it from a command line if that is not what you are doing. Can you show your new code? Kent PS Please Reply All to stay on the

Re: [Tutor] updating a print statement

2007-12-10 Thread Alan Gauld
"Bryan Fodness" <[EMAIL PROTECTED]> wrote > for line in file(file): >the_line = line.split() >if the_line: >print ("Index = %.2f") %index > > Is there a way that only one line will be output and the variable is > updated > rather than one line for every index. If you use Linux t

Re: [Tutor] Windows Os Programming

2007-12-10 Thread Alan Gauld
"Sewqyne Olpo" <[EMAIL PROTECTED]> wrote > Could you give some hints about windows programming using python? The biggest hint is to buy Mark Hammonds venerable but still useful book: Python rogramming on Win32 Then read the os module documents and shutil and os.path. (Try the OS topic in my

Re: [Tutor] updating a print statement

2007-12-10 Thread Kent Johnson
Bryan Fodness wrote: > I have a print statement in a for loop so I can watch the progress > > for line in file(file): > the_line = line.split() > if the_line: > print ("Index = %.2f") %index > > Is there a way that only one line will be output and the variable is > updated rath

[Tutor] Formatting timedelta objects

2007-12-10 Thread Noufal Ibrahim
Hello everyone, This is probably something simple but I can't seem to find a way to format a timedelta object for printing? I need to be able to print it in a HH:MM:SS format but without the microseconds part (which is what you get if you str() it). Any pointers? Thanks. -- ~noufal ht

Re: [Tutor] updating a print statement

2007-12-10 Thread Luke Paireepinart
Ole Henning Jensen wrote: > Sry about the previous mail. > > - Original Message - > > I have a print statement in a for loop so I can watch the progress > > for line in file(file): > the_line = line.split() > if the_line: > print ("Index = %.2f") %index > > Is there a way t

Re: [Tutor] updating a print statement

2007-12-10 Thread Ole Henning Jensen
Sry about the previous mail. - Original Message - I have a print statement in a for loop so I can watch the progress for line in file(file): the_line = line.split() if the_line: print ("Index = %.2f") %index Is there a way that only one line will be output and the vari

Re: [Tutor] updating a print statement

2007-12-10 Thread Ole Henning Jensen
I have a print statement in a for loop so I can watch the progress for line in file(file): the_line = line.split() if the_line: print ("Index = %.2f") %index Is there a way that only one line will be output and the variable is updated rather than one line for every i

[Tutor] updating a print statement

2007-12-10 Thread Bryan Fodness
I have a print statement in a for loop so I can watch the progress for line in file(file): the_line = line.split() if the_line: print ("Index = %.2f") %index Is there a way that only one line will be output and the variable is updated rather than one line for every index. Thanks,

[Tutor] Windows Os Programming

2007-12-10 Thread Sewqyne Olpo
Hello. As a new python programmer I wish to interact with the Windows Xp Os like loggin off session or restarting the system etc. But I dont know exactly where to start and what to learn. Could you give some hints about windows programming using python? Thanks in advance.

Re: [Tutor] Noob question

2007-12-10 Thread Eric Brunson
Hi Amit, This is fairly inefficient. Because strings in python are immutable this approach causes a new string to be created every iteration. While it may not be an issue with just 3 strings, it is much better to create your list and use "".join() to create the concatenation after the list

Re: [Tutor] thread not running

2007-12-10 Thread Evert Rol
>> What's going wrong when running it with 2.4? AfaIcs, all modules are >> in 2.4, so it my not have to do anything with the Python version, but >> with the underlying system. Any traceback? Perhaps replace the >> subprocess part with just a print statement to see what's happening? > > There are no

Re: [Tutor] thread not running

2007-12-10 Thread Ben Bartrum
> What's going wrong when running it with 2.4? AfaIcs, all modules are > in 2.4, so it my not have to do anything with the Python version, but > with the underlying system. Any traceback? Perhaps replace the > subprocess part with just a print statement to see what's happening? There are no trace

Re: [Tutor] thread not running

2007-12-10 Thread Evert Rol
> I have the following, which I use within a CherryPy app. The > subprocess bit is just to see if it runs or not. It works on my > home PC (Python 2.5.1 on Ubuntu), but not on the live host which > has Python 2.4.4 on Debian Etch. > > > def daemon(): > while 1: > myperio

[Tutor] thread not running

2007-12-10 Thread Ben Bartrum
Hello I have the following, which I use within a CherryPy app. The subprocess bit is just to see if it runs or not. It works on my home PC (Python 2.5.1 on Ubuntu), but not on the live host which has Python 2.4.4 on Debian Etch. def daemon(): while 1: myperiodicfunction

Re: [Tutor] Beat me over the head with it

2007-12-10 Thread Ben Bartrum
import motivation (sorry) > -Original Message- > From: [EMAIL PROTECTED] > Sent: Sat, 8 Dec 2007 22:04:04 -0600 > To: [EMAIL PROTECTED] > Subject: Re: [Tutor] Beat me over the head with it > > Need help with a motivational disorder? ;) > > When you say you want to learn Python, what's t

Re: [Tutor] Noob question

2007-12-10 Thread Amit Saxena
The simplest way i could think of: a=["apple","orange","banana"] b = "" for i in range(len(a)): b += a[i] print b Amit On Dec 10, 2007 6:48 AM, Alan Gauld <[EMAIL PROTECTED]> wrote: > "Eric Walstad" <[EMAIL PROTECTED]> wrote > > > You could also achieve the same result of concatenating a

Re: [Tutor] Beat me over the head with it

2007-12-10 Thread Tiger12506
Write a python script that prints out what 2+2 is NOW!!! And after you've done that, write one that does my chemistry homework, IMMEDIATELY! Bonk! ;-) JS ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor