Re: [Tutor] Amazing power of Regular Expressions...

2006-11-05 Thread Alan Gauld
"Michael Sparks" <[EMAIL PROTECTED]> wrote > The most pathological example of regex avoidance I've seen in a > while > is this: > > def isPlain(text): >plaindict = {'-': True, '.': True, '1': True, '0': True, '3': > True, > '2': True, '5': True, '4': True, '7': True, '6': True, '9': >

Re: [Tutor] shebang problem

2006-11-05 Thread Brian van den Broek
Alan Gauld said unto the world upon 11/04/2006 06:47 PM: > [EMAIL PROTECTED]:~/test$ ls -la shebangtest.py > -rwxr-xr-- 1 brian brian 68 2006-11-04 02:29 shebangtest.py > > so the file is called shebangtest.py... > >> [EMAIL PROTECTED]:~/test$ shebangtest >> bash: shebangtest: command not found >

[Tutor] GUI with Designer

2006-11-05 Thread Jonathon Sisson
Wow... SPE is in the Gentoo repository as well. I've been looking for something to replace Eric, so thanks for the tip, Chris! I'll check it out. Jonathon Chris Hengge wrote: > Well, I use SPE which comes with wxGlade and XRC. For the small amount > of gui I've done with python I think SPE

Re: [Tutor] Amazing power of Regular Expressions...

2006-11-05 Thread Kent Johnson
Michael Sparks wrote: > On Sunday 05 November 2006 15:02, Kent Johnson wrote: > ... >> Regular expressions are an extremely powerful and useful tool that every >> programmer should master and then put away and not use when there is an >> alternative :-) > > > > There's always an alternative to a

Re: [Tutor] Amazing power of Regular Expressions...

2006-11-05 Thread Michael Sparks
On Sunday 05 November 2006 15:02, Kent Johnson wrote: ... > Regular expressions are an extremely powerful and useful tool that every > programmer should master and then put away and not use when there is an > alternative :-) There's always an alternative to a regular expression, so are you reall

Re: [Tutor] Help me to debug this script .. I tried but ....

2006-11-05 Thread Danny Yoo
On Sun, 5 Nov 2006, Asrarahmed Kadri wrote: > When I am running the script from the command line, its working fine but > when I am trying to run from Pythonwin, its giving me error. > > Can anyone explain the reason? Hi Asrarahmed, Did you see Kent's reply? He mentioned: >> Something strange

Re: [Tutor] Help me to debug this script .. I tried but ....

2006-11-05 Thread Asrarahmed Kadri
When I am running the script from the command line, its working fine but when I am trying to run from Pythonwin, its giving me error.   Can anyone explain the reason?   Regards, Asrarahmed  On 11/5/06, Kent Johnson <[EMAIL PROTECTED]> wrote: Dustin J. Mitchell wrote:> Asrarahmed Kadri wrote:>> "C:\

Re: [Tutor] Help me to debug this script .. I tried but ....

2006-11-05 Thread Dustin J. Mitchell
Kent Johnson wrote: > Dustin J. Mitchell wrote: >> Asrarahmed Kadri wrote: >>> "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", >>> line 310, in RunScript >>> exec codeObject in __main__.__dict__ >>> File "C:\project stuff-programs\Scriptdate.py", line 18, in ? >>>

Re: [Tutor] Encoding and XML troubles

2006-11-05 Thread Dustin J. Mitchell
For what it's worth, the vast majority of the XML out there (especially if you're parsing RSS feeds, etc.) is written by monkeys and is totally ill-formed. It seems the days of 'it looked OK in my browser' are still here. To find out if it's your app or the XML, you could try running the XML thro

Re: [Tutor] Help me to debug this script .. I tried but ....

2006-11-05 Thread Kent Johnson
Dustin J. Mitchell wrote: > Asrarahmed Kadri wrote: >> "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", >> line 310, in RunScript >> exec codeObject in __main__.__dict__ >> File "C:\project stuff-programs\Scriptdate.py", line 18, in ? >> t1 = my_version_datecheck.

[Tutor] Two Questions...(i) Checking for None (ii) Making

2006-11-05 Thread Greg Lindstrom
Date: Sat, 4 Nov 2006 10:36:58 +From: "Asrarahmed Kadri" < [EMAIL PROTECTED]>Hi Folks,I am trying to build a program which takes the following command-line arguments:   *-s -D -n -t   time>*the first argument which is -s (for source) can be replaced by -d (fordestination) or -o (for observer

Re: [Tutor] Help me to debug this script .. I tried but ....

2006-11-05 Thread Dustin J. Mitchell
Asrarahmed Kadri wrote: > "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", > line 310, in RunScript > exec codeObject in __main__.__dict__ > File "C:\project stuff-programs\Scriptdate.py", line 18, in ? > t1 = my_version_datecheck.dateCheck(dt1,0) > File "my_ver

Re: [Tutor] Encoding and XML troubles

2006-11-05 Thread Kent Johnson
William O'Higgins Witteman wrote: > I've been struggling with encodings in my XML input to Python programs. > > Here's the situation - my program has no declared encoding, so it > defaults to ASCII. It's written in Unicode, but apparently that isn't > confusing to the parser. Fine by me. I impo

[Tutor] Help me to debug this script .. I tried but ....

2006-11-05 Thread Asrarahmed Kadri
Hi Folks,   I have a function defined in a module. I am using this module in a script but its giving me error: the traceback is as follows:     29/2/2003['29', '2', '2003']Traceback (most recent call last):  File "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 310, i

Re: [Tutor] Amazing power of Regular Expressions...

2006-11-05 Thread Kent Johnson
Alan Gauld wrote: > But I sure agree with it. The problem with Regex is that they can > be just a bit too powerful. To cite another programming proverb, > this time by Bjarne Stroustrup I think: > > "C makes it easy to shoot yourself in the foot; > C++ makes it harder, but when you do, > it blows

[Tutor] python, python2 & python2.3 in /usr/bin

2006-11-05 Thread Michael Daly
Greetings everyone Could someone please explain these links...python2 seems to have resulted from an installation of python 2.5 (in a specified dir via the --prefix switch) and is a symbolic link to 'python' The others - python and python2.3 are just files and predate the python2 file. I am worri

[Tutor] Wrong module name and line number in logging package.

2006-11-05 Thread Noufal Ibrahim
Greetings everyone, I'm using the python standard logging package for a personal project of mine and have initialised it like so. logger = logging.getLogger("pydagogue") handler = logging.StreamHandler() handler.setFormatter(logging.Formatter("[%(levelname)s]%(pathname)s:%(lineno)d %(message)s