Re: [Tutor] Puzzled again

2011-08-02 Thread Andre Engels
On Wed, Aug 3, 2011 at 8:07 AM, Richard D. Moores wrote: > On Tue, Aug 2, 2011 at 21:59, Dave Angel wrote: > > > When I paste that from your email into a file and run Python 2.7 on it, > it > > behaves fine with no errors. That's in Linux. > > I should have said that I'm using Wing IDE Professio

Re: [Tutor] Puzzled again

2011-08-02 Thread Richard D. Moores
On Tue, Aug 2, 2011 at 21:59, Dave Angel wrote: > When I paste that from your email into a file and run Python 2.7 on it, it > behaves fine with no errors.  That's in Linux. I should have said that I'm using Wing IDE Professional 4.0.3-1 (rev 24721), Windows Vista, and Python 3.2.1. > But the e

Re: [Tutor] Python scripts into executable Windows programss

2011-08-02 Thread Christian Witts
On 2011/08/03 06:25 AM, Emeka wrote: Hello All, I would want to convert Python scripts into executable Windows programs. I have already checked out py2exe, it seems like they support only Python 2.5. Mine is Python 2.7.7. Could anyone here help me out on this issue? ? Regards, Emeka -- /Sat

Re: [Tutor] python Module for Windows Active Directory

2011-08-02 Thread Ajith Gopinath
Sure Tim. Thanks for your help. Thanks and Regards Ajith Gopinath On Thu, Jul 28, 2011 at 8:32 PM, Tim Golden wrote: > On 28/07/2011 07:28, qbits...@gmail.com wrote: > >> Hi, >> >> Which is the best package/module in Python to work with Windows Active >> Directory? >> >> I may need to create

Re: [Tutor] Puzzled again

2011-08-02 Thread Dave Angel
On 08/02/2011 10:36 PM, Richard D. Moores wrote: Puzzled again. Why the error. Line 36 is the line just above "import os.path". I have many other functions in mycalc.py with examples formatted exactly the same way. def convertPath(path): """ Given a path with backslashes, return that p

[Tutor] Python scripts into executable Windows programss

2011-08-02 Thread Emeka
Hello All, I would want to convert Python scripts into executable Windows programs. I have already checked out py2exe, it seems like they support only Python 2.5. Mine is Python 2.7.7. Could anyone here help me out on this issue? ? Regards, Emeka -- *Satajanus Nig. Ltd * _

Re: [Tutor] Indexing a list with nested tuples

2011-08-02 Thread bob gailer
On 8/2/2011 10:44 PM, Alexander Quest wrote: Hi guys- I'm having a problem with a list that has nested tuples: attributes = [("strength", 0), ("health ", 0), ("wisdom ", 0), ("dexterity", 0)] I've defined the list above with 4 items, each starting with a value of 0. The player enters how m

[Tutor] Indexing a list with nested tuples

2011-08-02 Thread Alexander Quest
Hi guys- I'm having a problem with a list that has nested tuples: attributes = [("strength", 0), ("health ", 0), ("wisdom ", 0), ("dexterity", 0)] I've defined the list above with 4 items, each starting with a value of 0. The player enters how many points he or she wants to add to a given item.

[Tutor] Puzzled again

2011-08-02 Thread Richard D. Moores
Puzzled again. Why the error. Line 36 is the line just above "import os.path". I have many other functions in mycalc.py with examples formatted exactly the same way. def convertPath(path):     """     Given a path with backslashes, return that path with forward slashes.     By Steven D'Aprano  07

Re: [Tutor] When to use def __init__ when making a class?

2011-08-02 Thread Steven D'Aprano
brandon w wrote: I have two questions: 1) When should I use "def __init__(self):" when I create a class? Whenever you need something to happen when you create an instance. 2) Would these two classes have the same effect? Technically, no, but in practice, you would find it hard to see th

Re: [Tutor] When to use def __init__ when making a class?

2011-08-02 Thread Brett Ritter
On Tue, Aug 2, 2011 at 8:47 PM, brandon w wrote: > 1)  When should I use "def __init__(self):" when I create a class? When you have any initialization to do. (in other words, when you want class instantiation to do more than simply give you an instance of the class. > 2)  Would these two classe

[Tutor] When to use def __init__ when making a class?

2011-08-02 Thread brandon w
I have two questions: 1) When should I use "def __init__(self):" when I create a class? 2) Would these two classes have the same effect? class Name: def __init__(self): man = Marcus woman = Jasmine return self.man, self.woman class Na

Re: [Tutor] python 2.3.4, how to use os.system and collect it's output to a file.

2011-08-02 Thread xDog Walker
On Tuesday 2011 August 02 08:40, Thirupathaiah Gande (tgande) wrote: > Hi, > > > > I have Python 2.3.4. > > I want to use os.system command and collect a command's output to a > file. But it is not collecting all the output. It is truncating.. > > > > Code is as below. > > > > cmd = "%s rl -comp %

Re: [Tutor] python 2.3.4, how to use os.system and collect it's output to a file.

2011-08-02 Thread Alan Gauld
On 02/08/11 16:40, Thirupathaiah Gande (tgande) wrote: I want to use os.system command and collect a command’s output to a file. But it is not collecting all the output. It is truncating.. no its not truncating anything, it is returning the exit code of the command, because thats what os.syst

Re: [Tutor] python 2.3.4, how to use os.system and collect it's output to a file.

2011-08-02 Thread Timo
On 02-08-11 17:40, Thirupathaiah Gande (tgande) wrote: Hi, I have Python 2.3.4. Is there some reason for this? You probably should update to 2.7 if possible. Then have a look at the Subprocess module documentation. There are some examples which should get you on the way. Cheers, Timo I

[Tutor] python 2.3.4, how to use os.system and collect it's output to a file.

2011-08-02 Thread Thirupathaiah Gande (tgande)
Hi, I have Python 2.3.4. I want to use os.system command and collect a command's output to a file. But it is not collecting all the output. It is truncating.. Code is as below. cmd = "%s rl -comp %s@%s/%d >> %s" % (C_CMD, i, branch, x, temp_acme_rl_log) cmd_res = os.system( cmd )

Re: [Tutor] Please code review.

2011-08-02 Thread Karim
On 08/02/2011 03:59 PM, Peter Otten wrote: Karim wrote: values = ( (22.5,21.5,121.5), (5615.3,615.3,-615.3), (-2315.7,315.7,415.7) ) it = _xrange_cellnames(rows=len(value), cols=len(values[0])) table.getCellByName(it.next()).setValue(22.5) table.getCellByName(it.next()).setValue(5615.3) table

Re: [Tutor] Please code review.

2011-08-02 Thread Paul Kölle
Am 02.08.2011 13:45, schrieb Karim: Hello, I need a generator to create the cellname in a excell (using pyuno) document to assign value to the correct cell. The following code does this but do you have some optimizations on it, for instance to get the alphabetic chars instead of hard-coding it.

Re: [Tutor] Please code review.

2011-08-02 Thread Karim
Thanks Martin, This is the generator expression version. I can use both function generator or generator expression version correction. Cheers Karim On 08/02/2011 02:47 PM, Martin Gracik wrote: def get_cellnames2(rows, cols): rows = range(1, rows + 1) cols = string.ascii_uppercase[:c

[Tutor] Please code review.

2011-08-02 Thread Karim
Hello, I need a generator to create the cellname in a excell (using pyuno) document to assign value to the correct cell. The following code does this but do you have some optimizations on it, for instance to get the alphabetic chars instead of hard-coding it. Cheers karim Python 2.7.1+ (r27