Re: Python GDB Wrapper

2008-03-07 Thread Raja
Hi All, Thanks for replies. Daniel- I am looking at just a wrapper around GDB. I dont want to emulate the functionalities of GDB but instead use them in python scripting. Martin - Misc/gdbinit looks promising. Thanks a lot. Thanks, Raja. On Mar 7, 12:43 pm, "Martin v. Löwis" <[EMAIL PROTECT

Re: the problem of import module

2008-03-07 Thread Peter Otten
[EMAIL PROTECTED] wrote: > follow the dive into python > - import sys sys.path sys.path.append('E \achieve\book\diveintopython-pdfzh-cn-5.4b\diveintopythonzh-cn-5.4b\py') > --

Re: Python GDB Wrapper

2008-03-07 Thread Raja
On Mar 7, 1:21 pm, Raja <[EMAIL PROTECTED]> wrote: > Hi All, > Thanks for replies. Daniel- I am looking at just a wrapper > around GDB. I dont want to emulate the functionalities of GDB but > instead use them in python scripting. > Martin - Misc/gdbinit looks promising. Thanks a lot. > > Than

Re: system32 directory

2008-03-07 Thread Tim Golden
Robert Dailey wrote: > On Thu, Mar 6, 2008 at 2:42 AM, Tim Golden <[EMAIL PROTECTED]> wrote: >> >> First thing to do when asking "How do I do X in Python under Windows?" >> is to stick -- python X -- into Google and you get, eg: >> >> >> http://aspn.activestate.com/ASPN/docs/ActivePython/2.2/PyWin

Re: Looking for very light weight template library (not framework)

2008-03-07 Thread Duncan Booth
"Malcolm Greene" <[EMAIL PROTECTED]> wrote: > New to Python and looking for a template library that allows Python > expressions embedded in strings to be evaluated in place. In other words > something more powerful than the basic "%(variable)s" or "$variable" > (Template) capabilities. > > I kno

Re: Python GDB Wrapper

2008-03-07 Thread Navtej Singh
Raja, Check this http://fusil.hachoir.org/trac/wiki/Ptrace [gdb.py] On Fri, Mar 7, 2008 at 2:11 PM, Raja <[EMAIL PROTECTED]> wrote: > On Mar 7, 1:21 pm, Raja <[EMAIL PROTECTED]> wrote: > > Hi All, > > Thanks for replies. Daniel- I am looking at just a wrapper > > around GDB. I dont want

Re: help on file storage for split multi part download

2008-03-07 Thread Gabriel Genellina
En Fri, 07 Mar 2008 04:16:42 -0200, <[EMAIL PROTECTED]> escribi�: > On Mar 7, 1:38 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >> En Thu, 06 Mar 2008 14:34:27 -0200, <[EMAIL PROTECTED]> escribi�: >> >> > storage class which can write the file splits that are currently being >> > downloaded t

Re: Difference between 'function' and 'method'

2008-03-07 Thread Gabriel Genellina
En Thu, 06 Mar 2008 23:46:43 -0200, <[EMAIL PROTECTED]> escribi�: > oss.message is a abstraction class that writes the method name into a > string, then sends it to OSS... outgoingserver or serverside. > > Now that I'm writing it, and this is important, -to- the -newsgroup-, > I realize you could

Re: Looking for very light weight template library (not framework)

2008-03-07 Thread Roman Bertle
* Malcolm Greene <[EMAIL PROTECTED]>: > New to Python and looking for a template library that allows Python > expressions embedded in strings to be evaluated in place. In other words > something more powerful than the basic "%(variable)s" or "$variable" > (Template) capabilities. [...] > > Us

Re: Looking for very light weight template library (not framework)

2008-03-07 Thread Stefan Behnel
Jeff McNeil wrote: > Isn't there some long > running joke about new Python programmers creating their own template > language or something, too? =) http://article.gmane.org/gmane.comp.python.general/544922 Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Altering imported modules

2008-03-07 Thread [EMAIL PROTECTED]
On 6 mar, 21:29, Tro <[EMAIL PROTECTED]> wrote: > On Wednesday 05 March 2008, Bruno Desthuilliers wrote: > > > > > Tro a écrit : (snip) > > > I'd like to know if it's possible to make tlslite load *my* asyncore > > > module without changing any of the tlslite code. > > > Not sure this apply to your

Re: Please keep the full address

2008-03-07 Thread Michael Wieher
I normally find this kind of back & forth useless and annoying spam but the irony is too much to avoid commenting. (read the following, then ...) > > > > "His" posts? > > > > Whatever. I'm too old to worry about searching for politically correct, > > gender neutral pronouns. > > > I'm pretty sur

Your Fortune for the Day!!!

2008-03-07 Thread nkavitha551
Your Fortune for the Day!!! Hi, To know what it is? Visit the website below and be cool !!! -- http://myprofilekavitha.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Licence confusion: distributing MSVC?71.DLL

2008-03-07 Thread Tom Wright
jim-on-linux wrote: > This is what someone wrote on 1-21-2007 > to this help site about this pain in the a... > MSVCR71 stuff. > > " I believe this problem doesn't exist. > (snip useful bit of EULA and explanation) Thanks for that - just what I didn't manage to turn up with Google. I'll go ahead

How to clear a list (3 ways).

2008-03-07 Thread francois . petitjean
(second try with an enhanced version) Executive summary : What idiom do you use for resetting a list ? lst = |] # (1) lst[:] = [] # (2) del lst[:] # (3) Consider the following code : #!/usr/bin/env python # -*- coding: latin_1 -*- """ container.py how to clear a container """ c

Re: List all files using FTP

2008-03-07 Thread Anders Eriksson
On Thu, 6 Mar 2008 20:07:46 +, Simon Brunning wrote: > This might be of use: > > Nice, Just what I needed! Thank you! // Anders -- English is not my first, or second, language so anything strange, or insulting, is due to the translation. Please correct

Re: Classes and modules are singletons?

2008-03-07 Thread Steven D'Aprano
On Thu, 06 Mar 2008 06:30:41 -0800, Carl Banks wrote: > On Mar 5, 8:44 pm, Steven D'Aprano <[EMAIL PROTECTED] > cybersource.com.au> wrote: >> But what about classes? Are they singletons? Obviously classes aren't >> Singleton classes, that is, given an arbitrary class C you can create >> multiple i

Re: What is a class?

2008-03-07 Thread Steven D'Aprano
On Thu, 06 Mar 2008 08:40:47 -0800, castironpi wrote: > you > could say exec( open( 'modA.py' ).read() ) ==> import modA Yes, you could say that, but you'd be wrong. Please test your code before making such claims in the future. -- Steven -- http://mail.python.org/mailman/listinfo/python-li

Re: for-else

2008-03-07 Thread Sion Arrowsmith
Jeffrey Barish <[EMAIL PROTECTED]> wrote: >Terry Reedy wrote: >> A for-loop is equivalent to a while loop with the condition 'iterator is >> not exhausted'.  So do_else when that condition is false -- the iterator >> is exhausted. >I think that this is the most important statement in this thread.

islice ==> [::]

2008-03-07 Thread bearophileHUGS
I find itertools.islice() useful, so for Python 3.x I may like to see it removed from the itertools module, and the normal slicing syntax [::] extended to work with generators/iterators too. from itertools import islice primes = (x for x in xrange(1,999) if all(x % y for y in xrange(2, x))) print

Re: Difference between 'function' and 'method'

2008-03-07 Thread Sion Arrowsmith
Gabriel Genellina <[EMAIL PROTECTED]> wrote: >En Thu, 06 Mar 2008 23:46:43 -0200, <[EMAIL PROTECTED]> escribi�: >> [ ... ] >You may look at the SimpleXMLRPCServer class and see how it implements >introspection. It's rather easy (and doesn't require metaclasses nor >decorators nor any other fa

hidden built-in module

2008-03-07 Thread koara
Hello, is there a way to access a module that is hidden because another module (of the same name) is found first? More specifically, i have my own logging.py module, and inside this module, depending on how initialization goes, i may want to do 'from logging import *' from the built-in logging.

Re: hidden built-in module

2008-03-07 Thread gigs
koara wrote: > Hello, is there a way to access a module that is hidden because > another module (of the same name) is found first? > > More specifically, i have my own logging.py module, and inside this > module, depending on how initialization goes, i may want to do 'from > logging import *' fro

Re: hidden built-in module

2008-03-07 Thread koara
On Mar 5, 1:39 pm, gigs <[EMAIL PROTECTED]> wrote: > koara wrote: > > Hello, is there a way to access a module that is hidden because > > another module (of the same name) is found first? > > > More specifically, i have my own logging.py module, and inside this > > module, depending on how initiali

Re: hidden built-in module

2008-03-07 Thread Michael Wieher
2008/3/7, koara <[EMAIL PROTECTED]>: > > On Mar 5, 1:39 pm, gigs <[EMAIL PROTECTED]> wrote: > > koara wrote: > > > Hello, is there a way to access a module that is hidden because > > > another module (of the same name) is found first? > > > > > More specifically, i have my own logging.py module, an

ANN: Wing IDE 3.0.4 released

2008-03-07 Thread Stephan Deibel
Hi, We're happy to announce version 3.0.4 of Wing IDE, an advanced development environment for the Python programming language. It is available from: http://wingware.com/downloads Version 3.0.4 is a bug fix release that reduces debugger overhead by about 50% per Python instruction executed, impr

Hyphenation: PyHyphen project now hosted on GoogleCode

2008-03-07 Thread [EMAIL PROTECTED]
This is to inform you that development of PyHyphen and issue tracking takes now place at http://pyhyphen.googlecode.com. All interested parties are encouraged to submit comments, suggestions and bug reports. Snapshots of the source tree can be obtained using subversion. At this stage, the sources

Edit and continue for debugging?

2008-03-07 Thread Bronner, Gregory
I haven't seen much on this for a few years: I'm working on a GUI application that has lots of callbacks. Testing it is very slow and quite boring, as every time I find an error, I have to exit it, restart it, and repeat the series of clicks. It would be really amazing if python supported a reaso

Quit-command not quiting

2008-03-07 Thread K Viltersten
I entered the code from tkinter.pdf, section 2 but for reason, the application doesn't close as i press the quit-button. The wondow itself vanishes if i click the cross in the upper-right corner but pressing the quit-button only makes it "pressed". Then, the program freezes. This is the code.

Re: How to clear a list (3 ways).

2008-03-07 Thread Gabriel Genellina
En Fri, 07 Mar 2008 09:39:05 -0200, <[EMAIL PROTECTED]> escribi�: > Executive summary : What idiom do you use for resetting a list ? >lst = |] # (1) >lst[:] = [] # (2) >del lst[:] # (3) (3) if I want to keep the same list else (1) An example when (1) is desirable: # generate

Re: hidden built-in module

2008-03-07 Thread Diez B. Roggisch
koara schrieb: > On Mar 5, 1:39 pm, gigs <[EMAIL PROTECTED]> wrote: >> koara wrote: >>> Hello, is there a way to access a module that is hidden because >>> another module (of the same name) is found first? >>> More specifically, i have my own logging.py module, and inside this >>> module, depending

Re: Converting a string to the most probable type

2008-03-07 Thread [EMAIL PROTECTED]
On Mar 6, 9:17 pm, Luis M. González <[EMAIL PROTECTED]> wrote: > On 6 mar, 11:27, Pierre Quentel <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > I would like to know if there is a module that converts a string to a > > value of the "most probable type" ; for instance : > > - if the string is "abcd"

Re: hidden built-in module

2008-03-07 Thread Gabriel Genellina
En Fri, 07 Mar 2008 12:15:04 -0200, koara <[EMAIL PROTECTED]> escribi�: > On Mar 5, 1:39 pm, gigs <[EMAIL PROTECTED]> wrote: >> koara wrote: >> > Hello, is there a way to access a module that is hidden because >> > another module (of the same name) is found first? >> >> > More specifically, i have

problem with join

2008-03-07 Thread nodrogbrown
hi i am using python on WinXP..i have a string 'folder ' that i want to join to a set of imagefile names to create complete qualified names so that i can create objects out of them folder='F:/brown/code/python/fgrp1' filenms=['amber1.jpg', 'amber3.jpg', 'amy1.jpg', 'amy2.jpg'] filenameslist=[] for

Re: Quit-command not quiting

2008-03-07 Thread Gabriel Genellina
En Fri, 07 Mar 2008 12:56:44 -0200, K Viltersten <[EMAIL PROTECTED]> escribi�: > I entered the code from tkinter.pdf, section > 2 but for reason, the application doesn't > close as i press the quit-button. > > The wondow itself vanishes if i click the > cross in the upper-right corner but pressi

Re: hidden built-in module

2008-03-07 Thread koara
> You can only try and search the sys-path for the logging-module, using > > sys.prefix > > and then look for logging.py. Using > > __import__(path) > > you get a reference to that module. > > Diez Thank you Diez, that's the info i'd been looking for :-) So the answer is sys module + __import__

Re: Embedding a literal "\u" in a unicode raw string.

2008-03-07 Thread rmano
On Mar 4, 1:00 pm, NickC <[EMAIL PROTECTED]> wrote: > > Python 3.0a3+ (py3k:61229, Mar 4 2008, 21:38:15) > [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 > Type "help", "copyright", "credits" or "license" for more information.>>> > r"\u" > '\\u' > >>> r"\uparrow" > '\\uparro

Re: problem with join

2008-03-07 Thread corynissen
On Mar 7, 9:12 am, nodrogbrown <[EMAIL PROTECTED]> wrote: > hi > i am using python on WinXP..i have a string 'folder ' that i want to > join to a set of imagefile names to create complete qualified names so > that i can create objects out of them > > folder='F:/brown/code/python/fgrp1' > filenms=['

Re: problem with join

2008-03-07 Thread Robert Bossy
nodrogbrown wrote: > hi > i am using python on WinXP..i have a string 'folder ' that i want to > join to a set of imagefile names to create complete qualified names so > that i can create objects out of them > > folder='F:/brown/code/python/fgrp1' > filenms=['amber1.jpg', 'amber3.jpg', 'amy1.jpg',

Re: problem with join

2008-03-07 Thread Tim Golden
nodrogbrown wrote: > hi > i am using python on WinXP..i have a string 'folder ' that i want to > join to a set of imagefile names to create complete qualified names so > that i can create objects out of them > > folder='F:/brown/code/python/fgrp1' > filenms=['amber1.jpg', 'amber3.jpg', 'amy1.jpg',

SV: Quit-command not quiting

2008-03-07 Thread K Viltersten
>> The window itself vanishes if i click the >> cross in the upper-right corner but pressing >> the quit-button only makes it "pressed". >> Then, the program freezes. > > How did you run it? From inside IDLE? IDLE itself is written > using Tk, and I think that your mainloop interferes with the

swig-python import error

2008-03-07 Thread abarun22
Hi I am facing a problem while loading a SWIG generated shared module from python. The development is under HP-UX 32b platform. I use gcc version 4.0.2 to build the shared module. This is how i try to build the module. # Compilation GCC="$GCC -march=1.1" $GCC -v -c -fpic ${ETUDE}.c ${ETUDE}_wrap.

Re: problem with join

2008-03-07 Thread Gabriel Genellina
En Fri, 07 Mar 2008 13:12:13 -0200, nodrogbrown <[EMAIL PROTECTED]> escribi�: > i am using python on WinXP..i have a string 'folder ' that i want to > join to a set of imagefile names to create complete qualified names so > that i can create objects out of them > > folder='F:/brown/code/python/f

Re: problem with join

2008-03-07 Thread corynissen
On Mar 7, 9:33 am, [EMAIL PROTECTED] wrote: > On Mar 7, 9:12 am, nodrogbrown <[EMAIL PROTECTED]> wrote: > > > > > hi > > i am using python on WinXP..i have a string 'folder ' that i want to > > join to a set of imagefile names to create complete qualified names so > > that i can create objects out

Timed execution in eval

2008-03-07 Thread alex . pedwysocki
I have various bits of code I want to interpret and run at runtime in eval ... I want to be able to detect if they fail with error, I want to be able to time them, and I want to be able to stop them if they run too long. I cannot add code to the eval'd strings that will help me accomplish this.

Regarding coding style

2008-03-07 Thread K Viltersten
I've been recommended reading of: http://www.python.org/dev/peps/pep-0008/ and in there i saw two things that i need to get elaborated. 1. When writing English, Strunk and White apply. Where can i download it? Am i actually expected to read the whole book? How many people actually do aply it?

Re: Regarding coding style

2008-03-07 Thread Michael Wieher
Placing 2 spaces after a period is standard, grammatically correct English, at least as I was taught... I don't know who Strunk or White are. Maybe Mr. Pink has a book you can refer to instead. 2008/3/7, K Viltersten <[EMAIL PROTECTED]>: > > I've been recommended reading of: > http://www.python.

Keep a python script running after browser window closed

2008-03-07 Thread sophie_newbie
Hi, I have a cgi script that performs a very long computation that can take several hours to complete. Is there any smart way that I can keep this script running until it is finished (after the user has closed the browser) and email them with the results. The email bit isn't the problem, I just do

Re: problem with join

2008-03-07 Thread nodrogbrown
> If the string is only used to open a file, and never shown to the user, > what you prefer is irrelevant, isn't it? guess thats right.. > Back to your code, try this: > > from os.path import join, normpath > folder = 'F:/brown/code/python/fgrp1' > names = ['amber1.jpg', 'amber3.jpg', 'amy1.jpg

Re: Keep a python script running after browser window closed

2008-03-07 Thread Mike Driscoll
On Mar 7, 10:28 am, sophie_newbie <[EMAIL PROTECTED]> wrote: > Hi, > > I have a cgi script that performs a very long computation that can > take several hours to complete. Is there any smart way that I can keep > this script running until it is finished (after the user has closed > the browser) and

Re: OT: Failed saving throw

2008-03-07 Thread Aahz
In article <[EMAIL PROTECTED]>, Aahz <[EMAIL PROTECTED]> wrote: > >For anyone who hasn't heard, E. Gary Gygax died yesterday. Some people >think we should build a tomb in his honor. ;-) ...and xkcd finally weighs in: http://xkcd.com/393/ -- Aahz ([EMAIL PROTECTED]) <*> http:/

Re: Regarding coding style

2008-03-07 Thread Simon Brunning
On Fri, Mar 7, 2008 at 4:31 PM, K Viltersten <[EMAIL PROTECTED]> wrote: > > 1. When writing English, Strunk and > White apply. I apply Fowler, PEP 8 be damned. ;-) -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python

Re: Regarding coding style

2008-03-07 Thread Richard Brodie
"K Viltersten" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 1. When writing English, Strunk and White apply. Do they? I've never seen them ;) > 2. You should use two spaces after a sentence-ending period. > > For heavens sake, why? Most people find it easier to type two space

Re: Regarding coding style

2008-03-07 Thread D'Arcy J.M. Cain
On Fri, 7 Mar 2008 17:31:35 +0100 "K Viltersten" <[EMAIL PROTECTED]> wrote: > I've been recommended reading of: > http://www.python.org/dev/peps/pep-0008/ > and in there i saw two things that i > need to get elaborated. > > > 1. When writing English, Strunk and > White apply. > > Where can i d

Re: Regarding coding style

2008-03-07 Thread D'Arcy J.M. Cain
On Fri, 7 Mar 2008 16:44:10 + "Simon Brunning" <[EMAIL PROTECTED]> wrote: > On Fri, Mar 7, 2008 at 4:31 PM, K Viltersten <[EMAIL PROTECTED]> wrote: > > > > 1. When writing English, Strunk and > > White apply. > > I apply Fowler, PEP 8 be damned. ;-) Fowler's is good too but much more compre

Re: Regarding coding style

2008-03-07 Thread Jeff Schwab
K Viltersten wrote: > I've been recommended reading of: > http://www.python.org/dev/peps/pep-0008/ > and in there i saw two things that i need to get elaborated. > > > 1. When writing English, Strunk and White apply. > > Where can i download it? Am i actually > expected to read the whole book?

Re: Converting a string to the most probable type

2008-03-07 Thread rockingred
Dates can be a pain. I wrote my own date program, simply because there are so many different ways to write a date: Mar 8, 2008 March 8th, 08 03/08/08 03-08-2008 And so on and so forth. The tricky bit is how to tell the difference between Day, Month and Year. I wrote a program to check the form

Re: system32 directory

2008-03-07 Thread Robert Dailey
On Fri, Mar 7, 2008 at 2:49 AM, Tim Golden <[EMAIL PROTECTED]> wrote: > > Ah. Sorry. I'm sure you can call it via ctypes (built in > from Python 2.5). But even if I'd realised that's what > you'd wanted, I'd probably have given the original answer > because pywin32 pretty much *is* standard library

Re: Regarding coding style

2008-03-07 Thread Jon Ribbens
On 2008-03-07, D'Arcy J.M. Cain <[EMAIL PROTECTED]> wrote: >> 2. You should use two spaces after a sentence-ending period. >> >> For heavens sake, why? I've always been obstructed by the double >> blanks but tolerated them. Now, that i read that it actually is a >> recommendation, i need to ask ab

SV: Regarding coding style

2008-03-07 Thread K Viltersten
>> 2. You should use two spaces after a >> sentence-ending period. >> >> For heavens sake, why? I've always been >> obstructed by the double blanks but >> tolerated them. Now, that i read that >> it actually is a recommendation, i need >> to ask about the purpose. > > (a) It makes the ends of

Re: Regarding coding style

2008-03-07 Thread Grant Edwards
On 2008-03-07, Jon Ribbens <[EMAIL PROTECTED]> wrote: > Personally, I dislike double spaces after sentences, but it is > not wrong to put them there any more than it is wrong not to > put them there. You're lucky my high school typing teacher didn't hear you say that... -- Grant Edwards

Re: While executing the class definition which object is referenced by the first argument of the class method, Y r Object attributes not allowed as default arguments

2008-03-07 Thread Krishna
On Mar 6, 5:04 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 06 Mar 2008 22:48:42 -0200, Krishna <[EMAIL PROTECTED]> > escribi�: > > > > class Test(object): > > ... def __init__(self): > > ... self.a= 2 > > ... def func(self, k = self.a): > > ...

SV: Regarding coding style

2008-03-07 Thread K Viltersten
>> Personally, I dislike double spaces after >> sentences, but it is not wrong to put them >> there any more than it is wrong not to put >> them there. > > You're lucky my high school typing teacher > didn't hear you say that... I'm unclear if your teacher was a double or single spacer. It's

Re: Regarding coding style

2008-03-07 Thread D'Arcy J.M. Cain
On 7 Mar 2008 17:40:08 GMT Jon Ribbens <[EMAIL PROTECTED]> wrote: > Well, no, it's to follow a particular person's choice out of the many > and various competing rules of "correct English usage". Personally, > I dislike double spaces after sentences, but it is not wrong to put > them there any more

Re: Regarding coding style

2008-03-07 Thread Jeroen Ruigrok van der Werven
-On [20080307 19:10], D'Arcy J.M. Cain ([EMAIL PROTECTED]) wrote: >The arguments for one over the other fall into these basic ones. Use >double spaces to make the document easier to read, especially by people >who read a lot and tend to skim to absorb as much information as >poss

Re: SV: Regarding coding style

2008-03-07 Thread Grant Edwards
On 2008-03-07, K Viltersten <[EMAIL PROTECTED]> wrote: >>> Personally, I dislike double spaces after sentences, but it is >>> not wrong to put them there any more than it is wrong not to >>> put them there. >> >> You're lucky my high school typing teacher didn't hear you say >> that... > > I'm un

Can't get items out of a set?

2008-03-07 Thread Cruxic
Hello, all. Is it possible to get an object out of a set() given another object that has the same hash code and equality (__hash__() and __eq__() return the same)? You can't do this with Java Sets either and I've needed it on multiple occasions. Doesn't it seem like it would be useful? Consider

Re: islice ==> [::]

2008-03-07 Thread Raymond Hettinger
[bearophileH] > I find itertools.islice() useful, so for Python 3.x I may like to see > it removed from the itertools module, and the normal slicing syntax > [::] extended to work with generators/iterators too. This is a can of worms. First, remember iterations is a protocol, not a type. So, thi

Re: While executing the class definition which object is referenced by the first argument of the class method, Y r Object attributes not allowed as default arguments

2008-03-07 Thread castironpi
On Mar 7, 11:49 am, Krishna <[EMAIL PROTECTED]> wrote: > On Mar 6, 5:04 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > > > > > > En Thu, 06 Mar 2008 22:48:42 -0200, Krishna <[EMAIL PROTECTED]> > > escribi�: > > > class Test(object): > > > ...     def __init__(self): > > > ...          

Re: Can't get items out of a set?

2008-03-07 Thread Raymond Hettinger
[Cruxic] > Is it possible to get an object out of a set() given another object > that has the same hash code and equality (__hash__() and __eq__() > return the same)? Yes, but it requires an indirect approach. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/499299 Raymond -- http://mail

Re: islice ==> [::]

2008-03-07 Thread castironpi
> > I find itertools.islice() useful, so for Python 3.x I may like to see > general iterables.  Third, the analogy breaks down quickly (i.e. > chain(it[:2], it[2:]) does not give the same result as iter(it) unless > >>> s = 'abcdefg' > >>> list(W(s)[2:]) Slice literals are a logical next step, pr

Re: Difference between 'function' and 'method'

2008-03-07 Thread castironpi
On Mar 7, 6:44 am, Sion Arrowsmith <[EMAIL PROTECTED]> wrote: > Gabriel Genellina <[EMAIL PROTECTED]> wrote: > >En Thu, 06 Mar 2008 23:46:43 -0200, <[EMAIL PROTECTED]> escribi�: > >> [ ... ] > >You may look at the SimpleXMLRPCServer class and see how it implements   > >introspection. It's rather

Re: Converting a string to the most probable type

2008-03-07 Thread castironpi
> And so on and so forth.  The tricky bit is how to tell the difference > between Day, Month and Year. There isn't one. -- http://mail.python.org/mailman/listinfo/python-list

Re: islice ==> [::]

2008-03-07 Thread Raymond Hettinger
[castiro] > Slice literals are a logical next step, precedented by raw strings and > bytes. slice= islice is too, precedented by range= xrange. Looking closely at the [::] notation, I think it can easily be confused with an open box of fleas. IMO, the one unequivocal, explicit way of checking fo

Re: Timed execution in eval

2008-03-07 Thread castironpi
On Mar 7, 10:12 am, [EMAIL PROTECTED] wrote: > I have various bits of code I want to interpret and run at runtime in > eval ... > > I want to be able to detect if they fail with error, I want to be able > to time them, and I want to be able to stop them if they run too > long.  I cannot add code to

I cannot evaluate this statement...

2008-03-07 Thread waltbrad
The script comes from Mark Lutz's Programming Python. It is the second line of a script that will launch a python program on any platform. import os, sys pyfile = (sys.platform[:3] == 'win' and 'python.exe') or 'python' Okay, run on a win32 machine, pyfile evaluates to python.exe That makes sen

Re: I cannot evaluate this statement...

2008-03-07 Thread Jerry Hill
On Fri, Mar 7, 2008 at 3:38 PM, waltbrad <[EMAIL PROTECTED]> wrote: > Now. Run this on linux. The first condition evaluates sys.platform[:3] > == 'win' as false. So, the next comparison should be 'False' or > 'python' -- This is because 'and' returns the first false value. > But, again, on l

Want - but cannot get - a nested class to inherit from outer class

2008-03-07 Thread DBak
I want - but cannot get - a nested class to inherit from an outer class. (I searched the newsgroup and the web for this, couldn't find anything - if I missed an answer to this please let me know!) I would like to build a class for a data structure such that nodes of the data structure - of intere

Re: I cannot evaluate this statement...

2008-03-07 Thread Tim Chase
> import os, sys > pyfile = (sys.platform[:3] == 'win' and 'python.exe') or 'python' > > Okay, run on a win32 machine, pyfile evaluates to python.exe [snip] > Now. Run this on linux. The first condition evaluates sys.platform[:3] > == 'win' as false. [snip] > Where am I going wrong. And when will

Re: I cannot evaluate this statement...

2008-03-07 Thread Chris Mellon
On Fri, Mar 7, 2008 at 2:38 PM, waltbrad <[EMAIL PROTECTED]> wrote: > The script comes from Mark Lutz's Programming Python. It is the > second line of a script that will launch a python program on any > platform. > > import os, sys > pyfile = (sys.platform[:3] == 'win' and 'python.exe') or 'py

Re: looking for a light weighted library/tool to write simple GUI above the text based application

2008-03-07 Thread petr . jakes . tpc
Finaly, after few experiments, I am using pygame. It comunicates directly with the framebuffer and the performance is excellent. Thanks for your help. Petr Jakes -- http://mail.python.org/mailman/listinfo/python-list

Re: Want - but cannot get - a nested class to inherit from outer class

2008-03-07 Thread DBak
Sorry - code for the class should read: class Tree(object): ...class _MT(Tree): ..def isEmpty(self): return True ..def insert(self, X): return Tree._Node(X) ...class _Node(Tree): ..def isEmpty(self): return False ..def insert(self, X): return _Node(X, self, Tree._MT()) ...def __ini

Re: Want - but cannot get - a nested class to inherit from outer class

2008-03-07 Thread Jeff
Use metaclasses? DBak wrote: > I want - but cannot get - a nested class to inherit from an outer > class. (I searched the newsgroup and the web for this, couldn't find > anything - if I missed an answer to this please let me know!) > > I would like to build a class for a data structure such that

Re: Timed execution in eval

2008-03-07 Thread castironpi
On Mar 7, 10:12 am, [EMAIL PROTECTED] wrote: > I have various bits of code I want to interpret and run at runtime in > eval ... import sys from time import clock, sleep from threading import Timer TimeoutError= type('TimeoutError',(Exception,),{}) class Elapse: def __init__( self ): s

Re: Regarding coding style

2008-03-07 Thread Steven D'Aprano
On Fri, 07 Mar 2008 11:58:38 -0500, D'Arcy J.M. Cain wrote: >> 2. You should use two spaces after a >> sentence-ending period. >> >> For heavens sake, why? I've always been obstructed by the double blanks >> but >> tolerated them. Now, that i read that it actually is a recommendation, >> i need t

Re: Want - but cannot get - a nested class to inherit from outer class

2008-03-07 Thread Chris Mellon
On Fri, Mar 7, 2008 at 3:00 PM, DBak <[EMAIL PROTECTED]> wrote: > I want - but cannot get - a nested class to inherit from an outer > class. (I searched the newsgroup and the web for this, couldn't find > anything - if I missed an answer to this please let me know!) > > I would like to build a

Re: Regarding coding style

2008-03-07 Thread Grant Edwards
On 2008-03-07, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > Professional typesetters, using proportional fonts, don't use double- > spaces because it throws off word spacing and line justification and just > plain looks ugly. They do, however, put more space between sentences than they do betwee

Re: I cannot evaluate this statement...

2008-03-07 Thread Steven D'Aprano
On Fri, 07 Mar 2008 12:38:11 -0800, waltbrad wrote: > The script comes from Mark Lutz's Programming Python. It is the second > line of a script that will launch a python program on any platform. > > import os, sys > pyfile = (sys.platform[:3] == 'win' and 'python.exe') or 'python' > > Okay, run

Re: I cannot evaluate this statement...

2008-03-07 Thread John Machin
On Mar 8, 7:38 am, waltbrad <[EMAIL PROTECTED]> wrote: > The script comes from Mark Lutz's Programming Python. It is the > second line of a script that will launch a python program on any > platform. > > import os, sys > pyfile = (sys.platform[:3] == 'win' and 'python.exe') or 'python' > > Okay, r

Time Zone application after strptime?

2008-03-07 Thread Jim Carroll
It's taken me a couple of hours to give up on strptime with %Z for recognizing time zones... but that still leaves me in the wrong zone: def paypal_to_mysql_date(ppDate): # a typical paypal date is 10:29:52 Feb 29, 2008 PST date_parts = ppDate.split() withouttz = " ".join(date_parts[:-

Re: Regarding coding style

2008-03-07 Thread Aahz
In article <[EMAIL PROTECTED]>, Grant Edwards <[EMAIL PROTECTED]> wrote: > >My thumb has been putting two spaces after a period for 30 >years, so the chances that it's going to change are rather >slim. :) +1 QOTW -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "All

Re: I cannot evaluate this statement...

2008-03-07 Thread Michael Wieher
The parentheses are there for a reason 2008/3/7, Steven D'Aprano <[EMAIL PROTECTED]>: > > On Fri, 07 Mar 2008 12:38:11 -0800, waltbrad wrote: > > > The script comes from Mark Lutz's Programming Python. It is the second > > line of a script that will launch a python program on any platform. > > >

Location and size of a frame

2008-03-07 Thread K Viltersten
I'm disliking the size of my frame and also i'm disappointed regarding it's location. So, i wish to change them. At this link http://infohost.nmt.edu/tcc/help/pubs/tkinter/frame.html the frame object is discussed but as far i can tell, there are only suggestions regarding what to put in the cons

Re: Better grammar.txt

2008-03-07 Thread MartinRinehart
Jeroen Ruigrok van der Werven wrote: > >http://www.martinrinehart.com/articles/python-grammar.html: > >Unknown host www.martinrinehart.com > > Works for me. Very interesting. The link I posted works for me, while the links quoted are 404 errors, though they look identical. This really is a super

Re: While executing the class definition which object is referenced by the first argument of the class method, Y r Object attributes not allowed as default arguments

2008-03-07 Thread Steven D'Aprano
On Fri, 07 Mar 2008 09:49:58 -0800, Krishna wrote: > I am more interested in knowing about the first argument ('self'), what > does it hold to allow the evaluation of the method, take the example you > gave, 'self.a' as Rvalue inside the method, how and why is this allowed, "self" is treated as a

distutils - Is is possible to install without the .py extensions

2008-03-07 Thread Jari Aalto
Given following setup.py stanza: #!/usr/bin/python from distutils.core import setup import glob setup(name='program', description='', keywords='', version='', url='', download_url='', license='', author='',

Re: Better grammar.txt

2008-03-07 Thread Steven D'Aprano
On Fri, 07 Mar 2008 13:42:56 -0800, MartinRinehart wrote: > Jeroen Ruigrok van der Werven wrote: >> >http://www.martinrinehart.com/articles/python-grammar.html: Unknown >> >host www.martinrinehart.com >> >> Works for me. > > Very interesting. The link I posted works for me, while the links quoted

Re: Timed execution in eval

2008-03-07 Thread Steven D'Aprano
On Fri, 07 Mar 2008 08:12:38 -0800, alex.pedwysocki wrote: > I have various bits of code I want to interpret and run at runtime in > eval ... I hope that code doesn't contain any data coming from an untrusted user. > I want to be able to detect if they fail with error, That's what try...except

Intelligent Date & Time parsing

2008-03-07 Thread shakefu
I'm new to python and I was wondering if there are any intelligent date/time parsing modules out there. I've looked at strptime (or whichever it is) and mxDateTime from the eGenix package. I need something to parse user input for a django app, and it's awesome to be able to write "last monday", "a

Re: Intelligent Date & Time parsing

2008-03-07 Thread Mike Driscoll
On Mar 7, 4:08 pm, [EMAIL PROTECTED] wrote: > I'm new to python and I was wondering if there are any intelligent > date/time parsing modules out there. I've looked at strptime (or > whichever it is) and mxDateTime from the eGenix package. I need > something to parse user input for a django app, and

  1   2   >