Re: [Tutor] Hi everyone

2009-05-20 Thread Lie Ryan
Doug Reid wrote: Now here is the code I'm having trouble following: while word: position = random.randrange(len(word)) jumble += word[position] word = word[:position] + word[(position + 1):] position = random.randrange(len(word)). This will create a starting point for the progra

Re: [Tutor] Iterating over list of functions

2009-05-20 Thread Dave Angel
Robert Berman wrote: Thank you, Christian. This solution was one I was not expecting and am glad to receive it. It is one I will explore in greater detail later. Robert On Wed, 2009-05-20 at 16:44 +0200, Christian Witts wrote: Robert Berman wrote: Hi, Given a list of options: optio

Re: [Tutor] web cam

2009-05-20 Thread David
Ricardo Aráoz wrote: Hi, a friend of mine has asked me how difficult would it be to send web cam images through python program as a hobby project. Honestly, at this point I have no idea where does he want to put python in the equation nor what does the project entail. So I'm asking for pointers t

Re: [Tutor] delphi, pascal and Python

2009-05-20 Thread Marc Tompkins
On Wed, May 20, 2009 at 11:10 AM, Alan Gauld wrote: > > "Andy Cheesman" wrote > > Is there a Method for wrapping delphi and/or pascal code into python like >> SWIG? >> I've googled to no avail, Can anyone help me? >> > > Try this: > > http://membres.lycos.fr/marat/delphi/python.htm > > Alan G >

[Tutor] Hi everyone

2009-05-20 Thread Doug Reid
Hi,   I'm teaching myself Python mainly for to use as a hobby.  I'd like to do graphical programs eventually and maybe some simple graphic games.  I feel I'm doing well with the tutorial I'm using but it would be nice to have some real people to ask questions and opinions, so on that note, I'm h

Re: [Tutor] web cam

2009-05-20 Thread Kent Johnson
2009/5/20 Ricardo Aráoz : > Hi, a friend of mine has asked me how difficult would it be to send web > cam images through python program as a hobby project. > Honestly, at this point I have no idea where does he want to put python > in the equation nor what does the project entail. So I'm asking for

Re: [Tutor] Iterating through a function list

2009-05-20 Thread Dave Kuhlman
On Wed, May 20, 2009 at 10:02:22AM -0400, Robert Berman wrote: > >Hi, >Given a list of options: option_1...option_n. For each option I >have a corresponding function: func_1. func_n. I have all function >names defined in a list similar to flist = [func_1, >func_2,..

Re: [Tutor] web cam

2009-05-20 Thread vince spicer
I've seen this win32 library: http://videocapture.sourceforge.net via http://technobabbler.com?p=22 for linux http://www.antonym.org/libfg Vince 2009/5/20 Ricardo Aráoz > Hi, a friend of mine has asked me how difficult would it be to send web > cam images through python program as a hobby pr

[Tutor] web cam

2009-05-20 Thread Ricardo Aráoz
Hi, a friend of mine has asked me how difficult would it be to send web cam images through python program as a hobby project. Honestly, at this point I have no idea where does he want to put python in the equation nor what does the project entail. So I'm asking for pointers to : a) Any already done

Re: [Tutor] Getting file properties on winodws

2009-05-20 Thread vishwajeet singh
Thanks that helped. On Thu, May 21, 2009 at 2:34 AM, Tim Golden wrote: > vishwajeet singh wrote: > >> Hi, >> >> I am trying to read properties of file on windows like there is a property >> call Keywords on file; I am to read this property independent of file >> type. >> > > There's an unpolishe

Re: [Tutor] Getting file properties on winodws

2009-05-20 Thread Tim Golden
vishwajeet singh wrote: Hi, I am trying to read properties of file on windows like there is a property call Keywords on file; I am to read this property independent of file type. There's an unpolished (indeed, unfinished) example here: http://timgolden.me.uk/python/win32_how_do_i/get-documen

[Tutor] Getting file properties on winodws

2009-05-20 Thread vishwajeet singh
Hi, I am trying to read properties of file on windows like there is a property call Keywords on file; I am to read this property independent of file type. I tried using win32api and win32file but I was not able to find any such function; GetFileAttributes gives some limited attributes. -- Che

Re: [Tutor] delphi, pascal and Python

2009-05-20 Thread Alan Gauld
"Andy Cheesman" wrote Is there a Method for wrapping delphi and/or pascal code into python like SWIG? I've googled to no avail, Can anyone help me? Try this: http://membres.lycos.fr/marat/delphi/python.htm Alan G ___ Tutor maillist - Tutor@

[Tutor] Iterating through a function list

2009-05-20 Thread Robert Berman
Hi, Given a list of options: option_1...option_n. For each option I have a corresponding function: func_1. func_n. I have all function names defined in a list similar to flist = [func_1, func_2,...func_n] which I know is a legitimate construct having found a similar construct discusse

Re: [Tutor] Iterating over list of functions

2009-05-20 Thread ALAN GAULD
> understand exactly what you are saying and what you are advocating. > The 'dictionary of functions' is the 'best' approach because of simplicity > and because it minimizes chances or errors. Correct. Maintaining synch of indexes between two arrays of data items is always going to be a risky b

Re: [Tutor] Iterating over list of functions

2009-05-20 Thread spir
Le Wed, 20 May 2009 10:25:21 -0400, Robert Berman s'exprima ainsi: > What I do not know how to do is to call the selected function. If you have options and functions "hard-coded" in lists (or if you get them from outside), you can still let python build a dict for you, using "zip": l1 = [1,2,3

Re: [Tutor] Iterating over list of functions

2009-05-20 Thread Robert Berman
Alan, The emphasis of your reply certainly makes me look at the dictionary solution as the most 'correct' solution to utilize. Before I change the code I just implemented, let me make sure I understand exactly what you are saying and what you are advocating. The 'dictionary of functions' is the 'b

Re: [Tutor] Iterating over list of functions

2009-05-20 Thread Alan Gauld
"Robert Berman" wrote Thank you, Christian. This solution was one I was not expecting and am glad to receive it. It is one I will explore in greater detail later. A dictionary of functions is the most common way to tackle this fairly common requirement. It combines readability with ease of

Re: [Tutor] Iterating over list of functions

2009-05-20 Thread Robert Berman
Thank you, Christian. This solution was one I was not expecting and am glad to receive it. It is one I will explore in greater detail later. Robert On Wed, 2009-05-20 at 16:44 +0200, Christian Witts wrote: > Robert Berman wrote: > > Hi, > > > > Given a list of options: option_1...option_n. F

Re: [Tutor] Iterating over list of functions

2009-05-20 Thread Robert Berman
Thank you, Emile. That is the exact answer I needed. Robert On Wed, 2009-05-20 at 07:48 -0700, Emile van Sebille wrote: > On 5/20/2009 7:25 AM Robert Berman said... > > Hi, > > > > Given a list of options: option_1...option_n. For each option I have > > a corresponding function: func_1...

Re: [Tutor] Iterating over list of functions

2009-05-20 Thread Emile van Sebille
On 5/20/2009 7:25 AM Robert Berman said... Hi, Given a list of options: option_1...option_n. For each option I have a corresponding function: func_1. func_n. I have all function names defined in a list similar to flist = [func_1, func_2,...func_n] which I know is a legitimate constru

Re: [Tutor] Iterating over list of functions

2009-05-20 Thread Christian Witts
Robert Berman wrote: Hi, Given a list of options: option_1...option_n. For each option I have a corresponding function: func_1. func_n. I have all function names defined in a list similar to flist = [func_1, func_2,...func_n] which I know is a legitimate construct having found a simi

Re: [Tutor] Iterating over list of functions

2009-05-20 Thread Lie Ryan
Robert Berman wrote: Hi, Given a list of options: option_1...option_n. For each option I have a corresponding function: func_1. func_n. I have all function names defined in a list similar to flist = [func_1, func_2,...func_n] which I know is a legitimate construct having found a simi

Re: [Tutor] delphi, pascal and Python

2009-05-20 Thread Christian Witts
Andy Cheesman wrote: Hi people Is there a Method for wrapping delphi and/or pascal code into python like SWIG? I've googled to no avail, Can anyone help me? Andy ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Iterating over list of functions

2009-05-20 Thread Robert Berman
Hi, Given a list of options: option_1...option_n. For each option I have a corresponding function: func_1. func_n. I have all function names defined in a list similar to flist = [func_1, func_2,...func_n] which I know is a legitimate construct having found a similar construct discusse

[Tutor] delphi, pascal and Python

2009-05-20 Thread Andy Cheesman
Hi people Is there a Method for wrapping delphi and/or pascal code into python like SWIG? I've googled to no avail, Can anyone help me? Andy ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor