Re: optparse - required options

2007-08-23 Thread Omari Norman
On Mon, Aug 20, 2007 at 05:31:00PM -0400, Jay Loden wrote: > Robert Dailey wrote: > > Well, I don't know what is wrong with people then. I don't see how > > required arguments are of bad design. Some command-line applications are > > built around performing tasks based on information received. Comp

Re: All leading tabs or all leading spaces - why isn't that enforced?

2007-08-07 Thread Omari Norman
> I suppose we Pythonistas are just too permissive for our own good. > Consider the opportunity to use mixed tabs and spaces a piece of rope of > your preferred length ... I thought I remembered reading somewhere that Python 3000 will ban tabs as indentation characters, but now I can't turn up a

Re: encode() question

2007-08-06 Thread Omari Norman
On Tue, Jul 31, 2007 at 09:53:11AM -0700, 7stud wrote: > s1 = "hello" > s2 = s1.encode("utf-8") > > s1 = "an accented 'e': \xc3\xa9" > s2 = s1.encode("utf-8") > > The last line produces the error: > > --- > Traceback (most recent call last): > File "test1.py", line 6, in ? > s2 = s1.encode

Re: Where do they tech Python officialy ?

2007-07-28 Thread Omari Norman
On Mon, Jul 23, 2007 at 10:48:10PM -0700, Paul Rubin wrote: > If you're having trouble with Python because you're new at > programming, I can sympathize--I don't think it's the most > beginner-friendly of languages despite the efforts in that direction > by the designers. Just curious--what la

Re: Lookup encoding aliases in Python 2.4

2007-07-17 Thread Omari Norman
Forget about that--I then found /usr/lib/python2.5/encodings/aliases.py, which is also in Python 2.4. Sorry for the silly question! On Tue, Jul 17, 2007 at 07:04:59PM -0400, Omari Norman wrote: > My program creates new XML files (not through the DOM, but just by > simple file.write call

Lookup encoding aliases in Python 2.4

2007-07-17 Thread Omari Norman
My program creates new XML files (not through the DOM, but just by simple file.write calls.) It would be nice if said files would be in the default system encoding. So in Python 2.5 I use ENCODING = codecs.lookup(locale.getdefaultlocale()[1]).name locale.getdefaultlocale()[1] sometimes returns a

Re: Interpreting non-ascii characters.

2007-07-17 Thread Omari Norman
> I want to create a script which reads files in a > current directory and renames them according to some > scheme. The file names are in Russian - sometimes > the names encoded as win-1251, sometimes as koi8-r etc. > I want to read in file name and convert it to list for > further processing. T

Validating XML in Windows

2007-07-08 Thread Omari Norman
My app needs to validate XML. That's easy enough in Unix. What is the best way to do it in Windows? The most obvious choice would of course be PyXML. However, apparently it is no longer maintained: http://sourceforge.net/project/showfiles.php?group_id=6473 so there are no Windows binaries that w