Re: [Tutor] I can't believe this needs to be this complex

2008-08-03 Thread Alan Gauld
Dick Moores [EMAIL PROTECTED] wrote code I time. What's an example of code that would have System be greater than zero? And what's the distinction between User and System? (I'm using Win XP, if that's relevant.) It may be that XP doesn't report System time. Well, here's one that reads in

Re: [Tutor] Developing Macro: Is it possible in Python?

2008-08-03 Thread Alan Gauld
Federo [EMAIL PROTECTED] wrote Is it possible to do macro with Python? Macro means different things in different context. Macro should be able to click on given x,y screen location (one click, double click), drag scroll bar up / down etc.. It seems that you are referring to simulating

Re: [Tutor] Output never stops

2008-08-03 Thread Alan Gauld
David [EMAIL PROTECTED] wrote the output never stops when I run this in a terminal choice = raw_input(Enter the name Lary or Joan (-1 to quit): ) while choice != '-1': person = {'Lary': 43,'Joan': 24} if choice == 'Lary': print Lary's age is:, person.get('Lary') elif

Re: [Tutor] I can't believe this needs to be this complex

2008-08-03 Thread Dick Moores
At 01:00 AM 8/3/2008, Alan Gauld wrote: Dick Moores [EMAIL PROTECTED] wrote code I time. What's an example of code that would have System be greater than zero? And what's the distinction between User and System? (I'm using Win XP, if that's relevant.) It may be that XP doesn't report System

Re: [Tutor] I can't believe this needs to be this complex

2008-08-03 Thread Kent Johnson
On Sun, Aug 3, 2008 at 4:00 AM, Alan Gauld [EMAIL PROTECTED] wrote: Dick Moores [EMAIL PROTECTED] wrote code I time. What's an example of code that would have System be greater than zero? And what's the distinction between User and System? (I'm using Win XP, if that's relevant.) It may be

[Tutor] Decimals 'not equal to themselves' (e.g. 0.2 equals 0.200000001)

2008-08-03 Thread CNiall
I am very new to Python (I started learning it just yesterday), but I have encountered a problem. I want to make a simple script that calculates the n-th root of a given number (e.g. 4th root of 625--obviously five, but it's just an example :P), and because there is no nth-root function in

Re: [Tutor] I can't believe this needs to be this complex

2008-08-03 Thread Dick Moores
At 05:15 AM 8/3/2008, Kent Johnson wrote: On Sun, Aug 3, 2008 at 4:00 AM, Alan Gauld [EMAIL PROTECTED] wrote: Dick Moores [EMAIL PROTECTED] wrote code I time. What's an example of code that would have System be greater than zero? And what's the distinction between User and System? (I'm

Re: [Tutor] Decimals 'not equal to themselves' (e.g. 0.2 equals 0.200000001)

2008-08-03 Thread Thomas Pani
CNiall wrote: I want to make a simple script that calculates the n-th root of a given number (e.g. 4th root of 625--obviously five, but it's just an example :P), and because there is no nth-root function in Python I will do this with something like x**(1/n). Side note: of course there are

Re: [Tutor] I can't believe this needs to be this complex

2008-08-03 Thread Dick Moores
At 05:15 AM 8/3/2008, Kent Johnson wrote: On Sun, Aug 3, 2008 at 4:00 AM, Alan Gauld [EMAIL PROTECTED] wrote: Dick Moores [EMAIL PROTECTED] wrote code I time. What's an example of code that would have System be greater than zero? And what's the distinction between User and System? (I'm

Re: [Tutor] Output never stops

2008-08-03 Thread David
Alan Gauld wrote: David [EMAIL PROTECTED] wrote the output never stops when I run this in a terminal choice = raw_input(Enter the name Lary or Joan (-1 to quit): ) while choice != '-1': person = {'Lary': 43,'Joan': 24} if choice == 'Lary': print Lary's age is:,

Re: [Tutor] Decimals 'not equal to themselves' (e.g. 0.2 equals 0.200000001)

2008-08-03 Thread Kent Johnson
On Sun, Aug 3, 2008 at 10:04 AM, CNiall [EMAIL PROTECTED] wrote: I want to make a simple script that calculates the n-th root of a given number (e.g. 4th root of 625--obviously five, but it's just an example :P), and because there is no nth-root function in Python I will do this with something

Re: [Tutor] Decimals 'not equal to themselves' (e.g. 0.2 equals0.200000001)

2008-08-03 Thread Alan Gauld
CNiall [EMAIL PROTECTED] wrote However, with some, but not all, decimals, they do not seem to 'equal themselves'. This is probably a bad way of expressing what I mean, so I'll give an example: 0.5 0.5 0.2 0.20001 As you can see, the last two decimals are very slightly

Re: [Tutor] Developing Macro: Is it possible in Python?

2008-08-03 Thread Paul McGuire
I have used pywinauto for such tasks in the past. http://pywinauto.openqa.org/ In my case, I used pywinauto to automate mouse clicks on a browser in order to auto-play a Flash game running in the browser. I had to use PIL to take screenshots and then process images to read the screen. -- Paul

Re: [Tutor] Developing Macro: Is it possible in Python?

2008-08-03 Thread Emile van Sebille
Federo wrote: snip Above actions can be easily performed using Macro Scheduler. I am looking for possibility to do the same with Python? Hi Federo, I regularly combine Macro Scheduler with python by having my python code write mSched scripts. I find the combination of the two particularly

Re: [Tutor] Firstrade Authentication ...

2008-08-03 Thread Kent Johnson
On Sun, Aug 3, 2008 at 12:45 PM, Federo [EMAIL PROTECTED] wrote: Jeff, Kent Hi! If possible I would most appreciate to use mechanize approach Jeff suggested. Python plagin: http://wwwsearch.sourceforge.net/mechanize/ This seems to get to the Thank you for applying for a Firstrade account.

[Tutor] newbie: write ArcGIS lists to file?

2008-08-03 Thread zack holden
Dear List, This is my first time on the list, and my first run at Python, please forgive my ignorance. I'm trying to use Python to access ArcGIS modules in order to perform the same task on multiple files in a folder. I'm able to access a set of files via: import arcgisscripting, string

Re: [Tutor] Firstrade Authentication ...

2008-08-03 Thread Patrick
Kent Johnson wrote: [snip] params = dict(username='janezfedero', password='kmet500', destination='') I hope this is a fake username password Regards, Patrick ___ Tutor maillist - Tutor@python.org

[Tutor] Any Italian speakers?

2008-08-03 Thread Alan Gauld
I received this message which Google tells me is Italian but then only gives a partial translation... Can anyone help? --- voglio chiderti solo 1 cosa ... ma secondo te qualle e il miglior programma X programmare??? grazie ... da Cristian - Alan G.

Re: [Tutor] Output never stops

2008-08-03 Thread Alan Gauld
David [EMAIL PROTECTED] wrote Thanks Alan, also your tutorial/book is a big help. I think I got it :) Close but not quite there yet. choice = 0 while choice != '-1': if choice == '': print You must enter Lary or Joan to continue! (-1 to quit): choice = raw_input(

[Tutor] List elements as indices to another list

2008-08-03 Thread Carlos Laviola
Hi, I have a simple matrix (nested list) defined as such: M = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] I'm trying to come up with a different way of getting its, well, reverse antidiagonal, since the actual antidiagonal of M goes from M[0, N] to M[N, 0] according to

Re: [Tutor] newbie: write ArcGIS lists to file?

2008-08-03 Thread Alan Gauld
zack holden [EMAIL PROTECTED] wrote I need to begin producing .csv files of this list that I can access using other programs. Would someone be willing to post a few lines of code showing me how to write the list the code above creates to an external file? Check the documentation for the

Re: [Tutor] List elements as indices to another list

2008-08-03 Thread Alan Gauld
Carlos Laviola [EMAIL PROTECTED] wrote i [0, 1, 2] j [2, 1, 0] Theoretically, I could then just iterate over range(len(M)) and grab M[i[N]j[N]], but that's not legal. What would be the right way of doing this? M [ i[N] ] [ j[N] ] You just missed a couple of brackets... HTH, Alan G