[Tutor] Fwd: Fwd: Python bingo game.

2014-04-03 Thread Hardik Gandhi



Begin forwarded message:

> From: Hardik Gandhi 
> Date: 2 April 2014 5:25:20 pm EDT
> To: Danny Yoo 
> Subject: Re: [Tutor] Fwd: Python bingo game.
> Reply-To: Hardik Gandhi 
> 
> Hello!
> 
> I am trying to build a bingo game on command prompt. That's my task in this 
> semester and i have studied some of the commands from internet, but ya 
> definitely i am still not so comfortable with the logic and use of commands 
> in python.
> 
> I have attach
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Gmane not picking up messages lately

2014-04-03 Thread Alan Gauld

On 03/04/14 05:58, DaveA wrote:

Gmane doesn't seem to be getting messages from either python tutor or
python list, for the last day or two.

...

Anybody else want to comment? Is the gateway broken or the particular
Android software?


I assume gmane since I've not been seeing anything on my
PC in  Thunderbird newsreader either.

But this came thru ok so I assume its fixed now...


--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] System output into variable?

2014-04-03 Thread leam hall
I've been trying to so a simple "run a command and put the output into a
variable". Using Python 2.4 and 2.6 with no option to move. The go is to do
something like this:

my_var = "ls -l my_file"

So far the best I've seen is:

line = os.popen('ls -l my_file', stdout=subprocess.PIPE, shell=True)
(out, err) = line.communicate()

With no way to make 'my_file' a variable.

I've got to be missing something, but I'm not sure what. Python has always
impressed me a a language without a lot of hoops to go through.

Leam

-- 
Mind on a Mission 
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Gmane not picking up messages lately

2014-04-03 Thread Dave Angel
DaveA  Wrote in message:


> Gmane doesn't seem to be getting messages from either python tutor or python
>  list, for the last day or two.

It's working again. 

> 


-- 
DaveA

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] unittest decorators

2014-04-03 Thread Peter Otten
Albert-Jan Roskam wrote:

> The unittest module has some really handy decorators: @unittest.skip
> and @unittest.skipIf. I use the former for temporary TODO or FIXME things,
> but I use the latter for a more permanent thing:
> @unittest.skipif(sys.version_info()[0] > 2). Yet, in the test summary you
> just see error, skipped, failed. Is it possible to not count the skipIf
> tests? 

You mean like this?

$ cat skiptest.py
import unittest
import sys

def hide_if(condition):
def g(f):
return None if condition else f
return g

class T(unittest.TestCase):
@hide_if(sys.version_info[0] > 2)
def test_two(self):
pass
@hide_if(sys.version_info[0] < 3)
def test_three(self):
pass

if __name__ == "__main__":
unittest.main()
$ python skiptest.py -v
test_two (__main__.T) ... ok

--
Ran 1 test in 0.000s

OK
$ python3 skiptest.py -v
test_three (__main__.T) ... ok

--
Ran 1 test in 0.000s

OK
$ 

> (other than using if-else inside the test --not really a bad
> solution either ;-)?

I don't understand that remark.

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] System output into variable?

2014-04-03 Thread Peter Otten
leam hall wrote:

> I've been trying to so a simple "run a command and put the output into a
> variable". Using Python 2.4 and 2.6 with no option to move. The go is to
> do something like this:
> 
> my_var = "ls -l my_file"
> 
> So far the best I've seen is:
> 
> line = os.popen('ls -l my_file', stdout=subprocess.PIPE, shell=True)
> (out, err) = line.communicate()
> 
> With no way to make 'my_file' a variable.
> 
> I've got to be missing something, but I'm not sure what. Python has always
> impressed me a a language without a lot of hoops to go through.

In Python 2.7 and above there is subprocess.check_output():

>>> import subprocess
>>> filename = "my_file"
>>> my_var = subprocess.check_output(["ls", "-l", filename])
>>> my_var
'-rw-r--r-- 1 nn nn 0 Apr  3 16:14 my_file\n'

Have a look at its source code, it should be possible to backport the function:

>>> import inspect
def check_output(*popenargs, **kwargs):
r"""Run command with arguments and return its output as a byte string.

If the exit code was non-zero it raises a CalledProcessError.  The
CalledProcessError object will have the return code in the returncode
attribute and output in the output attribute.

The arguments are the same as for the Popen constructor.  Example:

>>> check_output(["ls", "-l", "/dev/null"])
'crw-rw-rw- 1 root root 1, 3 Oct 18  2007 /dev/null\n'

The stdout argument is not allowed as it is used internally.
To capture standard error in the result, use stderr=STDOUT.

>>> check_output(["/bin/sh", "-c",
...   "ls -l non_existent_file ; exit 0"],
...  stderr=STDOUT)
'ls: non_existent_file: No such file or directory\n'
"""
if 'stdout' in kwargs:
raise ValueError('stdout argument not allowed, it will be overridden.')
process = Popen(stdout=PIPE, *popenargs, **kwargs)
output, unused_err = process.communicate()
retcode = process.poll()
if retcode:
cmd = kwargs.get("args")
if cmd is None:
cmd = popenargs[0]
raise CalledProcessError(retcode, cmd, output=output)
return output


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] System output into variable?

2014-04-03 Thread Walter Prins
Hi Leam,


On 3 April 2014 15:24, leam hall  wrote:
>
> I've been trying to so a simple "run a command and put the output into a 
> variable". Using Python 2.4 and 2.6 with no option to move. The go is to do 
> something like this:
>
> my_var = "ls -l my_file"
>
> So far the best I've seen is:
>
> line = os.popen('ls -l my_file', stdout=subprocess.PIPE, shell=True)
> (out, err) = line.communicate()
>
> With no way to make 'my_file' a variable.


If you use IPython, this can be as simple as the following (this is on
windows, so 'ls -l' has been replaced by 'dir'):

Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)]
Type "copyright", "credits" or "license" for more information.

IPython 1.0.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help  -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: my_file='virtualenv.exe'

In [2]: my_var=!dir {my_file}

In [3]: print my_var
[' Volume in drive C has no label.', ' Volume Serial Number is
E8D7-900D', '', ' Directory of C:\\Python27\\Scripts', '', '2011/06/24
 11:12 7\xff168 virtualenv.exe', '   1 File(s)
  7\xff168 bytes', '   0 Dir(s)
47\xff655\xff469\xff056 bytes free']

In [4]:


Walter
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] System output into variable?

2014-04-03 Thread Danny Yoo
On Thu, Apr 3, 2014 at 10:14 AM, Walter Prins  wrote:
> Hi Leam,
>
>
> On 3 April 2014 15:24, leam hall  wrote:
>>
>> I've been trying to so a simple "run a command and put the output into a 
>> variable". Using Python 2.4 and 2.6 with no option to move. The go is to do 
>> something like this:
>>
>> my_var = "ls -l my_file"
>>
>> So far the best I've seen is:
>>
>> line = os.popen('ls -l my_file', stdout=subprocess.PIPE, shell=True)
>> (out, err) = line.communicate()

HI Walter,

If you can, use the subprocess module instead.  Also, avoid passing a
single string representing the command list, but rather pass a list.
This will also give you an easier opportunity to pass in variable data
to the external call.

e.g.

cmd = subprocess.check_output(['ls', '-l', 'my_file'])

where it should be easier to see that you can replace any of the
string literals there, like 'my_file', with any other expression that
evaluates to a string value.

Do NOT use shell=True unless you really know what you're doing: you
can open a potential security hole in your programs if you use that
option indiscriminately.

See the subprocess documentation for a few examples.

https://docs.python.org/2/library/subprocess.html



By the way, if you are trying to get information about the file, don't
depend on an external system call here.  Use the standard library's
file stat functions.  You'll have an easier time at it.  See:

https://docs.python.org/2/library/os.html#files-and-directories
https://docs.python.org/2/library/os.html?highlight=stat#os.stat

for more details.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] System output into variable?

2014-04-03 Thread Danny Yoo
Oh, sorry Walter.  I thought you were the original questioner.  Sorry
about confusing you with Learn Hall.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] System output into variable?

2014-04-03 Thread Alan Gauld

On 03/04/14 14:24, leam hall wrote:

I've been trying to so a simple "run a command and put the output into a
variable". Using Python 2.4 and 2.6 with no option to move. The go is to
do something like this:

my_var = "ls -l my_file"


I'm not sure what you mean here?
What should my_var contain? The command string or the result of the 
command? In this case that would be a long file listing including all 
the access, size info etc?



So far the best I've seen is:

line = os.popen('ls -l my_file', stdout=subprocess.PIPE, shell=True)
(out, err) = line.communicate()


Don't use os.popen(), it should be viewed as legacy code.
Use subprocess instead. There are several options including the call()
function, or the full blown Popen class.


With no way to make 'my_file' a variable.


In your original version you could use string formatting to insert the 
file name but using subprocess the issue goes away because you build the 
command as a list of substrings, one of which is the file(in your case) 
and it can be a variable or literal as you require.



I've got to be missing something, but I'm not sure what. Python has
always impressed me a a language without a lot of hoops to go through.


subprocess can be a tad daunting but it is very powerful and once you 
get the hang of it quite straightforward.


HTH
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Storing dictionary value, indexed by key, into a variable

2014-04-03 Thread John Aten
I apologize for the omissions, I thought that I had isolated the problem, but I 
was way off the mark. The problem was, as suggested by Danny and Peter, in the 
function where the dictionary is assigned. I ran the type function, as Alex 
advised, and lo and behold the function was returning a string. In researching 
this, I learned that a function can return multiple values, so I expanded 
things a bit. Now, the function that randomly selects which demonstrative to 
drill also selects which a string to present as the clue (the first part, 
anyway), and returns the dictionary and the first part of the clue in a tuple. 
I then unpack that tuple into variables and work with those. 

The thing is, this looks really messy Could anyone give me some pointers on how 
this could be more elegantly done?

Here's the full code:
import random
import os

# ille, that/those masculine
that_those_Masculine_Singular = {'nom': 'ille', 'gen': 'illīus', 'dat': 'illī', 
'acc': 'illum', 'abl': 'illō'}
that_those_Masculine_Plural = {'nom': 'illī', 'gen': 'illōrum', 'dat': 'illīs', 
'acc': 'illōs', 'abl': 'illīs'}

# the rest of the dictionaries are empty. I wanted to get it working before 
putting everything in. 
# ille, that/those feminine
that_those_Feminine_Singular = {'nom': '', 'gen': '', 'dat': '', 'acc': '', 
'abl': ''}
that_those_Feminine_Plural = {'nom': '', 'gen': '', 'dat': '', 'acc': '', 
'abl': ''}

# ille, that/those neuter
that_those_Neuter_Singular = {'nom': '', 'gen': '', 'dat': '', 'acc': '', 
'abl': ''}
that_those_Neuter_Plural = {'nom': '', 'gen': '', 'dat': '', 'acc': '', 'abl': 
''}

# hic, this/these masculine
this_these_Masculine_Singular = {'nom': '', 'gen': '', 'dat': '', 'acc': '', 
'abl': ''}
this_these_Masculine_Plural = {'nom': '', 'gen': '', 'dat': '', 'acc': '', 
'abl': ''}

# hic, this/these feminine
this_these_Feminine_Singular = {'nom': '', 'gen': '', 'dat': '', 'acc': '', 
'abl': ''}
this_these_Feminine_Plural = {'nom': '', 'gen': '', 'dat': '', 'acc': '', 
'abl': ''}

# hic, this/these neuter
this_these_Neuter_Singular = {'nom': '', 'gen': '', 'dat': '', 'acc': '', 
'abl': ''}
this_these_Neuter_Plural = {'nom': '', 'gen': '', 'dat': '', 'acc': '', 'abl': 
''}

# iste, that (near you/of yours) masculine 
that_near_you_Masculine_Singular = {'nom': '', 'gen': '', 'dat': '', 'acc': '', 
'abl': ''}
that_near_you_Masculine_Plural = {'nom': '', 'gen': '', 'dat': '', 'acc': '', 
'abl': ''}

# iste, that (near you/of yours) feminine
that_near_you_Feminine_Singular = {'nom': '', 'gen': '', 'dat': '', 'acc': '', 
'abl': ''}
that_near_you_Feminine_Plural = {'nom': '', 'gen': '', 'dat': '', 'acc': '', 
'abl': ''}

# iste, that (near you/of yours) neuter
that_near_you_Neuter_Singular = {'nom': '', 'gen': '', 'dat': '', 'acc': '', 
'abl': ''}
that_near_you_Neuter_Plural = {'nom': '', 'gen': '', 'dat': '', 'acc': '', 
'abl': ''}


guess = ''
score = 0
tries = 0

while guess != 'exit':

def chooseDemonstrative():
# N = random.randint(1,18)
N = 1 # This line will be removed so that it will pick any one 
of the dictionaries to be filled in above. This is just to get it working.
Demonstrative = {} 
Clue1 = ''
if N == 1:
Demonstrative = that_those_Masculine_Singular
Clue1 = 'That/Those, Masculine Singular Demonstrative 
Pronoun/Adjective'
elif N == 2:
Demonstrative = 'that_those_Masculine_Plural'
elif N == 3:
Demonstrative = 'that_those_Feminine_Singular'
elif N == 4:
Demonstrative = 'that_those_Feminine_Plural'
elif N == 5: 
Demonstrative = 'that_those_Neuter_Singular'
elif N == 6:
Demonstrative = 'that_those_Neuter_Plural'
elif N == 7:
Demonstrative = 'this_these_Masculine_Singular'
elif N == 8:
Demonstrative = 'this_these_Masculine_Plural'
elif N == 9:
Demonstrative = 'this_these_Feminine_Singular'
elif N == 10:
Demonstrative = 'this_these_Feminine_Plural'
elif N == 11:
Demonstrative = 'this_these_Neuter_Singular'
elif N == 12:
Demonstrative = 'this_these_Neuter_Plural'
elif N == 13:
Demonstrative = 'that_near_you_Masculine_Singular'
elif N == 14:
Demonstrative = 'that_near_you_Masculine_Plural'
elif N == 15:
Demonstrative = 'that_near_you_Feminine_Singular'
elif N == 16:
Demonstrative = 'that_near_you_Feminine_Plural'
elif N == 17:
Demonstrative = '

Re: [Tutor] Storing dictionary value, indexed by key, into a variable

2014-04-03 Thread Peter Otten
John Aten wrote:

> I apologize for the omissions, I thought that I had isolated the problem,
> but I was way off the mark. The problem was, as suggested by Danny and
> Peter, in the function where the dictionary is assigned. I ran the type
> function, as Alex advised, and lo and behold the function was returning a
> string. In researching this, I learned that a function can return multiple
> values, so I expanded things a bit. Now, the function that randomly
> selects which demonstrative to drill also selects which a string to
> present as the clue (the first part, anyway), and returns the dictionary
> and the first part of the clue in a tuple. I then unpack that tuple into
> variables and work with those.
> 
> The thing is, this looks really messy Could anyone give me some pointers
> on how this could be more elegantly done?

Instead of the many if...elif switches try to put the alternatives into a 
list, e. g.

>>> cases = [
... "Nominative",
... "Genitive",
... "Dative",
... "Accusative",
... "Ablative"
... ]

(These could also be tuples cases = [("nom", "Nominative"), ...] but I 
wouldn't bother because you can derive "nom" from "Nominative" when the need 
arises. How?)

You can then pick a random number in the range
0 <= random_number < len(cases) 
to choose an item from the list:

>>> import random
>>> cases[random.randrange(len(cases))]
'Accusative'
>>> cases[random.randrange(len(cases))]
'Ablative'

This operation is so common that there is a dedicated function:

>>> random.choice(cases)
'Dative'

Reimplement the chooseCase() function with this approach first and then see 
if you can build an appropriate list for an analogous implementation of 
chooseDemonstrative(). Come back here for more hints if you are stuck.

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Storing dictionary value, indexed by key, into a variable

2014-04-03 Thread Danny Yoo
>> The thing is, this looks really messy Could anyone give me some pointers
>> on how this could be more elegantly done?
>
> Instead of the many if...elif switches try to put the alternatives into a
> list, e. g.
>
 cases = [
> ... "Nominative",
> ... "Genitive",
> ... "Dative",
> ... "Accusative",
> ... "Ablative"
> ... ]


To restate what Peter is presenting: transforming the control flow
structure of the program (if statements) is the key.  That is, we take
that control flow structure and rephrase it as _data_ structures
(lists, dicts).

You'll also hear the term "Data Driven Programming" or "Table Driven
Programming" to refer to this idea.  For example:

http://blogs.msdn.com/b/ericlippert/archive/2004/02/24/79292.aspx

It's a core idea, and definitely worth practicing by fixing the
program.  You'll see all that control flow structure dissolve away.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Learn programming by visualizing code execution

2014-04-03 Thread Mark Lawrence
That's what this site http://pythontutor.com/ claims although I haven't 
tried it myself.  Hopefully it's of some use to all you newbies out there :)


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Storing dictionary value, indexed by key, into a variable

2014-04-03 Thread Alex Kleider

On 2014-04-03 13:52, Danny Yoo wrote:


You'll also hear the term "Data Driven Programming" or "Table Driven
Programming" to refer to this idea.  For example:

http://blogs.msdn.com/b/ericlippert/archive/2004/02/24/79292.aspx



Does anyone know of a similar blog or tutorial (regarding Data Driven 
Programming) that uses Python for it's example(s)?  From what I've read 
so far, 'data driven' is a concept quite independent of 'object 
oriented'.

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Learn programming by visualizing code execution

2014-04-03 Thread Alan Gauld

On 03/04/14 23:44, Mark Lawrence wrote:

That's what this site http://pythontutor.com/ claims although I haven't
tried it myself.  Hopefully it's of some use to all you newbies out
there :)



Ooh, clever!
I was expecting the code trace on the left but not the graphical data 
display on the right. I actually tried to build something similar into 
my tutor when I did the V3 update but it got far too complex

(my JavaScript skills are not that good and JQuery was in its
infancy then).

I don't know how good it is as a tutor but the visuals are certainly 
slick. Pity I can't see the source code to see how they do it...


--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Storing dictionary value, indexed by key, into a variable

2014-04-03 Thread Alan Gauld

On 04/04/14 00:09, Alex Kleider wrote:

On 2014-04-03 13:52, Danny Yoo wrote:


You'll also hear the term "Data Driven Programming" or "Table Driven
Programming" to refer to this idea.  For example:

http://blogs.msdn.com/b/ericlippert/archive/2004/02/24/79292.aspx



Does anyone know of a similar blog or tutorial (regarding Data Driven
Programming) that uses Python for it's example(s)?  From what I've read
so far, 'data driven' is a concept quite independent of 'object oriented'.


I don't know of a Python tutorial.
Yes, data driven is completely different to OO.

It is complementary in that you can data drive OO programs too.
And to some extent Python is an example of a data driven
design since function (and method) calls are associated with
dictionaries (ie Python namespaces).

hth
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] conditional execution

2014-04-03 Thread Mark Lawrence

On 02/04/2014 08:18, spir wrote:

On 04/01/2014 06:24 PM, Zachary Ware wrote:

Hi Patti,

On Tue, Apr 1, 2014 at 11:07 AM, Patti Scott  wrote:

I've been cheating:  comment out the conditional statement and adjust
the
indents. But, how do I make my program run with if __name__ == 'main':
main() at the end?  I thought I understood the idea to run a module
called
directly but not a module imported.  My program isn't running, though.


The simple fix to get you going is to change your ``if __name__ ==
'main':`` statement to ``if __name__ == '__main__':`` (add two
underscores on each side of "main").  To debug this for yourself, try
putting ``print(__name__)`` right before your ``if __name__ ...``
line, and see what is printed when you run it in different ways.

Hope this helps, and if you need any more help or a more in-depth
explanation of what's going on, please don't hesitate to ask :)


And you don't even need this idiom if your module is only to be executed
(not imported). Just write "main()".



A counter to the above comment 
http://www.jeffknupp.com/blog/2014/04/03/dont-write-python-scripts-write-python-libraries/


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Learn programming by visualizing code execution

2014-04-03 Thread Danny Yoo
> I don't know how good it is as a tutor but the visuals are certainly slick.
> Pity I can't see the source code to see how they do it...

https://github.com/pgbovine/OnlinePythonTutor/
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Learn programming by visualizing code execution

2014-04-03 Thread Danny Yoo
By the way, the main developer on the pythontutor.org project is
awesome.  http://www.pgbovine.net/
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] data driven programming

2014-04-03 Thread Alex Kleider

On 2014-04-03 16:36, Alan Gauld wrote:

On 04/04/14 00:09, Alex Kleider wrote:

On 2014-04-03 13:52, Danny Yoo wrote:


You'll also hear the term "Data Driven Programming" or "Table Driven
Programming" to refer to this idea.  For example:

http://blogs.msdn.com/b/ericlippert/archive/2004/02/24/79292.aspx



Does anyone know of a similar blog or tutorial (regarding Data Driven
Programming) that uses Python for it's example(s)?  From what I've 
read
so far, 'data driven' is a concept quite independent of 'object 
oriented'.


I don't know of a Python tutorial.
Yes, data driven is completely different to OO.

It is complementary in that you can data drive OO programs too.
And to some extent Python is an example of a data driven
design since function (and method) calls are associated with
dictionaries (ie Python namespaces).

hth


Can you elaborate, please, on what you mean by pointing out that the 
fact that Python's function and method calls are associated with 
dictionaries makes it 'an example of data driven design?'  I'm not clear 
on that relationship.  Thanks, Alex

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor