Re: Python and UML

2007-10-09 Thread aine_canby
On 9 Okt, 12:15, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > > I'm working with Python2.5 and pythonWin. > > > I'd like to start working with and learning more with UML. Can anyone > > suggest any freeware design software that I might use to do this? I > >

Python and UML

2007-10-09 Thread aine_canby
Hi, I'm working with Python2.5 and pythonWin. I'd like to start working with and learning more with UML. Can anyone suggest any freeware design software that I might use to do this? I also have Visio installed on my computer if thats of any use... Thanks, Aine -- http://mail.python.org/mailma

file open dialog from within PythonWin

2007-10-02 Thread aine_canby
Hi, I want to open a file seach dialog from within my python script which I run from within PythonWin. I also have the wxPython package installed. How might I do this? Thanks, Aine -- http://mail.python.org/mailman/listinfo/python-list

Re: Confusion regarding constructor as default value

2007-09-27 Thread aine_canby
On 27 Sep, 15:34, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Why are the following different? > > > def AddRow(self, rowName, tableRow=TableRow(ReleaseDate(""), > > ExpiryDate(""))): > > # check to see if the row already exists, if not add it to the > > container

Re: Confusion regarding constructor as default value

2007-09-27 Thread aine_canby
On 27 Sep, 15:03, [EMAIL PROTECTED] wrote: > Why are the following different? > > def AddRow(self, rowName, tableRow=TableRow(ReleaseDate(""), > ExpiryDate(""))): > # check to see if the row already exists, if not add it to the > container > > if not self.dict.has_ke

Confusion regarding constructor as default value

2007-09-27 Thread aine_canby
Why are the following different? def AddRow(self, rowName, tableRow=TableRow(ReleaseDate(""), ExpiryDate(""))): # check to see if the row already exists, if not add it to the container if not self.dict.has_key(rowName): self.dict[rowName] =

sorting a list numbers stored as strings

2007-09-24 Thread aine_canby
hi, I have the following list - ["1", "11", "2", "22"] how do I sort it like this - ["1", "2", "11", "22"] thanks, aine -- http://mail.python.org/mailman/listinfo/python-list

Re: Enum class with ToString functionality

2007-09-10 Thread aine_canby
On 10 Sep, 13:35, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > On Sep 10, 2:28 am, [EMAIL PROTECTED] wrote: > > > > > > > Hi, > > > I have the following class - > > > class TestOutcomes: > > PASSED = 0 > > FAILED = 1 > > ABORTED = 2 > > > plus the following code - > > > testResult = T

Re: Python Path Dictionary

2007-08-21 Thread aine_canby
On 21 Aug, 17:42, Gary Herron <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > > Do the Python Paths come in the form of a dictionary where I can > > access a particular path my its key in the registry? > > > For example, in PythonWin Tools>>Edit Python Paths shows the name as > >

Python Path Dictionary

2007-08-21 Thread aine_canby
Hi, Do the Python Paths come in the form of a dictionary where I can access a particular path my its key in the registry? For example, in PythonWin Tools>>Edit Python Paths shows the name as well of the address of each path Thanks, Aine -- http://mail.python.org/mailman/listinfo/python-list

Re: The folder a script is executed in

2007-08-21 Thread aine_canby
On 21 Aug, 11:27, Ant <[EMAIL PROTECTED]> wrote: > On Aug 21, 10:10 am, [EMAIL PROTECTED] wrote: > ... > > > myLocation = GetMyLocation() > > print myLocation > > > >> C:/folder > > Do you mean the folder containing the script? Or the current working > directory? > > If the former, then look at os.

The folder a script is executed in

2007-08-21 Thread aine_canby
Hi, How do I find out what folder a script is in while it is executing? For example, for the file "C:/folder/script.py" contain the following two lines of code - myLocation = GetMyLocation() print myLocation >> C:/folder Thanks, Aine. -- http://mail.python.org/mailman/listinfo/python-list

Replacing _xmlplus.dom.minidom with xml.dom.minidom

2007-08-03 Thread aine_canby
Hi, I'm working with a number of scripts which were written years ago for my company for Python 2.2, and I'd like to update for Python 2.5. I have written a script to add # -*- coding: cp1252 -*- to the beginning of all my scripts, and that has fixed the encoding issues. Another issue was the use

Re: Avoiding "invalid literal for int()" exception

2006-12-11 Thread aine_canby
John Machin skrev: > [EMAIL PROTECTED] wrote: > > >>> v = raw_input("Enter: ") > > Enter: kjjkj > > >>> int(v) > > Traceback (most recent call last): > > File "", line 1, in > > ValueError: invalid literal for int() with base 10: 'kjjkj' > > > > In my program I need to be able to enter char st

Avoiding "invalid literal for int()" exception

2006-12-11 Thread aine_canby
>>> v = raw_input("Enter: ") Enter: kjjkj >>> int(v) Traceback (most recent call last): File "", line 1, in ValueError: invalid literal for int() with base 10: 'kjjkj' In my program I need to be able to enter char strings or int strings on the command line. Then I use an if-elif structure to es

Re: sys.stdin.encoding

2006-12-11 Thread aine_canby
Duncan Booth skrev: > [EMAIL PROTECTED] wrote: > > > The call to sys.getdefaultencoding() returns ascii. Since I can enter > > the characters åöä on the command line in Pydef/Eclipse doesn't that > > mean that the stdin is not ascii? What should I do? > > > I think that depends on what sort of sc

Re: sys.stdin.encoding

2006-12-11 Thread aine_canby
Duncan Booth skrev: > [EMAIL PROTECTED] wrote: > > > The following line in my code is failing because sys.stdin.encoding is > > Null. > > I'll guess you mean None rather than Null. > > > This has only started happening since I started working with > > Pydef in Eclipse SDK. Any ideas? > > > > uni=u

sys.stdin.encoding

2006-12-11 Thread aine_canby
The following line in my code is failing because sys.stdin.encoding is Null. This has only started happening since I started working with Pydef in Eclipse SDK. Any ideas? uni=unicode(word,sys.stdin.encoding) Thanks, Aine. -- http://mail.python.org/mailman/listinfo/python-list

Initializing with the correct type

2006-12-07 Thread aine_canby
Hi all, I'm new to Python and I'm just wordering if my approch is correct. Here's an example. I'm making sure that the length and types are correct. This is in case I use such a class and accidently pass it the wrong object. class Funkt: 'Funkt Class' def __init__(self, L):

reloading modules

2006-12-06 Thread aine_canby
I'm using python.exe to execute my modules. I have a music.py module which contains my classes and a main.py module which uses these classes. In python.exe, I call "import main" to execute my program. The problem is that I have to close python and reopen it everytime i change music.py or main.py. W

Re: Novice: replacing strings with unicode variables in a list

2006-12-06 Thread aine_canby
[EMAIL PROTECTED] skrev: > Fredrik Lundh skrev: > > > Diez B. Roggisch wrote: > > > > > Please provide the full script, and the desired input - then we might be > > > able to help you. > > > > the full *traceback* would pretty useful, too: > > > > http://effbot.org/pyfaq/tutor-i-need-help-im-gett

Re: Novice: replacing strings with unicode variables in a list

2006-12-06 Thread aine_canby
Fredrik Lundh skrev: > Diez B. Roggisch wrote: > > > Please provide the full script, and the desired input - then we might be > > able to help you. > > the full *traceback* would pretty useful, too: > > http://effbot.org/pyfaq/tutor-i-need-help-im-getting-an-error-in-my-program-what-should-i-do.h

Novice: replacing strings with unicode variables in a list

2006-12-06 Thread aine_canby
Hi, Im totally new to Python so please bare with me. Data is entered into my program using the folling code - str = raw_input(command) words = str.split() for word in words: word = unicode(word,'latin-1') word.encode('utf8') This gives an error: File "C:\Python25\lib\encodings\cp850.py"