Re: [Tutor] ssh script

2008-01-24 Thread washakie

Thanks everyone these seem like promising directions to go... Eric, any
chance you could share your 'similar' code? The problem it seems with
paramiko is that it has little 'newbie' documentation, and I'm not clear how
to set up the reverse port forwarding on it. Thus I may need to use the
pexpect solution. 

-- 
View this message in context: 
http://www.nabble.com/ssh-script-tp15038129p15060411.html
Sent from the Python - tutor mailing list archive at Nabble.com.

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Comparing more than 2 lists

2008-01-24 Thread Fiyawerx
I have been able to find a few articles on comparing 2 lists, but I have 4
lists that I need to compare. I need to find any repeated elements and the
list that they came from. For example,

list1 = ['one', 'two', 'three']
list2 = ['one', 'two', 'four', 'five']
list3 = ['two', 'three', 'six', 'seven']
list4 = ['three', 'five', 'six']


I need to be able to get along the lines of output:
Element 'one' contained in list1 and list2
Element 'two' contained in list1 and list2 and list3
...
Element 'five' contained in list2 and list4

etc.. and I can't quite figure out how to go about it
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Comparing more than 2 lists

2008-01-24 Thread Michael Langford
You use a variation on bucket sort do to this:
http://en.wikipedia.org/wiki/Bucket_sort

You make a dict where the keys are the values in the lists, and a name
for each list is in the problem.

So you get something that looks like:

one: list1, list2
two: list1, list2, list3
etc

Doing this with collections.defaultdict is a breeze:
import collections

dd = collections.defaultdict(list)
for eachlist in lists:
   for each in eachlist:
   dd[each].append(getListName(eachlist))

Then to find the repeated elements you filter  where the list is of length > 1.

for each in dd:
 print "%s: %s" % (each, dd[each])

I'd provide code, but I'm not sure what an appropriate naming function
is for you, nor am I sure what you're doing with this when you're
done.

--Michael



On Jan 24, 2008 3:15 AM, Fiyawerx <[EMAIL PROTECTED]> wrote:
> I have been able to find a few articles on comparing 2 lists, but I have 4
> lists that I need to compare. I need to find any repeated elements and the
> list that they came from. For example,
>
> list1 = ['one', 'two', 'three']
> list2 = ['one', 'two', 'four', 'five']
> list3 = ['two', 'three', 'six', 'seven']
> list4 = ['three', 'five', 'six']
> https://mail.google.com/mail/#label/Pythontutor/117aadf8364dbf3b
Gmail - [Tutor] Comparing more than 2 lists - [EMAIL PROTECTED]
>
>  I need to be able to get along the lines of output:
> Element 'one' contained in list1 and list2
> Element 'two' contained in list1 and list2 and list3
> ...
> Element 'five' contained in list2 and list4
>
> etc.. and I can't quite figure out how to go about it
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>



-- 
Michael Langford
Phone: 404-386-0495
Consulting: http://www.RowdyLabs.com
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] creating a nested dictionary

2008-01-24 Thread Garry Willgoose
Is there any easy way to create a nested dictionary. I want to be  
able to allocate like

pdb[dataset][modulename][parametername]['value']=value

where dataset, modulename, parametername are variables that are  
determined within loops nested 3 deep, and value comes from a  
database call. Prior to the nested loops I do not know what the  
values of dataset, modulename, parametername will range over, but I  
do know pdb needs to be nested 3 deep. What I'd like to do is  
something like this

pdb={}
for dataset in dataset_list:
modulename_list=getmodules(dataset)
for modulename in modulename_list:
parametername_list=getparameters(dataset,modulename)
for parametername in parametername_list:
value=getvalue(dataset, modulename, parametername)
pdb[dataset][modulename][parametername]['value']=value

What I'm currently doing is

pdb={}
for dataset in dataset_list:
modulename_list=getmodules(dataset)
moduledict={}
for modulename in modulename_list:
parametername_list=getparameters(dataset,modulename)
valuedict={}
for parametername in parametername_list:
value=getvalue(dataset, modulename, parametername)
valuedict['value']=value
#  valuedict needs to be a dictionary because there is other stuff
valuedict['otherstuff]=otherstuff
...
parameterdict[parametername]=valuedict.copy()
moduledict[modeulename]=copy.deepcopy(parameterdict)
pdb[dataset]=copy.deepcopy(moduledict)


Now I know the 2nd is not that much more complex but this is a pretty  
common construct in what I'm doing so I'm just wondering if there is   
a clear and simple shortcut ;-)



Prof Garry Willgoose,
Australian Professorial Fellow in Environmental Engineering,
Director, Centre for Climate Impact Management (C2IM),
School of Engineering, The University of Newcastle,
Callaghan, 2308
Australia.

Centre webpage: www.c2im.org.au

Phone: (International) +61 2 4921 6050 (Tues-Fri AM); +61 2 6545 9574  
(Fri PM-Mon)
FAX: (International) +61 2 4921 6991 (Uni); +61 2 6545 9574 (personal  
and Telluric)
Env. Engg. Secretary: (International) +61 2 4921 6042

email:  [EMAIL PROTECTED];  
[EMAIL PROTECTED]
email-for-life: [EMAIL PROTECTED]
personal webpage: www.telluricresearch.com/garry

"Do not go where the path may lead, go instead where there is no path  
and leave a trail"
   Ralph Waldo Emerson






___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] creating a nested dictionary

2008-01-24 Thread Remco Gerlich
Hi,

Stream of consciousness answer:

So, you want to set things in a dictionary with a statement like
d[a][b][c][d] = x,
 even though d[a] wasn't used before so it's not initialized yet (let alone
d[a][b]).

Of course, if d is a dict, the d[a] = x works. That's one level deep, and
non existing keys are just created for you. More levels is harder.

In the collections module, there is a defaultdict object. You can tell it
what to use as a default for some value if it doesn't exist yet. Other than
that, it works as a normal dict.
Say, if we do:

from collections import defaultdict
d = defaultdict(dict)

Then, if you use d[a] when it doesn't exist yet, it will call dict() to
create a new dictionary.

So now d[a][b] = x works.

But d[a][b][c] = x still doesn't, since the newly created dictionary isn't
_itself_ a default dictionary - it's a normal dict.

Instead of 'dict', we need to give defaultdict a function that takes no
arguments and returns a defaultdictionary object. Like

d = defaultdict(lambda: defaultdict(dict))

Now d[a][b][c] = x works. But, again, the last one is a dict, so we still
can't go deeper...

Now of course d = defaultdict(lambda: defaultdict(lambda:
defaultdict(dict))) is there. It solves your problem; you can now set
d[a][b][c][d] = x.

(importantly, you shouldn't mix depths; don't first set d[a][b][c] = 3 and
then try to set d[a][b][c][d]; since d[a][b][c] won't be a dictionary
anymore).

I can't think of a really good generalization, one that will work for all
depths. That's the sort of thing you use Lisp, combinators and lots of
coffee for. Perhaps later today.

For now though:

def deep_default_dict(level):
   if level < 1:
  raise ValueError()
   result = dict
   while level > 1:
  result = lambda: defaultdict(result)
  level -= 1
   return result

d = deep_default_dict(4)()

Should give a dictionary for level=1 and the appropriate defaultdict for the
number of levels you need.

But I can't test right now...

Remco


On Jan 24, 2008 8:20 AM, Garry Willgoose <[EMAIL PROTECTED]>
wrote:

> Is there any easy way to create a nested dictionary. I want to be
> able to allocate like
>
> pdb[dataset][modulename][parametername]['value']=value
>
> where dataset, modulename, parametername are variables that are
> determined within loops nested 3 deep, and value comes from a
> database call. Prior to the nested loops I do not know what the
> values of dataset, modulename, parametername will range over, but I
> do know pdb needs to be nested 3 deep. What I'd like to do is
> something like this
>
> pdb={}
> for dataset in dataset_list:
>modulename_list=getmodules(dataset)
>for modulename in modulename_list:
>parametername_list=getparameters(dataset,modulename)
>for parametername in parametername_list:
>value=getvalue(dataset, modulename, parametername)
>
>  pdb[dataset][modulename][parametername]['value']=value
>
> What I'm currently doing is
>
> pdb={}
> for dataset in dataset_list:
>modulename_list=getmodules(dataset)
>moduledict={}
>for modulename in modulename_list:
>parametername_list=getparameters(dataset,modulename)
>valuedict={}
>for parametername in parametername_list:
>value=getvalue(dataset, modulename, parametername)
>valuedict['value']=value
> #  valuedict needs to be a dictionary because there is other stuff
>valuedict['otherstuff]=otherstuff
> ...
>parameterdict[parametername]=valuedict.copy()
>moduledict[modeulename]=copy.deepcopy(parameterdict)
>pdb[dataset]=copy.deepcopy(moduledict)
>
>
> Now I know the 2nd is not that much more complex but this is a pretty
> common construct in what I'm doing so I'm just wondering if there is
> a clear and simple shortcut ;-)
>
>
> 
> Prof Garry Willgoose,
> Australian Professorial Fellow in Environmental Engineering,
> Director, Centre for Climate Impact Management (C2IM),
> School of Engineering, The University of Newcastle,
> Callaghan, 2308
> Australia.
>
> Centre webpage: www.c2im.org.au
>
> Phone: (International) +61 2 4921 6050 (Tues-Fri AM); +61 2 6545 9574
> (Fri PM-Mon)
> FAX: (International) +61 2 4921 6991 (Uni); +61 2 6545 9574 (personal
> and Telluric)
> Env. Engg. Secretary: (International) +61 2 4921 6042
>
> email:  [EMAIL PROTECTED];
> [EMAIL PROTECTED]
> email-for-life: [EMAIL PROTECTED]
> personal webpage: www.telluricresearch.com/garry
> 
> "Do not go where the path may lead, go instead where there is no path
> and leave a trail"
>   Ralph Waldo Emerson
> 
>
>
>
>
>
> ___
> Tutor maillis

Re: [Tutor] creating a nested dictionary

2008-01-24 Thread Remco Gerlich
Of course, I forgot to mention that you can use tuples as dictionary keys.

A common idiom is:

pdb[(dataset, modulename, parametername, 'value')] = value.

And if that works for you, it's much simpler. But you lose the ability to
use, say, pdb[dataset][modulename] as a dictionary on its own.

Remco


On Jan 24, 2008 8:20 AM, Garry Willgoose <[EMAIL PROTECTED]>
wrote:

> Is there any easy way to create a nested dictionary. I want to be
> able to allocate like
>
> pdb[dataset][modulename][parametername]['value']=value
>
> where dataset, modulename, parametername are variables that are
> determined within loops nested 3 deep, and value comes from a
> database call. Prior to the nested loops I do not know what the
> values of dataset, modulename, parametername will range over, but I
> do know pdb needs to be nested 3 deep. What I'd like to do is
> something like this
>
> pdb={}
> for dataset in dataset_list:
>modulename_list=getmodules(dataset)
>for modulename in modulename_list:
>parametername_list=getparameters(dataset,modulename)
>for parametername in parametername_list:
>value=getvalue(dataset, modulename, parametername)
>
>  pdb[dataset][modulename][parametername]['value']=value
>
> What I'm currently doing is
>
> pdb={}
> for dataset in dataset_list:
>modulename_list=getmodules(dataset)
>moduledict={}
>for modulename in modulename_list:
>parametername_list=getparameters(dataset,modulename)
>valuedict={}
>for parametername in parametername_list:
>value=getvalue(dataset, modulename, parametername)
>valuedict['value']=value
> #  valuedict needs to be a dictionary because there is other stuff
>valuedict['otherstuff]=otherstuff
> ...
>parameterdict[parametername]=valuedict.copy()
>moduledict[modeulename]=copy.deepcopy(parameterdict)
>pdb[dataset]=copy.deepcopy(moduledict)
>
>
> Now I know the 2nd is not that much more complex but this is a pretty
> common construct in what I'm doing so I'm just wondering if there is
> a clear and simple shortcut ;-)
>
>
> 
> Prof Garry Willgoose,
> Australian Professorial Fellow in Environmental Engineering,
> Director, Centre for Climate Impact Management (C2IM),
> School of Engineering, The University of Newcastle,
> Callaghan, 2308
> Australia.
>
> Centre webpage: www.c2im.org.au
>
> Phone: (International) +61 2 4921 6050 (Tues-Fri AM); +61 2 6545 9574
> (Fri PM-Mon)
> FAX: (International) +61 2 4921 6991 (Uni); +61 2 6545 9574 (personal
> and Telluric)
> Env. Engg. Secretary: (International) +61 2 4921 6042
>
> email:  [EMAIL PROTECTED];
> [EMAIL PROTECTED]
> email-for-life: [EMAIL PROTECTED]
> personal webpage: www.telluricresearch.com/garry
> 
> "Do not go where the path may lead, go instead where there is no path
> and leave a trail"
>   Ralph Waldo Emerson
> 
>
>
>
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Comparing more than 2 lists

2008-01-24 Thread Fiyawerx
Thanks Michael, this worked great, time to read up on collections!

On Jan 24, 2008 3:36 AM, Michael Langford <[EMAIL PROTECTED]>
wrote:

> You use a variation on bucket sort do to this:
> http://en.wikipedia.org/wiki/Bucket_sort
>
> You make a dict where the keys are the values in the lists, and a name
> for each list is in the problem.
>
> So you get something that looks like:
>
> one: list1, list2
> two: list1, list2, list3
> etc
>
> Doing this with collections.defaultdict is a breeze:
> import collections
>
> dd = collections.defaultdict(list)
> for eachlist in lists:
>   for each in eachlist:
>   dd[each].append(getListName(eachlist))
>
> Then to find the repeated elements you filter  where the list is of length
> > 1.
>
> for each in dd:
> print "%s: %s" % (each, dd[each])
>
> I'd provide code, but I'm not sure what an appropriate naming function
> is for you, nor am I sure what you're doing with this when you're
> done.
>
>--Michael
>
>
>
> On Jan 24, 2008 3:15 AM, Fiyawerx <[EMAIL PROTECTED]> wrote:
> > I have been able to find a few articles on comparing 2 lists, but I have
> 4
> > lists that I need to compare. I need to find any repeated elements and
> the
> > list that they came from. For example,
> >
> > list1 = ['one', 'two', 'three']
> > list2 = ['one', 'two', 'four', 'five']
> > list3 = ['two', 'three', 'six', 'seven']
> > list4 = ['three', 'five', 'six']
> > https://mail.google.com/mail/#label/Pythontutor/117aadf8364dbf3b
> Gmail - [Tutor] Comparing more than 2 lists - [EMAIL PROTECTED]
> >
> >  I need to be able to get along the lines of output:
> > Element 'one' contained in list1 and list2
> > Element 'two' contained in list1 and list2 and list3
> > ...
> > Element 'five' contained in list2 and list4
> >
> > etc.. and I can't quite figure out how to go about it
> >
> >
> > ___
> > Tutor maillist  -  Tutor@python.org
> > http://mail.python.org/mailman/listinfo/tutor
> >
> >
>
>
>
> --
> Michael Langford
> Phone: 404-386-0495
> Consulting: http://www.RowdyLabs.com
>
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] lst file

2008-01-24 Thread SwartMumba snake
Hi

I am trying to read from  a specific .lst file. When I read from it, it just 
prints out blank lines and I am sure that this file contains content.

This is what I am using to read from the file:

f = open("C:\\Users\\UserName\\Directory\\words.lst")

for line in f:
print line

f.close()

Do you guys know what is wrong?

Thanks in advance.

   
-
Never miss a thing.   Make Yahoo your homepage.___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] lst file

2008-01-24 Thread Remco Gerlich
Many things could be wrong; perhaps with reading the file, or the lines, or
with printing them... Debugging usually consists of what the problem is
exactly, where it occurs.

First thing I'd look at is seeing whether the lines do get read. I would
change "print line" into "print len(line)" and see if the lines are empty,
or filled with unprintable things.

Also, what sort of file is it?

Remco


On Jan 24, 2008 11:42 AM, SwartMumba snake <[EMAIL PROTECTED]> wrote:

> Hi
>
> I am trying to read from  a specific .lst file. When I read from it, it
> just prints out blank lines and I am sure that this file contains content.
>
> This is what I am using to read from the file:
>
> f = open("C:\\Users\\UserName\\Directory\\words.lst")
>
> for line in f:
> print line
>
> f.close()
>
> Do you guys know what is wrong?
>
> Thanks in advance.
>
> --
> Never miss a thing. Make Yahoo your 
> homepage.
>
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] MySQLdb for Python 2.5? (Debian related)

2008-01-24 Thread tetsuo2k6
Michael Langford schrieb:
>> However, Debian is known for stability and security, right? I don't know
>> if I should install things without apt in a production environment, so I
>> first have to ask my guru if it's alright.
> 
> The *point* of buildout is that the entire installation is *local* to
> the application. There is no change system wide, just for the
> application that is running. This is *much* safer than using the
> system package manager. Its like running a standalone exe like putty
> on windows, versus installing a microsoft product.
> 
>--Michael
> 

We're already considering to use the cheese shop for for all our Python 
stuff!

Again, thanks a lot for the hint!

- Paul

> 
> 
>> Michael Langford schrieb:
>>> It's a distribution issue. As far as what I've found as having cutting
>>> edge (or even reasonably fresh) python packages in your package
>>> manager is dictated by the distro, who vary wildly in this.
>>>
>>> Debian SID at times> All the Ubuntus > Debian SID at times> Fedora
>>> Core > Debian testing > Debian stable
>>>
>>> This is the #1 reason I use ubuntu on servers right now. And if the
>>> above is wrong now, these are generally feelings about a small sample
>>> set over a period of time. I really have just gone all Kubuntu/Xubuntu
>>> where I can these days.
>>>
>>> I will suggest you look into learning eggs, cheese shop and
>>> easy_install as an alternative to OS based package management for
>>> python. I was an awesome presentation by Brandon Rhodes Mill about
>>> Buildout  at PyAtl a couple weeks ago. It automagically downloads all
>>> the eggs you need. You just create a setup.py and a quick config file,
>>> and check those in with your source. When you run a command when you
>>> start developing on a checkout, it pulls down all the eggs you need to
>>> work with that checkout from the cheeshop, putting them in a project
>>> local directory, which is then prepended to the python search path for
>>> that project.
>>>
>>> This means site-packages and you don't have fights when you install on
>>> multiple system who may need other past versions of modules. Buildout
>>> also gets the right version of python on the machine ( in a local
>>> directory again ) and is compatible with system where you don't have
>>> root access.
>>>
>>> Buildout was originally written by the Zope people I believe, but has
>>> been made independent of zope so all of us non-zope people can use it.
>>>
>>>   --Michael
>>>
>>> Cheese Shop: www.python.org/pypi
>>> Monty Python Cheese Shop Skit: www.youtube.com/watch?v=B3KBuQHHKx0
>>> Buildout: www.python.org/pypi/zc.buildout
>>> More about Eggs: http://peak.telecommunity.com/DevCenter/PythonEggs
>>> PyAtl (where presumably his talk will be posted): http://pyatl.org/
>>>
>>> On Jan 23, 2008 11:01 AM,  <[EMAIL PROTECTED]> wrote:
 I decided to install Python2.5 on the server machine to save me the time
 for low-level debugging >;) but it doesn't find the MySQLdb module...

 I searched through aptitude - the only thing I find is MySQLdb for Py2.4
 ... What's happening here?

 I have to say that the client PC (on which my script runs fine with 2.5)
 has Ubuntu installed - can it be that the MySQLdb module is behind in
 Debian?

 Sorry for going off topic - if you guys don't want that here can move
 the problem to the Debian list - but maybe someone here knows about the
 status of the packages...?

 - Paul
 ___
 Tutor maillist  -  Tutor@python.org
 http://mail.python.org/mailman/listinfo/tutor

>>>
>>>
>> ___
>> Tutor maillist  -  Tutor@python.org
>> http://mail.python.org/mailman/listinfo/tutor
>>
> 
> 
> 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] [ctypes-users] calls to windll.user32

2008-01-24 Thread Tiger12506
> Something like this happens with Pygame and IDLE.  In Windows if you 
> right click on a Python file and choose the "Edit with IDLE" option IDLE 
> is started with a single process.  If the program is run and it does its 
> own windowing then it conflicts with Tkinter, used by IDLE.  Start IDLE 
> first, then open the file to edit.

Change the registry setting makes it easier to code in the future.

HKEY_CLASSES_ROOT\Python.File\shell\Edit with IDLE\command
"C:\Python25\pythonw.exe" "C:\Python25\Lib\idlelib\idle.pyw" -n -e "%1"

Take out the -n to remove the "no subprocess" option.
You should be able to use "Edit with IDLE" as expected.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] creating a nested dictionary

2008-01-24 Thread Kent Johnson
Remco Gerlich wrote:
> I can't think of a really good generalization, one that will work for 
> all depths. That's the sort of thing you use Lisp, combinators and lots 
> of coffee for. Perhaps later today.

Some nice solutions here:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/9519c885a24a65ea/c9697fa73bb59709

Kent
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] TypeError in base class __init__ after reload

2008-01-24 Thread Kent Johnson
Oops, sending to the list with this PS:
Google 'python reload' for discussion and workarounds.

Daniel Knierim wrote:
> Hello Pythonistas,
> 
> Running the script 'instantiate_and_reload.py' gives me the error 
> TypeError: unbound method __init__() must be called with ParentClass 
> instance as first argument (got ChildClass instance instead)

I haven't looked at your script closely enough to know exactly where the
  error is but there are some real problems with reloading modules when
you have references to objects in the module object. The module is
reloaded but the references are not automatically rebound to the new
module. In particular, names that are imported from the module will
still refer to the original module, and instances of classes from the
module will refer (via their __class__ attribute) to the original class.

The docs for reload() talk about this a little:
http://docs.python.org/lib/built-in-funcs.html#l2h-61

For example (using the cmd module just because it contains a class):
In [1]: from cmd import Cmd

Cmd is bound to the class object in the cmd module
In [2]: c=Cmd()

c is an instance of the original class

In [3]: import cmd
In [4]: cmd.Cmd is Cmd
Out[4]: True
In [5]: isinstance(c, cmd.Cmd)
Out[5]: True

cmd.Cmd, Cmd and c.__class__ all refer to the same class

In [6]: reload(cmd)
Out[6]: 
In [7]: isinstance(c, cmd.Cmd)
Out[7]: False

We now have a new class object bound to cmd.Cmd, it is not the same object!

In [8]: from cmd import Cmd
In [9]: c.__class__
Out[9]: 
In [10]: c.__class__ is Cmd
Out[10]: False

c.__class__ is still the old Cmd class

In [11]: Cmd is cmd.Cmd
Out[11]: True
In [12]: reload(cmd)
Out[12]: 
In [13]: Cmd is cmd.Cmd
Out[13]: False

Cmd itself has the same trouble.

Kent

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] printing format with list

2008-01-24 Thread Andy Cheesman
Hi people

Is there a way to use a list with printf formating without having to 
explicitly expanding the list after the %

e.g

a = [1, 2, 3]

print """ Testing
%i, %i, %i """ %(a[0], a[1], a[2])


Cheers

Andy

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] printing format with list

2008-01-24 Thread Tim Golden
Andy Cheesman wrote:
> Hi people
> 
> Is there a way to use a list with printf formating without having to 
> explicitly expanding the list after the %
> 
> e.g
> 
> a = [1, 2, 3]
> 
> print """ Testing
> %i, %i, %i """ %(a[0], a[1], a[2])
> 

It looks as though string formatting only understands tuples,
not sequences in general:

a = [1, 2, 3]
print "Testing: %i, %i, %i" % tuple (a)

or just:

a = 1, 2, 3
print "Testing: %i, %i, %i" % a

TJG
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] printing format with list

2008-01-24 Thread Kent Johnson
Andy Cheesman wrote:
> Hi people
> 
> Is there a way to use a list with printf formating without having to 
> explicitly expanding the list after the %
> 
> e.g
> 
> a = [1, 2, 3]
> 
> print """ Testing
> %i, %i, %i """ %(a[0], a[1], a[2])

The argument after % must be a tuple (or a single item) so just convert 
the list to a tuple:
   print """ Testing %i, %i, %i """ % tuple(a)

or create it as a tuple to begin with if that is practical...

Kent
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Tutor Digest, Vol 47, Issue 64

2008-01-24 Thread prdo22002
Stop sending your mails

 Send Tutor mailing list submissions to
>   tutor@python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>   http://mail.python.org/mailman/listinfo/tutor
> or, via email, send a message with subject or body 'help' to
>   [EMAIL PROTECTED]
>
> You can reach the person managing the list at
>   [EMAIL PROTECTED]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Tutor digest..."
>
>
> Today's Topics:
>
>1. Re: creating a nested dictionary (Remco Gerlich)
>2. Re: Comparing more than 2 lists (Fiyawerx)
>3. lst file (SwartMumba snake)
>4. Re: lst file (Remco Gerlich)
>
>
> --
>
> Message: 1
> Date: Thu, 24 Jan 2008 10:51:39 +0100
> From: "Remco Gerlich" <[EMAIL PROTECTED]>
> Subject: Re: [Tutor] creating a nested dictionary
> To: "Garry Willgoose" <[EMAIL PROTECTED]>
> Cc: tutor@python.org
> Message-ID:
>   <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset="utf-8"
>
> Of course, I forgot to mention that you can use tuples as dictionary keys.
>
> A common idiom is:
>
> pdb[(dataset, modulename, parametername, 'value')] = value.
>
> And if that works for you, it's much simpler. But you lose the ability to
> use, say, pdb[dataset][modulename] as a dictionary on its own.
>
> Remco
>
>
> On Jan 24, 2008 8:20 AM, Garry Willgoose
> <[EMAIL PROTECTED]>
> wrote:
>
>> Is there any easy way to create a nested dictionary. I want to be
>> able to allocate like
>>
>> pdb[dataset][modulename][parametername]['value']=value
>>
>> where dataset, modulename, parametername are variables that are
>> determined within loops nested 3 deep, and value comes from a
>> database call. Prior to the nested loops I do not know what the
>> values of dataset, modulename, parametername will range over, but I
>> do know pdb needs to be nested 3 deep. What I'd like to do is
>> something like this
>>
>> pdb={}
>> for dataset in dataset_list:
>>modulename_list=getmodules(dataset)
>>for modulename in modulename_list:
>>parametername_list=getparameters(dataset,modulename)
>>for parametername in parametername_list:
>>value=getvalue(dataset, modulename,
>> parametername)
>>
>>  pdb[dataset][modulename][parametername]['value']=value
>>
>> What I'm currently doing is
>>
>> pdb={}
>> for dataset in dataset_list:
>>modulename_list=getmodules(dataset)
>>moduledict={}
>>for modulename in modulename_list:
>>parametername_list=getparameters(dataset,modulename)
>>valuedict={}
>>for parametername in parametername_list:
>>value=getvalue(dataset, modulename,
>> parametername)
>>valuedict['value']=value
>> #  valuedict needs to be a dictionary because there is other stuff
>>valuedict['otherstuff]=otherstuff
>> ...
>>parameterdict[parametername]=valuedict.copy()
>>moduledict[modeulename]=copy.deepcopy(parameterdict)
>>pdb[dataset]=copy.deepcopy(moduledict)
>>
>>
>> Now I know the 2nd is not that much more complex but this is a pretty
>> common construct in what I'm doing so I'm just wondering if there is
>> a clear and simple shortcut ;-)
>>
>>
>> 
>> Prof Garry Willgoose,
>> Australian Professorial Fellow in Environmental Engineering,
>> Director, Centre for Climate Impact Management (C2IM),
>> School of Engineering, The University of Newcastle,
>> Callaghan, 2308
>> Australia.
>>
>> Centre webpage: www.c2im.org.au
>>
>> Phone: (International) +61 2 4921 6050 (Tues-Fri AM); +61 2 6545 9574
>> (Fri PM-Mon)
>> FAX: (International) +61 2 4921 6991 (Uni); +61 2 6545 9574 (personal
>> and Telluric)
>> Env. Engg. Secretary: (International) +61 2 4921 6042
>>
>> email:  [EMAIL PROTECTED];
>> [EMAIL PROTECTED]
>> email-for-life: [EMAIL PROTECTED]
>> personal webpage: www.telluricresearch.com/garry
>> 
>> "Do not go where the path may lead, go instead where ther

Re: [Tutor] Tutor Digest, Vol 47, Issue 64

2008-01-24 Thread bob gailer
[EMAIL PROTECTED] wrote:
> Stop sending your mails
>
>  Send Tutor mailing list submissions to
>   
>>  tutor@python.org
>> 
Did you notice the instructions that appeared at the top of what you 
just sent?

Only you can manage your subscription.
>> To subscribe or unsubscribe via the World Wide Web, visit
>>  http://mail.python.org/mailman/listinfo/tutor
>> or, via email, send a message with subject or body 'help' to
>>  [EMAIL PROTECTED]
>> 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] (no subject)

2008-01-24 Thread sigurt dinesen
Hi
i have been fooling around in python a bit and looked at a couple of tutorials, 
but something i wonder about: is it posible to make python make an output in a 
windows "tekstbox" for instance to make several adjustments to my network 
settings at once, by running a python program
and if it is, how?
_
Få styr på dine billeder gratis med Windows Live Billedgalleri
www.windowslive.dk/billedgalleri___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Projects (fwd)

2008-01-24 Thread Ricardo Aráoz
Tiger12506 wrote:
>> Isn't dictionary access faster than list access? Why are three lists
>> 'much more efficient'?
> 
> Oh no, no, no.  Dictionaries are faster when you are *searching through* for 
> a particular value. If you already know the index of the item in the list, 
> lists are much faster.
> 
> Dictionaries are hash based. Somewhere it has to calculate the hash of the 
> key you give it...
> These three lists are more efficient in terms of size/output ratio. It 
> appeared as if the dictionary that was presented as an example was just 
> going to map one to one all of the values from zero to 999,999 (to match my 
> list version capabilities). Not only is that bad programming style, it's 
> just plain unecessary. 

Nope, if you read the code you'll see the only mapping done is up to 20
and then by tens up to 100, that's all.
The same code could be used with a list, you'd only have to change the
exception name.

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] lst file

2008-01-24 Thread Alan Gauld

"SwartMumba snake" <[EMAIL PROTECTED]> wrote

> I am trying to read from  a specific .lst file. When I read from it,
> it just prints out blank lines and I am sure that this file contains
> content.

Wjat kind of content? Have you opened it in a text editor and
looked at it? You are reading the file as text but if its binary
data it may not be printable. Or the file may reach an EOF
character before encountering any printavble characters.

> This is what I am using to read from the file:
>
> f = open("C:\\Users\\UserName\\Directory\\words.lst")
>
> for line in f:
>print line
>
> f.close()

It should work if its a text file with printable content.

Alan G 


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] ssh script

2008-01-24 Thread Eric Walstad
Hi Washake,

Here's a sample I just whipped up from the example I found here:

Note that I had to tweak the 'tunnel_command' line a bit as it was 
missing the conversion type.  This sets up a tunnel from a PostgreSQL 
server I have to my workstation.  I then use the tunnel on my 
workstation to connect to the database.

# On the PostgreSQL server machine ('a_server') #
# Setup a reverse forward
[EMAIL PROTECTED]:~$ python
Python 2.5.1 (r251:54863, Oct  5 2007, 13:36:32)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import pexpect
 >>> import getpass
 >>> import time
 >>> tunnel_command = """ssh -R5432:localhost:5432 %(user)[EMAIL 
 >>> PROTECTED](host)s"""
 >>> host = raw_input('Hostname: ')
Hostname: 192.168.1.1
 >>> user = raw_input('Username: ')
Username: username
 >>> X = getpass.getpass('Password: ')
Password:
 >>> ssh_tunnel = pexpect.spawn(tunnel_command % globals())
 >>> ssh_tunnel.expect('password:')
 >>> time.sleep(0.1)
 >>> ssh_tunnel.sendline(X)
 >>> ssh_tunnel.expect (pexpect.EOF)
 >>>

# Now the reverse forward is set up and I can connect to the PostgreSQL
# instance running on 'a_server'
# On the client machine: 192.168.1.1 #
[EMAIL PROTECTED]:~$ python
Python 2.5.1 (r251:54863, Oct  5 2007, 13:36:32)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import psycopg2 as Database
 >>> conn_parts = {
... 'user':'dbuser',
... 'dbname': 'mydatabase',
... 'password':'',
... 'host':'127.0.0.1',
... 'port':'5432',
... }
 >>> cs = ' '.join(["%s=%s" % (k, v) for k, v in conn_parts.items() if v])
 >>> print cs
port=5432 host=127.0.0.1 user=dbuser dbname=mydatabase
 >>> conn = Database.connect(cs)
 >>> cur = conn.cursor()
 >>> sql = 'select count(*) from mytable'
 >>> cur.execute(sql)
 >>> records = cur.fetchall()
 >>> conn.close()
 >>>
 >>> print records
[(557L,)]
 >>>


washakie wrote:
> Thanks everyone these seem like promising directions to go... Eric, any
> chance you could share your 'similar' code? The problem it seems with
> paramiko is that it has little 'newbie' documentation, and I'm not clear how
> to set up the reverse port forwarding on it. Thus I may need to use the
> pexpect solution. 
> 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Comparing more than 2 lists

2008-01-24 Thread Alan Gauld

"Fiyawerx" <[EMAIL PROTECTED]> wrote 

> list1 = ['one', 'two', 'three']
> list2 = ['one', 'two', 'four', 'five']
> list3 = ['two', 'three', 'six', 'seven']
> list4 = ['three', 'five', 'six']
> 
> I need to be able to get along the lines of output:
> Element 'one' contained in list1 and list2
> Element 'two' contained in list1 and list2 and list3
> ...
> Element 'five' contained in list2 and list4
> 
> etc.. and I can't quite figure out how to go about it

There are lots of approaches, one of the easest is to 
use a dictionary keyed by the elements of the lists 
and the values the identity of the list in which it 
appears:

d = {}
for n, lst in enumerate([list1,list2,list3,list4[):
   for item in lst:
   d.setdefault(item,[]).append(n)

Gets close

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 




___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Dos and os.walk with Python

2008-01-24 Thread Timothy Sikes
Hi.I wrote a python script that goes through a specified directory and 
returns a list of all the files that haven't been modified since a certain 
date.  I was hoping to be able to then continue with the program to bring up 
dos, and zip, then move the files (to my external hard drive). I have Windows 
XP. I don't know if it's okay to ask about Dos in python mailing list, so I 
hope it's alright.  Here is my program, I don't know if there are any 
formatting rules for posting programs, so I hope this will sufice.import os, 
sys, timedef earlierThan (path, year, exclude=[]):all = []walk = 
os.walk(path)for root, dirs, files in walk:for i in files:  
  try:if (time.localtime(os.path.getmtime(root + "\\" + i))[0] 
< yearand doesNotHave(exclude, root)) :
all.append(root + "\\" + i)except OSError:  #I think that I might 
need a more specific error message, as this one would handle something
   #That's not necessarily a broken file name. 
(I got one of them when I ran it).print root + "\\" + i + " was 
not included in the list"return all
def doesNotHave(exclude, root):for x in exclude:if 
root.startswith(x) > -1:return Falsereturn TrueI've had little 
experience with dos.  I believe I should use the COMPACT, and then the MOVE dos 
command... Would it go something like this?g = earlierThan("G:\My Documents", 
2007, ["Music"])for x in g:
 os.system("COMPACT /F " + x)
 os.sytem("MOVE " + x + " " + "H:\Backup")Thanks
_
Need to know the score, the latest news, or you need your Hotmail®-get your 
"fix".
http://www.msnmobilefix.com/Default.aspx___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Forgot something...

2008-01-24 Thread Timothy Sikes
Sorry, but in my previous message, I realized that I hadn't changed the code 
from doesNotHave...  It's supposed to be x.find(), not x.startswith..Oh, 
and I also am not worried about messing up any files too much, because I have 
them all backed up on another computer already
_
Helping your favorite cause is as easy as instant messaging. You IM, we give.
http://im.live.com/Messenger/IM/Home/?source=text_hotmail_join___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Dos and os.walk with Python

2008-01-24 Thread Alan Gauld

"Timothy Sikes" <[EMAIL PROTECTED]> wrote

>  I don't know if it's okay to ask about Dos in python mailing list,

If its related to programming in python as well its fine :-)

> I don't know if there are any formatting rules for posting programs

It helps if we can see the formatting, especially since Python
relies on  layout. This was just a mess on my screen!

I've tried to sort it out...

---
import os, sys, time

def earlierThan (path, year, exclude=[]):
all = []
walk = os.walk(path)
for root, dirs, files in walk:
for i in files:
try:
if (time.localtime(os.path.getmtime(root + "\\" + 
i))[0] < year
and doesNotHave(exclude, root)) :
all.append(root + "\\" + i)
except OSError:
 #I think that I might need a more specific error 
message,
 #as this one would handle something
 #That's not necessarily a broken file name. (I got 
one of them when I ran it).
 print root + "\\" + i + " was not included in the 
list"
return all

def doesNotHave(exclude, root):
for x in exclude:
if root.startswith(x) > -1:
return False
return True
--

That last function is a little odd. startswith already returns
a boolean so comparing to -1 is weird. I'm not sure what
you think it will do.

Consider:

>>> 'fred'.startswith('x')
False
>>> 'fred'.startswith('x') > -1
True
>>> 'fred'.startswith('f') > -1
True
>>>

I'm not sure when it would ever fail the test so I think your
function will nearly always return False.

> I've had little experience with dos.  I believe I should use the
> COMPACT, and then the MOVE dos command... Would
> it go something like this?

You could use these but you'd be better just using Python
to do it via the shutil and os modules and avoid the DOS
commands completely IMHO.

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Dos and os.walk with Python

2008-01-24 Thread Timothy Sikes
I'm getting the "Digest" version of the mailing list, if there's any better way 
to respond to a specific message, I would like to know. thanks :>



> From: [EMAIL PROTECTED]> Subject: Tutor Digest, Vol 47, Issue 66> To: 
> tutor@python.org> Date: Fri, 25 Jan 2008 02:09:13 +0100> > 
> --> > Message: 9> Date: Fri, 25 Jan 2008 01:11:00 
> -> From: "Alan Gauld" <[EMAIL PROTECTED]>> Subject: Re: [Tutor] Dos and 
> os.walk with Python> To: tutor@python.org> Message-ID: <[EMAIL PROTECTED]>> 
> Content-Type: text/plain; format=flowed; charset="iso-8859-1";> 
> reply-type=original> > > "Timothy Sikes" <[EMAIL PROTECTED]> wrote> > > I 
> don't know if it's okay to ask about Dos in python mailing list,> > If its 
> related to programming in python as well its fine :-)> > > I don't know if 
> there are any formatting rules for posting programs> > It helps if we can see 
> the formatting, especially since Python> relies on layout. This was just a 
> mess on my screen!> > I've tried to sort it out...
 
I can't seem to figure out how to make hotmail keep those spaces and new 
lines.   ah oh well
> > ---> import os, sys, time> > def 
> > earlierThan (path, year, exclude=[]):> all = []> walk = os.walk(path)> for 
> > root, dirs, files in walk:> for i in files:> try:> if 
> > (time.localtime(os.path.getmtime(root + "\\" + > i))[0] < year> and 
> > doesNotHave(exclude, root)) :> all.append(root + "\\" + i)> except 
> > OSError:> #I think that I might need a more specific error > message,> #as 
> > this one would handle something> #That's not necessarily a broken file 
> > name. (I got > one of them when I ran it).> print root + "\\" + i + " was 
> > not included in the > list"> return all> > def doesNotHave(exclude, root):> 
> > for x in exclude:> if root.startswith(x) > -1:> return False> return True> 
> > --> > That last function is a 
> > little odd. startswith already returns> a boolean so comparing to -1 is 
> > weird. I'm not sure what> you think it will do.
 
yeah, I meant to have it as .find()
> > Consider:> > >>> 'fred'.startswith('x')> False> >>> 'fred'.startswith('x') 
> > > -1> True> >>> 'fred'.startswith('f') > -1> True>  > I'm not sure when 
> > it would ever fail the test so I think your> function will nearly always 
> > return False.> > > I've had little experience with dos. I believe I should 
> > use the> > COMPACT, and then the MOVE dos command... Would> > it go 
> > something like this?> > You could use these but you'd be better just using 
> > Python> to do it via the shutil and os modules and avoid the DOS> commands 
> > completely IMHO.> 
 
Okay, I've found the move command from the shutil module,  but I don't see one 
that compressess files...  Are there some? or am I just not seeing 
them...thanks.> HTH,> > > -- > Alan Gauld> Author of the Learn to Program web 
site> http://www.freenetpages.co.uk/hp/alan.gauld > > > > > 
--> > 
___> Tutor maillist - 
Tutor@python.org> http://mail.python.org/mailman/listinfo/tutor> > > End of 
Tutor Digest, Vol 47, Issue 66> *
_
Helping your favorite cause is as easy as instant messaging. You IM, we give.
http://im.live.com/Messenger/IM/Home/?source=text_hotmail_join___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Error connecting to MySQL from Python script

2008-01-24 Thread Kamal
I have the MySQL Server (5.0.51) running on Windows XP machine, when I try
to connect to this server with a Python script, it gives the below error.
Wondering why is it happening?

_mysql_exceptions.Operational
Error: (1251, 'Client does not support authentication protocol requested by
server; consider upgrading MySQL client')

-- 
Thanks,
Kamal
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Dos and os.walk with Python

2008-01-24 Thread Marc Tompkins
On Jan 24, 2008 5:28 PM, Timothy Sikes <[EMAIL PROTECTED]> wrote:

> I'm getting the "Digest" version of the mailing list, if there's any
> better way to respond to a specific message, I would like to know. thanks :>
>

I also originally signed up for the digest - it drove me up the wall, so I
subscribed to the regular feed instead.  Lots more individual messages, but
I have them filtered into a separate folder.  Much, much easier to write
replies this way.

-- 
www.fsrtechnologies.com
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Projects (fwd)

2008-01-24 Thread Tiger12506
> Nope, if you read the code you'll see the only mapping done is up to 20
> and then by tens up to 100, that's all.
> The same code could be used with a list, you'd only have to change the
> exception name.

I see. There were "..." in between each of the tens entries which I took to 
mean that "big huge dictionary but left out some values in email for 
simplicity". I feel ashamed for not recognizing that the ellipses where 
there for some other purpose. ;-)

Anyway, beyond speed-up you might be able to get some better memory usage 
stats by switching my lists to tuples, since the contents never change. 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] (no subject)

2008-01-24 Thread Tiger12506
>Hi
>i have been fooling around in python a bit and looked at a couple of 
>tutorials, but something i >wonder about: is it posible to make python make 
>an output in a windows "tekstbox" for >instance to make several adjustments 
>to my network settings at once, by running a python >program
>and if it is, how?

Python is powerful. Mostly likely python can do anything you dream up.

"tekstbox" must mean "textbox" which in Windows is called an Edit control.
Since I assume you mean to put text in a control that is already open before 
you run your program, the answer is yes it is possible. Easier is the next 
option.

Several adjustments to your network settings... The best way to do this to 
find the registry entries that those network settings actually change and 
change them directly in python. How do you find those registry settings? 
Google. How do you change them? Look at _winreg module. 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Dos and os.walk with Python

2008-01-24 Thread Tiger12506
>> I've had little experience with dos.  I believe I should use the
>> COMPACT, and then the MOVE dos command... Would
>> it go something like this?
>
> You could use these but you'd be better just using Python
> to do it via the shutil and os modules and avoid the DOS
> commands completely IMHO.

Python has the zipfile module which is very handy to use, which wasn't 
mentioned but provides the zip functionality that the OP was looking for. 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] setstate trouble when unpickling

2008-01-24 Thread Jeff Peery
Hello,
   
  I've got a fairly simple class instance that I'm pickling. I'm using setstate 
to update the instance when I unpickle. Although the setstate doesn't seem to 
be called upon unpickling... here's an example, if anyone see's what I'm doing 
wrong, please let me know. Thanks!
   
  so I say start out with this class:
   
  class dog:
  def __init__(self):
  self.num_legs = 4
   
  then I pickle the instance of:
  sparky = dog()
   
  then I update my dog class to:
  class dog:
  def __init__(self):
  self.hair_color = 'brown'
  self.num_legs = 4
   
  def __setstate__(self, d):
  if 'hair_color' not in d:
  d['hair_color'] = 'brown'
  self.__dict__.update(d)
  print 'did this work?'
   
  Now when I unpickle the original pickled object sparky I would hope to see 
'did this work' and I would also hope that sparky would have updated to have 
the attribute 'hair_color' but nothing of the sort happens. if just unpickles 
sparky without updating the attributes as I was hoping.
   
  Thanks!
   
  Jeff



   
-
Never miss a thing.   Make Yahoo your homepage.___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Dos and os.walk with Python

2008-01-24 Thread Alan Gauld

"Timothy Sikes" <[EMAIL PROTECTED]> wrote 

> I'm getting the "Digest" version of the mailing list, 
> if there's any better way to respond to a specific message, 
> I would like to know. thanks :>

I used to use the digest before switching to the gmane news feed.

I seem to recall there are two digest settings.
One sends all the messages in one long message 
the other sends all the messages as attachments.
The second method makes replying easier. 
I think its called Mime style?

But its been a while...

Alan G.

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor