Re: Get my airlines boarding pass

2006-06-09 Thread Alex Martelli
Ken <[EMAIL PROTECTED]> wrote: > rh0dium wrote: > > Hi all, > > > > Has any of you fine geniuses figured out a nice python script to go to > > the Southwest airlines website and check in, and retrieve your boarding > > pass - automatically 24 hours in advance > > I just wrote such a script in py

Re: __getattr__ question

2006-06-09 Thread Ben Cartwright
Laszlo Nagy wrote: > So how can I tell if 'root.item3' COULD BE FOUND IN THE USUAL PLACES, or > if it is something that was calculated by __getattr__ ? > Of course technically, this is possible and I could give a horrible > method that tells this... > But is there an easy, reliable and thread safe

Get my airlines boarding pass

2006-06-09 Thread Ken
rh0dium wrote: > Hi all, > > Has any of you fine geniuses figured out a nice python script to go to > the Southwest airlines website and check in, and retrieve your boarding > pass - automatically 24 hours in advance > I just wrote such a script in python and tested it successfully. Where should

Re: More pythonic shell sort?

2006-06-09 Thread John Machin
On 10/06/2006 7:00 AM, [EMAIL PROTECTED] wrote: > Disclaimer - I recognize this is not a practical exercise. There are > many implementations around that would do the job better, more > efficiently (Meaning in C) or whatever. > > I caught some thread about sorting and started thinking about shell

Adding extra frames to traceback in C module

2006-06-09 Thread Roger Binns
One thing I would like to do in my extension module is add extra frames to the traceback when an extension occurs. At the moment C code is invisible to tracebacks. This is relevant when the C code makes a Python callback. For example if the following code sequence happens (time going down) Python

Re: Error in Chain of Function calls (Code Attached)

2006-06-09 Thread Girish Sahani
Thanks for the help borisi'll try using sets instead of lists But i dont understand the point below...full traceback means what :-? > Girish Sahani wrote: > However i am getting an error at the line marked with ***. > >>> Which error ? How do you hope us to be of any help here if you don't

Re: Writing PNG with pure Python

2006-06-09 Thread Johann C. Rocholl
The MIT license is enticingly short and simple, thank you for the tip. I have now decided to license my project (including the pure python PNG library) under the Apache License 2.0 which is less restrictive than the GPL in terms of sublicensing. The Apache License looks modern and well-maintained

Re: Allowing zero-dimensional subscripts

2006-06-09 Thread George Sakkis
[EMAIL PROTECTED] wrote: > However, I'm designing another library for > managing multi-dimensional arrays of data. Its purpose is similiar to > that of a spreadsheet - analyze data and preserve the relations between > a source of a calculation and its destination. Sounds interesting. Will it be r

Re: __getattr__ question

2006-06-09 Thread Alex Martelli
Andrew Robert <[EMAIL PROTECTED]> wrote: > If I remember correctly, this behavior depends on how the class is > created (classic mode versus modern). > > Modern > > class foo(object): > pass > > Classic ( pre python 2.2 I believe ) > > class foo(): No parentheses all

Re: __getattr__ question

2006-06-09 Thread Andrew Robert
If I remember correctly, this behavior depends on how the class is created (classic mode versus modern). Modern class foo(object): pass Classic ( pre python 2.2 I believe ) class foo(): pass The modern method of specifying object in the class def

Re: Most elegant way to generate 3-char sequence

2006-06-09 Thread James Stroud
SuperHik wrote: > and the winner is... :D > David Isaac wrote: > >> alpha = string.lowercase >> x=(a+b+c for a in alpha for b in alpha for c in alpha) > > > Not necessarily vying for winner, but David's solution is highly specific as it doesn't do so well for something like a

Re: regexp questoin

2006-06-09 Thread micklee74
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > pat = re.compile(r"%s" %(userinput) ) #userinput is passed from > > command line argument > > that r"%s" % (userinput) thing is a pointless operation: the "r" prefix > controls how backslashes in a string literal is parsed; the result is an

Re: Most elegant way to generate 3-char sequence

2006-06-09 Thread SuperHik
and the winner is... :D David Isaac wrote: > alpha = string.lowercase > x=(a+b+c for a in alpha for b in alpha for c in alpha) -- http://mail.python.org/mailman/listinfo/python-list

Difference between copy and link (was: Re: os.link makes a copy, not a link)

2006-06-09 Thread Ben Finney
Dan M <[EMAIL PROTECTED]> writes: > I'm a little bit confused. According to the sources I've looked at on the > net, > os.link('file1', 'file2') > should make a hard link from file1 to file2. But what I'm finding is that > it's actually making a copy. Am I forgetting a step or something? Are

Re: __getattr__ question

2006-06-09 Thread Ben Finney
Laszlo Nagy <[EMAIL PROTECTED]> writes: > This is from the Python documentation (fragment): > > __getattr__( self, name) > Called when an attribute lookup has not found the attribute in the > usual places (i.e. it is not an instance attribute nor is it found in > the class tree for self

Re: os.link makes a copy, not a link

2006-06-09 Thread Carl Banks
Dan M wrote: > I'm a little bit confused. According to the sources I've looked at on the > net, > os.link('file1', 'file2') > should make a hard link from file1 to file2. But what I'm finding is that > it's actually making a copy. Am I forgetting a step or something? > > Python 2.3.4 running on

Re: Killing a thread

2006-06-09 Thread Carl J. Van Arsdall
Felipe Almeida Lessa wrote: > Em Sex, 2006-06-09 às 13:54 -0700, Manish Marathe escreveu: > >> On 6/9/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >> Manish Marathe wrote: >> >> > I am creating threads using my self defined class which >> inherits the >>

os.link makes a copy, not a link

2006-06-09 Thread Dan M
I'm a little bit confused. According to the sources I've looked at on the net, os.link('file1', 'file2') should make a hard link from file1 to file2. But what I'm finding is that it's actually making a copy. Am I forgetting a step or something? Python 2.3.4 running on CentOS 4.3 -- http://m

Re: Allowing zero-dimensional subscripts

2006-06-09 Thread Carl Banks
Fredrik Lundh wrote: > noam's proposal is to make this work: > > >>> x[] > () > > (but should it really result in an empty tuple? wouldn't None be a bit > more Pythonic?) How would you index a 2-D array? With a 2-tuple. How would you index a 1-D array? With a 1-tuple. How would you index a 0-D

Re: Allowing zero-dimensional subscripts

2006-06-09 Thread Carl Banks
Steve Holden wrote: > Carl Banks wrote: > > Steve Holden wrote: > > > >>Hey, I have an idea, why don't we look at the language reference manual > >>instead of imagining how we think it might work! > > > > > > I don't know. Sounds risky. > > > > > > > >>In section 3.2 we find: > >> > >> > >>""" >

Re: First question on extending Python...

2006-06-09 Thread Larry Bates
Redefined Horizons wrote: > I still new to Python, and I've only dabbled in C, but I've got my > first project I need to tackle that involves both languages. I was > hoping to get some advice on how to proceed. > > There is a third-party application that I need to work with. It is > closed-source,

Re: Most elegant way to generate 3-char sequence

2006-06-09 Thread James Stroud
Rob Cowie wrote: > Hi all, > > I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba', > 'abb', 'abc' etc. all the way to 'zzz'. > > How would you construct a generator to acheive this? > > A simple, working but somewhat inelegant solution is... > > alpha = ['a','b','c','d'] #sh

Re: First question on extending Python...

2006-06-09 Thread John Machin
On 10/06/2006 8:32 AM, Redefined Horizons wrote: > I still new to Python, and I've only dabbled in C, but I've got my > first project I need to tackle that involves both languages. I was > hoping to get some advice on how to proceed. > > There is a third-party application that I need to work with.

Re: Most elegant way to generate 3-char sequence

2006-06-09 Thread David Isaac
alpha = string.lowercase x=(a+b+c for a in alpha for b in alpha for c in alpha) -- http://mail.python.org/mailman/listinfo/python-list

Re: Weekend project - Directory simplifier - Shortest paths..

2006-06-09 Thread rh0dium
rh0dium wrote: It should be noted that these are virtual not real so filecmp can't be used... -- http://mail.python.org/mailman/listinfo/python-list

Re: Most elegant way to generate 3-char sequence

2006-06-09 Thread John Machin
On 10/06/2006 7:49 AM, Rob Cowie wrote: > Hi all, > > I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba', > 'abb', 'abc' etc. all the way to 'zzz'. > > How would you construct a generator to acheive this? > > A simple, working but somewhat inelegant solution is... You're not

First question on extending Python...

2006-06-09 Thread Redefined Horizons
I still new to Python, and I've only dabbled in C, but I've got my first project I need to tackle that involves both languages. I was hoping to get some advice on how to proceed. There is a third-party application that I need to work with. It is closed-source, but it exposes a C API. I want to wra

Re: Where is the ucs-32 codec?

2006-06-09 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: >> I would like to see it correct, unlike the current UTF-16 codec. Perhaps >> whoever contributes an UTF-32 codec could also deal with the defects of >> the UTF-16 codec. >> > Now this is interesting, as I hoped to base my code on UTF-16 (and > perhaps UTF-8 for combining

Weekend project - Directory simplifier - Shortest paths..

2006-06-09 Thread rh0dium
Hi all, OK I have two lists of directories.. Master lista=["pad/foo/sch/filea","pad/foo/sch/fileb","pad/foo/sch/filec","pad/foo/lay/filea","pad/foo/lay/fileb","pad/foo/lay/filec","pad/bar/sch/filea","pad/bar/sch/fileb","pad/bar/sch/filec",,"pad/bar/lay/filea","pad/bar/lay/fileb","pad/bar/lay/file

Re: Most elegant way to generate 3-char sequence

2006-06-09 Thread Grant Edwards
On 2006-06-09, Rob Cowie <[EMAIL PROTECTED]> wrote: > Hi all, > > I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba', > 'abb', 'abc' etc. all the way to 'zzz'. > > How would you construct a generator to acheive this? > > A simple, working but somewhat inelegant solution is... >

Re: Most elegant way to generate 3-char sequence

2006-06-09 Thread David Isaac
"Rob Cowie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > alpha = ['a','b','c','d'] #shortened for brevity > alpha2 = ['a','b','c','d'] > alpha3 = ['a','b','c','d'] > > def generator(): > for char in alpha: > for char2 in alpha2: > for char3 in alpha3: > yield c

Re: Most elegant way to generate 3-char sequence

2006-06-09 Thread James Stroud
Rob Cowie wrote: > Hi all, > > I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba', > 'abb', 'abc' etc. all the way to 'zzz'. > > How would you construct a generator to acheive this? > > A simple, working but somewhat inelegant solution is... > > alpha = ['a','b','c','d'] #sh

Re: Writing PNG with pure Python

2006-06-09 Thread David Isaac
"Johann C. Rocholl" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > What license would you suggest? I recommend that you choose the license that will best achieve your long run goals for the code. As I understand them, and as I understand your application and software development,

Re: Most elegant way to generate 3-char sequence

2006-06-09 Thread James Stroud
Rob Cowie wrote: > Hi all, > > I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba', > 'abb', 'abc' etc. all the way to 'zzz'. > > How would you construct a generator to acheive this? > > A simple, working but somewhat inelegant solution is... > > alpha = ['a','b','c','d'] #sh

Re: Win XP: Problem with shell scripting in Python

2006-06-09 Thread John Machin
On 10/06/2006 3:00 AM, A.M wrote: > Here is what I came up with after John and Fredrik's help. > > import os > import sys > def Execute(shell_command,logStream = sys.stdout): > print >>logStream, shell_command > child_stdin, child_stdout_and_stderr = os.popen4(shell_command) > commad_

Most elegant way to generate 3-char sequence

2006-06-09 Thread Rob Cowie
Hi all, I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba', 'abb', 'abc' etc. all the way to 'zzz'. How would you construct a generator to acheive this? A simple, working but somewhat inelegant solution is... alpha = ['a','b','c','d'] #shortened for brevity alpha2 = ['a','b'

Re: Writing PNG with pure Python

2006-06-09 Thread Johann C. Rocholl
Alan Isaac schrieb: > It's your code, so you get to license it. > But if you wish to solicit patches, > a more Pythonic license is IMHO more likely > to prove fruitful. What license would you suggest? After some reading at [1] and [2] and [3], I found that the Academic Free License (version 2.1) a

Re: wxpython wxgrid question

2006-06-09 Thread rbann11
jean-michel bain-cornu wrote: > [EMAIL PROTECTED] a écrit : > > Tim Roberts wrote: > >> [EMAIL PROTECTED] wrote: > >>> I am looking for example code that consists of just a frame and a > >>> grid(10x2). The grid must fill the its parent even if the frame is > >>> resized. > >> Have you gone thro

Re: wxpython wxgrid question

2006-06-09 Thread rbann11
jean-michel bain-cornu wrote: > [EMAIL PROTECTED] a écrit : > > Tim Roberts wrote: > >> [EMAIL PROTECTED] wrote: > >>> I am looking for example code that consists of just a frame and a > >>> grid(10x2). The grid must fill the its parent even if the frame is > >>> resized. > >> Have you gone thro

Re: More pythonic shell sort?

2006-06-09 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > An aside - can anyone tell me where the use += and -= is documented? > > http://docs.python.org/ref/augassign.html > http://pyref.infogami.com/assignments > > Thanks!!! -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-09 Thread Ken Tilton
Joe Marshall wrote: > Xah Lee wrote: > >>in March, i posted a essay "What is Expressiveness in a Computer >>Language", archived at: >>http://xahlee.org/perl-python/what_is_expresiveness.html >> >>I was informed then that there is a academic paper written on this >>subject. >> >>On the Expressive

Re: More pythonic shell sort?

2006-06-09 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > An aside - can anyone tell me where the use += and -= is documented? http://docs.python.org/ref/augassign.html http://pyref.infogami.com/assignments -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing PNG with pure Python

2006-06-09 Thread David Isaac
> Em Sex, 2006-06-09 às 12:30 -0400, Alan Isaac escreveu: > > It's your code, so you get to license it. > > But if you wish to solicit patches, > > a more Pythonic license is IMHO more likely > > to prove fruitful. "Felipe Almeida Lessa" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED

Re: Python or Ajax?

2006-06-09 Thread Ravi Teja
> I've been hearing a ot about AJAX lately. I may have to build a web > application in the near future, and I was curoius: > > How does a web application that uses Python compare with one that uses AJAX? > > I've done some basic web page design with HTML and CSS, but never any > web applications. I

Re: Python or Ajax?

2006-06-09 Thread Larry Bates
Redefined Horizons wrote: > I've been hearing a ot about AJAX lately. I may have to build a web > application in the near future, and I was curoius: > > How does a web application that uses Python compare with one that uses > AJAX? > > I've done some basic web page design with HTML and CSS, but n

Re: Killing a thread

2006-06-09 Thread Felipe Almeida Lessa
Em Sex, 2006-06-09 às 13:54 -0700, Manish Marathe escreveu: > On 6/9/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Manish Marathe wrote: > > > I am creating threads using my self defined class which > inherits the > > threading.Thread class. I want to know

Re: Questions about extending Python...

2006-06-09 Thread Scott David Daniels
Redefined Horizons wrote: > I've got a third-part application that exposes a C API. I'd like to > wrap it in Python. Is there a specific forum that covers extending and > embedding Python, or are those type of questions O.K. on this list? This is the place. Swig & Pyrex are a couple of standard a

Re: Converting binary sid's to a hex string

2006-06-09 Thread LittlePython
Thx Roger, I have been off line for a few days. I am sorry not to reply earlier. I will try this, but I am not sure what "buffer" does ( I am a newbie to python). "Roger Upole" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You can use the binascii module to convert the raw > bytes

More pythonic shell sort?

2006-06-09 Thread [EMAIL PROTECTED]
Disclaimer - I recognize this is not a practical exercise. There are many implementations around that would do the job better, more efficiently (Meaning in C) or whatever. I caught some thread about sorting and started thinking about shell sort and as part of my trying to pythonise my mind an

Re: Writing PNG with pure Python

2006-06-09 Thread Felipe Almeida Lessa
Em Sex, 2006-06-09 às 12:30 -0400, Alan Isaac escreveu: > It's your code, so you get to license it. > But if you wish to solicit patches, > a more Pythonic license is IMHO more likely > to prove fruitful. "Pythonic license"? That's new to me. I can figure out what a "Python-like license" is, but I

Re: Killing a thread

2006-06-09 Thread Manish Marathe
On 6/9/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: Manish Marathe wrote:> I am creating threads using my self defined class which inherits the> threading.Thread class. I want to know how can I kill the threads which> are being created by the object of my self defined class. you cannot kill a threa

Re: Killing a thread

2006-06-09 Thread Fredrik Lundh
Manish Marathe wrote: > I am creating threads using my self defined class which inherits the > threading.Thread class. I want to know how can I kill the threads which > are being created by the object of my self defined class. you cannot kill a thread "from the outside"; you have to design your

Killing a thread

2006-06-09 Thread Manish Marathe
Hello, I am creating threads using my self defined class which inherits the threading.Thread class. I want to know how can I kill the threads which are being created by the object of my self defined class. Thanks -- Manish MaratheSpikeSource, Inc.http://developer.spikesource.com -- http://mail.p

Re: Questions about extending Python...

2006-06-09 Thread Fredrik Lundh
Redefined Horizons wrote: > I've got a third-part application that exposes a C API. I'd like to > wrap it in Python. Is there a specific forum that covers extending and > embedding Python, or are those type of questions O.K. on this list? those type of questions are perfectly okay on this list, b

Re: Python or Ajax?

2006-06-09 Thread Miguel Galves
These are two very different things.Python is a programming language, that can be used to write server side code,and web applications. AJAX is mora way of life than a technology. Its a listof well known technologies that can be used together to build rich user interfaces. AJAX and Python could be u

wxPython: Should you use a master sizer object?

2006-06-09 Thread John Salerno
Sorry for posting here again. I tried the wxPython list but I'm not sure I'm sending to the right email address! It bounced back. Besides, your opinions are too good to pass up. ;) My question was: I was wondering, is it recommended to always have a top-level sizer in which you place all other

Re: Python or Ajax?

2006-06-09 Thread Paul Osman
On 9-Jun-06, at 4:00 PM, Redefined Horizons wrote: > I've been hearing a ot about AJAX lately. I may have to build a web > application in the near future, and I was curoius: > > How does a web application that uses Python compare with one that > uses AJAX? > > I've done some basic web page desig

Python or Ajax?

2006-06-09 Thread Redefined Horizons
I've been hearing a ot about AJAX lately. I may have to build a web application in the near future, and I was curoius: How does a web application that uses Python compare with one that uses AJAX? I've done some basic web page design with HTML and CSS, but never any web applications. I don't want

Questions about extending Python...

2006-06-09 Thread Redefined Horizons
I've got a third-part application that exposes a C API. I'd like to wrap it in Python. Is there a specific forum that covers extending and embedding Python, or are those type of questions O.K. on this list? Scott Huey -- http://mail.python.org/mailman/listinfo/python-list

Re: regexp questoin

2006-06-09 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > pat = re.compile(r"%s" %(userinput) ) #userinput is passed from > command line argument that r"%s" % (userinput) thing is a pointless operation: the "r" prefix controls how backslashes in a string literal is parsed; the result is an ordinary string ("%s" in this ca

Re: UltraEdit and Python

2006-06-09 Thread No
I'm replying to me... In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > > How do I sent up Ultra Edit to work w/ Python? > > > > How do I get Ultra Edit to run a Python script currently in the edit window > > and supply res

Re: Pychecker

2006-06-09 Thread Anthony Greene
On Fri, 09 Jun 2006 11:46:59 -0700, Matt Good wrote: > Anthony Greene wrote: >> Howdy, I had the impression that pychecker caught and reported such >> dynamic syntactical errors. >> >> #!/usr/bin/env python >> >> >> def add(i): >> i += 10 >> >> status = 3 >> >> if 1 == 1: >> statuss = 15 >

Re: UltraEdit and Python

2006-06-09 Thread No
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > How do I sent up Ultra Edit to work w/ Python? > > How do I get Ultra Edit to run a Python script currently in the edit window > and supply results? > > I can't figure out how to get Ultra Edit to invoke the Python debugger to > allow

Re: Deep copy of XML elements from one document to another

2006-06-09 Thread Fredrik Lundh
pesachzon wrote: > In case anyone is wondering how to do this, here's a short explanation: > http://eugene.eggkeg.com/?p=16 "Sorry, no posts matched your criteria." forgot to click "publish" before you clicked "send" ? -- http://mail.python.org/mailman/listinfo/python-list

Re: TypeError: unsubscriptable object

2006-06-09 Thread k . retheesh
I did the same, The function type is < NoneType> and the description type is so how can i print a part of this 2 output. These values are returned by database. Thanks Retheesh Laszlo Nagy wrote: > [EMAIL PROTECTED] írta: > > So wat should I do ?? > > > You should do this: > > print type(Functi

Re: Interacting with a process that I ran with subprocess module

2006-06-09 Thread [EMAIL PROTECTED]
Well... I found pexpect as you said, but I also found that it doesn't work on windows. I need a cross-platform solution, as the program is going to run on several operating systems. Any other sugestion? Cheers! Diez B. Roggisch wrote: > [EMAIL PROTECTED] schrieb: > > Hi folks, > > > > I'm trying

Re: Error in Chain of Function calls (Code Attached)

2006-06-09 Thread Fredrik Lundh
Girish Sahani wrote: > Ohh...I was thinking that posting the whole code would not be a good idea. > The error i get above is: > line 266, in colocationMiner > prunedNew = genColocations(prunedK) that's a line of code, not an error. please include the entire traceback, or at least the actual erro

Re: TypeError: unsubscriptable object

2006-06-09 Thread Laszlo Nagy
[EMAIL PROTECTED] írta: > I did the same, > > The function type is < NoneType> and the description type is > so how can i print a part of this 2 output. > The unicode object IS subscriptable. It is a unicode string which has characters. The value None is not subscriptable. It probably means th

Re: CONSTRUCT - Python's way of Ruby's "alias_method"

2006-06-09 Thread Ilias Lazaridis
Slawomir Nowaczyk wrote: > On Thu, 08 Jun 2006 15:28:39 +0300 > Ilias Lazaridis <[EMAIL PROTECTED]> wrote: > > #> *IMPORT* > #> > #> I would like to know, if this construct is valid, or if it can > #> result in problems (that I do not see as a newcomer): > > The intricacies of import are far bey

Re: wxpython: another missing attribute

2006-06-09 Thread John Salerno
Morpheus wrote: > This becomes a local var, i.e. local to __init__. To make it an instance var > write > > self.text = wx.StaticText(panel, -1, 'Click results') Ah, more namespace trickery! Thanks! :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Pychecker

2006-06-09 Thread skip
Rick> I think you're asking a lot from pychecker. Rick> kop = 1 Rick> koi = 2 Rick> if True: Rick> koo = 3 Rick> What would you like pychecker to report? I thing the OP was hoping for a "not used" error, but it can only reasonably do that within a function, which

Re: TypeError: unsubscriptable object

2006-06-09 Thread k . retheesh
I did the same, The function type is < NoneType> and the description type is so how can i print a part of this 2 output. These values are returned by database. Thanks Retheesh Laszlo Nagy wrote: > [EMAIL PROTECTED] írta: > > So wat should I do ?? > > > You should do this: > > print type(Functi

Re: TypeError: unsubscriptable object

2006-06-09 Thread k . retheesh
So wat should I do ?? K.S.Sreeram wrote: > [EMAIL PROTECTED] wrote: > > print template % (ID, IID, Function[:10], Description[:10], > > ErrorNumber, StatusCD) > > TypeError: unsubscriptable object > > It means either 'Function' or 'Description' is not a sequence. > Try inserting print statemen

Re: Pychecker

2006-06-09 Thread Matt Good
Anthony Greene wrote: > Howdy, I had the impression that pychecker caught and reported such > dynamic syntactical errors. > > #!/usr/bin/env python > > > def add(i): > i += 10 > > status = 3 > > if 1 == 1: > statuss = 15 > > add(status) > > === > > exalted sysfault$ pych

Re: TypeError: unsubscriptable object

2006-06-09 Thread Laszlo Nagy
[EMAIL PROTECTED] írta: > So wat should I do ?? > You should do this: print type(Function),type(Description) raise SystemExit Instead of this: print template % (ID, IID, Function[:10], Description[:10],ErrorNumber, StatusCD) Then probably you will see: instead of or something simil

Re: TypeError: unsubscriptable object

2006-06-09 Thread k . retheesh
So wat should I do ?? K.S.Sreeram wrote: > [EMAIL PROTECTED] wrote: > > print template % (ID, IID, Function[:10], Description[:10], > > ErrorNumber, StatusCD) > > TypeError: unsubscriptable object > > It means either 'Function' or 'Description' is not a sequence. > Try inserting print statemen

Re: TypeError: unsubscriptable object

2006-06-09 Thread k . retheesh
So wat should I do ?? K.S.Sreeram wrote: > [EMAIL PROTECTED] wrote: > > print template % (ID, IID, Function[:10], Description[:10], > > ErrorNumber, StatusCD) > > TypeError: unsubscriptable object > > It means either 'Function' or 'Description' is not a sequence. > Try inserting print statemen

Re: regexp questoin

2006-06-09 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > hi > > i created a script to ask user for an input that can be a pattern > right now, i use re to compile that pattern > pat = re.compile(r"%s" %(userinput) ) #userinput is passed from > command line argument > if the user key in a pattern , eg [-] , and my script will

Re: What is Expressiveness in a Computer Language

2006-06-09 Thread Kaz Kylheku
Xah Lee wrote: > Has anyone read this paper? And, would anyone be interested in giving a > summary? Not you, of course. Too busy preparing the next diatribe against UNIX, Perl, etc. ;) -- http://mail.python.org/mailman/listinfo/python-list

PAMIE save an image

2006-06-09 Thread elbertlev
Hi, all! I'm writing a web page tester. The page is designed in such a way, that every time it creates an image file and displays it on the page. As soon as the file is downoladed it is deleted from the server. Using PAMIE I can download the page (by controlling an instance of IE) then images = ie

Re: What is Expressiveness in a Computer Language

2006-06-09 Thread PofN
Xah Lee wrote: [the usual toff-topic trolling stuff] Shit, da troll is back. Abuse reports need to go to abuse [] pacbell.net and abuse [] swbell.net this time. -- http://mail.python.org/mailman/listinfo/python-list

Re: __getattr__ question

2006-06-09 Thread Laszlo Nagy
Here is a horrible solution. I could make it thread-safe by adding +30 lines. There must be a better solution. class TemplateItem(object): def __init__(self,name): self.name = name self.items = [] def __getattr__(self,name): self._getattr_was_called = True

Re: Pychecker

2006-06-09 Thread Rick Zantow
Anthony Greene <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Howdy, I had the impression that pychecker caught and reported such > dynamic syntactical errors. > > #!/usr/bin/env python > > > def add(i): > i += 10 > > status = 3 > > if 1 == 1: > statuss = 15 > > add(stat

Re: References and copying

2006-06-09 Thread [EMAIL PROTECTED]
> Please verify before asserting: > > >>> a = [[1, 2], [3, 4]] > >>> b = a[1] > >>> b is a[1] > True > >>> id(b) > 46912496915448 > >>> id(a[1]) > 46912496915448 Right, I must have had slicing on the brain. -- http://mail.python.org/mailman/listinfo/python-list

Re: wxpython: another missing attribute

2006-06-09 Thread Morpheus
"John Salerno" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ah, the object-oriented stuff is just so FUN! :) Here's my code, > followed by the error. I thought I was referring to the 'text' attribute > correctly, but it seems not. > > import wx > > > class InputForm(wx.Frame): > >

Pychecker

2006-06-09 Thread Anthony Greene
Howdy, I had the impression that pychecker caught and reported such dynamic syntactical errors. #!/usr/bin/env python def add(i): i += 10 status = 3 if 1 == 1: statuss = 15 add(status) === exalted sysfault$ pychecker foo.py Processing foo... Warnings... No

Re: CONSTRUCT - Python's way of Ruby's "alias_method"

2006-06-09 Thread Ilias Lazaridis
Duncan Booth wrote: > Ilias Lazaridis wrote: > >>> #patch_service.py >>> from toto import service >>> >>> def my_impl(self, *args) : >>> old_result = self._old_method(*args) >>> # ... >>> return new_result >>> >>> if not hasattr(service, '_old_method') : >>> service._old_method

wxpython: another missing attribute

2006-06-09 Thread John Salerno
Ah, the object-oriented stuff is just so FUN! :) Here's my code, followed by the error. I thought I was referring to the 'text' attribute correctly, but it seems not. import wx class InputForm(wx.Frame): def __init__(self, parent, id, title, pos=wx.DefaultPosition, size

Re: References and copying

2006-06-09 Thread Donn Cave
In article <[EMAIL PROTECTED]>, bruno at modulix <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: ... > >>And I don't understand it. I thought, that b will be a reference to a, > >>so changing b should change a as well. > > > > > > No, you've set the name b to reference a slice of a. Slici

Deep copy of XML elements from one document to another

2006-06-09 Thread pesachzon
In case anyone is wondering how to do this, here's a short explanation: http://eugene.eggkeg.com/?p=16 -- http://mail.python.org/mailman/listinfo/python-list

Re: shared logs and multiple configurations

2006-06-09 Thread Vinay Sajip
Chris Curvey wrote: > 1) Can I share log files between processes? Log messages seem to get > written, but when it comes time to roll over a log, I generally get a > "IO operation on closed file" error. (I'm thinking that I may have to > set up a logging service if I want to do this, but I'm hopi

Re: TypeError: unsubscriptable object

2006-06-09 Thread K.S.Sreeram
[EMAIL PROTECTED] wrote: > print template % (ID, IID, Function[:10], Description[:10], > ErrorNumber, StatusCD) > TypeError: unsubscriptable object It means either 'Function' or 'Description' is not a sequence. Try inserting print statements to see what values they are. e.g: a = 2 a[:10] wi

Re: CONSTRUCT - Python's way of Ruby's "alias_method"

2006-06-09 Thread Duncan Booth
Ilias Lazaridis wrote: >> #patch_service.py >> from toto import service >> >> def my_impl(self, *args) : >> old_result = self._old_method(*args) >> # ... >> return new_result >> >> if not hasattr(service, '_old_method') : >> service._old_method = service.method >> servic

TypeError: unsubscriptable object

2006-06-09 Thread k . retheesh
Can anybody tell me why am I getting this error message while trying to print a part of a string. Is there a better approach for this... Traceback (most recent call last): File "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in

Re: Request new feature suggestions for my PDF conversion toolkit - xtopdf

2006-06-09 Thread vasudevram
> Thanks! You're welcome. > So here is an idea for a great enhancement: > rst -> PDF What is rst? I Googled for it, first few hits found didn't make sense (like Remote Sensing Tutorial :-). The one that did seem to make sense (in relation to xtopdf), was this : http://docutils.sourceforge.net/r

Re: Getting start/end dates given week-number

2006-06-09 Thread Tim Chase
> I think you missed %U format, since later you write: correct. I remember seeing something (a long while back) that had a Sunday-first format, but I must have missed it in my reading of "man strftime". > If you want to match %U: > > def weekBoundaries(year, week): > startOfYear = date(y

__getattr__ question

2006-06-09 Thread Laszlo Nagy
Hello, This is from the Python documentation (fragment): __getattr__( self, name) Called when an attribute lookup has not found the attribute in the usual places (i.e. it is not an instance attribute nor is it found in the class tree for self). name is the attribute name. This method

Re: Win XP: Problem with shell scripting in Python

2006-06-09 Thread A.M
Here is what I came up with after John and Fredrik's help. import os import sys def Execute(shell_command,logStream = sys.stdout): print >>logStream, shell_command child_stdin, child_stdout_and_stderr = os.popen4(shell_command) commad_output = child_stdout_and_stderr.read()

Re: Getting start/end dates given week-number

2006-06-09 Thread Serge Orlov
Tim Chase wrote: > I've been trying to come up with a good algorithm for determining > the starting and ending dates given the week number (as defined > by the strftime("%W") function). I think you missed %U format, since later you write: > My preference would be for a Sunday->Saturday range rath

Re: About sizers..

2006-06-09 Thread Grant Edwards
On 2006-06-09, Mario Lacunza <[EMAIL PROTECTED]> wrote: > Hi, > > Im build a cross platform application develop with Python and wxPython > and I ask for your opinions about if is a good choice use sizers for my > frames design? or not? Yes. Using hardwired pixel-count locations is evil, Evil, EVI

  1   2   3   >