Re: Abuse of the object-nature of functions?

2006-07-11 Thread Bruno Desthuilliers
Carl J. Van Arsdall wrote: > Sybren Stuvel wrote: > >> Ant enlightened us with: >> >> >>> try: >>> assertion = callable.is_assertion >>> except: >>> pass >>> >> >> >> Try to make a habit out of catching only the exceptions you know will >> be thrown. Catching everyth

Re: Making HTTP requests using Twisted

2006-07-11 Thread Manlio Perillo
Manlio Perillo ha scritto: > [...] > Here is a quick example, ABSOLUTELY NOT TESTED: > > class DownloadQueue(object): > SIZE = 50 > > def init(self): > self.requests = [] # queued requests > self.deferreds = [] # waiting requests > > def addRequest(self, url, timeout

help!

2006-07-11 Thread Emily Ecoff
Hi all. I am somewhat new to the python programming language but I'm working on a python script that will call several csh scripts. What commands will I need to do this, if possible? -Emily -- http://mail.python.org/mailman/listinfo/python-list

Re: CPU or MB Serial number

2006-07-11 Thread Bayazee
ThanX for your clear answer ! but what we can do in linux ? - first iranian python community --> www.python.ir -- http://mail.python.org/mailman/listinfo/python-list

Re: Relying on the behaviour of empty container in conditional statements

2006-07-11 Thread Simon Forman
horizon5 wrote: > Hi, > > my collegues and I recently held a coding style review. > All of the code we produced is used in house on a commerical project. > One of the minor issues I raised was the common idiom of specifing: > > > if len(x) > 0: > do_something() > > Instead of using the langua

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Carl J. Van Arsdall
Bruno Desthuilliers wrote: > Carl J. Van Arsdall wrote: > >> Sybren Stuvel wrote: >> >> >>> Ant enlightened us with: >>> >>> >>> try: assertion = callable.is_assertion except: pass >>> Try to make a habit out of ca

Re: pyExcelerator - Can I read and modify an existing Excel-WorkBook?

2006-07-11 Thread Gregory Piñero
No, by it I meant pyExcelerator :-) On 7/11/06, Larry Bates <[EMAIL PROTECTED]> wrote: > If by "it" you mean Excel's COM interface, it most certainly will. > With COM you call all the same functions/methods that Microsoft > calls to open, save, and manipulate the spreadsheet. > > Here are a few li

Is there a limit to os.popen()?

2006-07-11 Thread Carl J. Van Arsdall
I'm not sure the proper way to phrase the question, but let me try. Basically, I'm working with a script where someone wrote: kr = string.strip(os.popen('make kernelrelease').read()) And then searches kr to match a regular expression. This seems to have been working, however lately when this l

packaging programs

2006-07-11 Thread Brian Blais
Hello, What is the preferred way of packaging python programs? I know a bit about py2exe (windows) and freeze (linux), but is there a way to package something if you assume that they have python installed? For example, if you assume that they have Python 2.4, but don't have scipy/numpy/mat

Re: Restricted Access

2006-07-11 Thread Georg Brandl
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > iapain <[EMAIL PROTECTED]> wrote: > . > . > . >>Does that mean there is no way to implement restricted enviorment? > . > . >

python-base rpm

2006-07-11 Thread bruce
hi... in trying to find the FC rpms for python-base, i can only seem to find rpms for mandrake can these rpms be used for FC4? would someone know of source rpms for python-base? thanks -bruce -- http://mail.python.org/mailman/listinfo/python-list

Can't Get A Selection from Tktable...

2006-07-11 Thread jerry . levan
Hi, I have a Tktable object (self.table) and when I click on a row the whole row is selected. If I click of a button to get the row contents then self.table.curselection() fails with a traceback of: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.4//lib

tkinter cursors name&display reference

2006-07-11 Thread jmdeschamps
I made a document on Tkinter cursors (mouse pointers?), pairing the cursor image with its name... Not a great deal of magic here since anyone can program something to see the different cursors on screen rather easily... BUT to have a printable reference can be nice :-) Would this be useful to anyo

Re: inheritance, types, operator overload, head ache

2006-07-11 Thread thorley
> > > Can some one *please* splain me why str(obj) works but not print obj, > > > > May have something to do with escape chars... I tried with: > >def __str__(self): > > return repr(self) Yes, that appears to be correct. Experiments indicated that it's an issue with escaping. > > What

Re: Multi-threaded FTP Question

2006-07-11 Thread Jeremy Jones
[EMAIL PROTECTED] wrote: > I'm trying to use ftp in python in a multi-threaded way on a windows > box - python version 2.4.3. Problem is that it appears that it's only > possible to have five instances/threads at one point in time. Errors > look like: > >File "C:\Python24\lib\ftplib.py", lin

Re: help!

2006-07-11 Thread faulkner
os.popen* os.system subprocess.Popen Emily Ecoff wrote: > Hi all. > > I am somewhat new to the python programming language but I'm working on > a python script that will call several csh scripts. What commands will > I need to do this, if possible? > > -Emily -- http://mail.python.org/mailman

Re: free python hosting !

2006-07-11 Thread Luis M. González
John Salerno wrote: > Luis M. González wrote: > > > I'm curious, why it didn't work? > > I sent them an email recently, asking about mod_python support, and > > they replied afirmatively, and very quickly. They also said that they > > can install other scripts on demand. > > But I never tried them

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Ant
> Is there a way in python to say, "hey, catch everything but these two"? >>> try: ... raise AttributeError ... except Exception, ex: ... if isinstance(ex, AttributeError): ... print "Won't catch it!" ... raise ex ... Won't catch it! Traceback (most recent call last): File "", line

Re: What is a type error?

2006-07-11 Thread David Hopwood
George Neuner wrote: > On Tue, 11 Jul 2006 14:59:46 GMT, David Hopwood > <[EMAIL PROTECTED]> wrote: > >>What matters is that, over the range >>of typical programs written in the language, the value of the increased >>confidence in program correctness outweighs the effort involved in both >>adding

Re: packaging programs

2006-07-11 Thread Diez B. Roggisch
Brian Blais schrieb: > Hello, > > What is the preferred way of packaging python programs? I know a bit > about py2exe (windows) and freeze (linux), but is there a way to package > something if you assume that they have python installed? For example, > if you assume that they have Python 2.4,

Here is the problem, need a fix :)

2006-07-11 Thread jerry . levan
[EMAIL PROTECTED] wrote: > Hi, > I have a Tktable object (self.table) and when I click on a row the > whole row is selected. > > If I click of a button to get the row contents then > > self.table.curselection() fails with a traceback of: > > Traceback (most recent call last): > File > "/Library/

Re: Is there a limit to os.popen()?

2006-07-11 Thread cdecarlo
Hello, I'm not 100% sure on this but to me it looks like there is a problem in your make file. I would look in there first, see where 'cat' is executed, I bet your problem will be around there. Hope this helps, Colin Carl J. Van Arsdall wrote: > I'm not sure the proper way to phrase the questi

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Simon Forman
Carl J. Van Arsdall wrote: > Hrmms, well, here's an interesting situation. So say we wanna catch > most exceptions but we don't necessarily know what they are going to > be. For example, I have a framework that executes modules (python > functions), the framework wraps each function execution in

hash of hashes

2006-07-11 Thread sfo
how do i create a hash of hash similar to perl using dict in python $x{$y}{z}=$z thanks. --RR -- http://mail.python.org/mailman/listinfo/python-list

Re: Relying on the behaviour of empty container in conditional statements

2006-07-11 Thread Roel Schroeven
Simon Forman schreef: > I've been programming in python for years and I've always used this > form > > if not seq: > if seq: > > rather than the other and never had any problems. > > Anyone presenting arguments in favor of the len() form is IMHO, not > "getting it". AFAIK, python is not "smart"

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Simon Forman
Simon Forman wrote: > Carl J. Van Arsdall wrote: > > Hrmms, well, here's an interesting situation. So say we wanna catch > > most exceptions but we don't necessarily know what they are going to > > be. For example, I have a framework that executes modules (python > > functions), the framework wr

Re: hash of hashes

2006-07-11 Thread Ant
sfo wrote: > how do i create a hash of hash similar to perl using dict in python > $x{$y}{z}=$z Haven't done any Perl in a long while (thankfully ;-) ) so I'm not quite sure on your syntax there, but here's how to do it in Python: >>> x = {'y': {'z': 'My value'}} >>> x['y']['z'] 'My value' Much

Re: hash of hashes

2006-07-11 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, sfo wrote: > how do i create a hash of hash similar to perl using dict in python > $x{$y}{z}=$z Just put dictionaries as values into a dictionary. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: hash of hashes

2006-07-11 Thread Tim Chase
> how do i create a hash of hash similar to perl using dict in python > $x{$y}{z}=$z Pretty much the same as in perl, only minus half the crazy abuses of the ASCII character-set. Okay...well, not quite half the abuses in this case... >>> x = {} >>> y = 42 >>> z = 'foonting turlingdromes' >>

compiler.walk() what am I missing?

2006-07-11 Thread skip
Here's a trivial little Python session which attempts to use compiler.walk (mostly unsuccessfully): % python Python 2.4.2 (#1, Feb 23 2006, 12:48:31) [GCC 3.4.1] on sunos5 Type "help", "copyright", "credits" or "license" for more information. >>> import compiler >>> ast = c

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Georg Brandl
Carl J. Van Arsdall wrote: > Hrmms, well, here's an interesting situation. So say we wanna catch > most exceptions but we don't necessarily know what they are going to > be. For example, I have a framework that executes modules (python > functions), the framework wraps each function execution

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Ant
> > try: > > # Do some stuff > > except Exception, err: > > if err not in (DontCatchMe1, DontCatchMe2): > > # Handle err > > > > HTH, > > ~Simon > > Dang! not only did somebody else beat me to it, but my code is wrong > and theirs correct. Ignoring the fact you haven't re-raised

Re: Multi-threaded FTP Question

2006-07-11 Thread dbandler
There are n instances of ftplib.FTP. Funny thing is that I tried to run the code twice, concurrently, in two separate IDLE instances. Each instance had four threads/ftp calls. Again, only five ftp connections were allowed on my computer. The code errored out on the sixth attempt. I wonder if the

Re: Validating Python - need doctype HTML strict

2006-07-11 Thread Circa
Thanks Ben, As you can see it's my first try at Python...or any programming for that matter. I solved the problem of validation by adding three """ quotes after the print command and before the body, as follows: Thanks for clearing that up! --- import time #print HTTP/HTML

Re: inheritance, types, operator overload, head ache

2006-07-11 Thread Georg Brandl
[EMAIL PROTECTED] wrote: >> > > Can some one *please* splain me why str(obj) works but not print obj, >> > >> > May have something to do with escape chars... I tried with: >> >def __str__(self): >> > return repr(self) > > Yes, that appears to be correct. Experiments indicated that it's a

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Georg Brandl
Ant wrote: >> Is there a way in python to say, "hey, catch everything but these two"? > try: > ... raise AttributeError > ... except Exception, ex: > ... if isinstance(ex, AttributeError): > ... print "Won't catch it!" > ... raise ex > ... > > Won't catch it! > Traceback (most re

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Georg Brandl
Ant wrote: >> > try: >> > # Do some stuff >> > except Exception, err: >> > if err not in (DontCatchMe1, DontCatchMe2): >> > # Handle err >> > >> > HTH, >> > ~Simon >> >> Dang! not only did somebody else beat me to it, but my code is wrong >> and theirs correct. > > Ignoring the fa

Re: Restricted Access

2006-07-11 Thread iapain
> Brett Cannon is currently trying to come up with a comprehensive spec > and implementation of a sandboxed Python interpreter, for use in > Mozilla as a JavaScript replacement. (look in the python-dev archives > for more) I'm not sure he is working or not, latest i read was he purposed new restri

import and global namespace

2006-07-11 Thread nate
I'd like a module than I'm importing to be able to use objects in the global namespace into which it's been imported. is there a way to do that? thanks, nate -- http://mail.python.org/mailman/listinfo/python-list

Re: Restricted Access

2006-07-11 Thread gene tani
Georg Brandl wrote: > Cameron Laird wrote: > > In article <[EMAIL PROTECTED]>, > > iapain <[EMAIL PROTECTED]> wrote: > > . > > . > > . > >>Does that mean there is no way to implement restricted enviorment? > > . > >

Re: Restricted Access

2006-07-11 Thread Dave Hansen
On 11 Jul 2006 10:19:22 -0700 in comp.lang.python, Paul Rubin wrote: >"K.S.Sreeram" <[EMAIL PROTECTED]> writes: >> Java is not the only restricted execution environment around. >> Javascript, as implemented by most browsers, is an excellent lightweight >> restricted exec

Re: timeit module for comparing the performance of two scripts

2006-07-11 Thread 3c273
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > $ python -m timeit -s "import pyConfig" "pyConfig.pyConfig()" > $ python -m timeit -s "import pyConparse" "pyConparse.pyConParse()" > > note that timeit runs the benchmarked function multiple times, so you may want > to

Re: tkinter cursors name&display reference

2006-07-11 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: >I made a document on Tkinter cursors (mouse pointers?), pairing the >cursor image with its name... >Not a great deal of magic here since anyone can program something to >see the different cursors on screen rather easily... BUT to have a >

Re: hash of hashes

2006-07-11 Thread sfo
Thanks to all for the feedback. it worked. --RR Tim Chase wrote: > > how do i create a hash of hash similar to perl using dict in python > > $x{$y}{z}=$z > > Pretty much the same as in perl, only minus half the crazy abuses > of the ASCII character-set. > > Okay...well, not quite half the abuses

Re: Relying on the behaviour of empty container in conditional statements

2006-07-11 Thread horizon5
Interesting replies, thank you all. Since the language defines the bahviour, I'm all for using it (when appropriate). > there is no distinction between seq is None on the one hand and seq > being a valid empty sequence on the other hand. > > I feel that that is an import distinction, and it's the

Fix for a Tktable bug....

2006-07-11 Thread jerry . levan
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > I have a Tktable object (self.table) and when I click on a row the > > whole row is selected. > > > > If I click of a button to get the row contents then > > > > self.table.curselection() fails with a traceback of: > > > > Traceback (

More on Tk event_generate and threads

2006-07-11 Thread Dale Huffman
There have been a number of posts about calling gui methods from other threads. Eric Brunel. has reccommended calling the gui's .event_generate method with data passed thru a queue. This worked great for me until trying to write to the gui from multiple threads. There I had problems: random types

Re: free python hosting !

2006-07-11 Thread John Salerno
Luis M. González wrote: > John Salerno wrote: >> Luis M. González wrote: >> >>> I'm curious, why it didn't work? >>> I sent them an email recently, asking about mod_python support, and >>> they replied afirmatively, and very quickly. They also said that they >>> can install other scripts on demand.

Re: Is there a limit to os.popen()?

2006-07-11 Thread Carl J. Van Arsdall
cdecarlo wrote: > Hello, > > I'm not 100% sure on this but to me it looks like there is a problem in > your make file. I would look in there first, see where 'cat' is > executed, I bet your problem will be around there. > > Hope this helps, > > Colin > > Well, running the make on the command li

Re: Is there a limit to os.popen()?

2006-07-11 Thread sreekant
> kr = string.strip(os.popen('make kernelrelease').read()) If make is being executed, I presume that the python script has rw access to the location. How about x=os.system("make kernelrelease > my_report 2>&1 ") kr=open("my_report").read() Just a blind throw. Good luck sree -- http://mail.p

Re: timeit module for comparing the performance of two scripts

2006-07-11 Thread John Machin
On 12/07/2006 1:33 AM, Phoe6 wrote: > Hi, Hi, I'm a little astonished that anyone would worry too much (if at all!) about how long it took to read a config file. Generally, one would concentrate on correctness, and legibility of source code. There's not much point IMHO in timing your pyConfig

Re: timeit module for comparing the performance of two scripts

2006-07-11 Thread John Machin
On 12/07/2006 6:35 AM, 3c273 wrote: > "Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >> $ python -m timeit -s "import pyConfig" "pyConfig.pyConfig()" >> $ python -m timeit -s "import pyConparse" "pyConparse.pyConParse()" >> >> note that timeit runs the benchmarked

Re: threading troubles

2006-07-11 Thread sreekant
Piet van Oostrum wrote: >> sreekant <[EMAIL PROTECTED]> (S) wrote: > >> S> I decided in the end to use fork and all is well. > > But how are you doing the callback then? From your code it looks like the > callback is called after the external command finishes. The callback would > then be cal

Re: free python hosting !

2006-07-11 Thread Luis M. González
John Salerno wrote: > Luis M. González wrote: > > John Salerno wrote: > >> Luis M. González wrote: > >> > >>> I'm curious, why it didn't work? > >>> I sent them an email recently, asking about mod_python support, and > >>> they replied afirmatively, and very quickly. They also said that they > >>>

Re: What is a type error?

2006-07-11 Thread Joachim Durchholz
Marshall schrieb: > Now, I'm not fully up to speed on DBC. The contract specifications, > these are specified statically, but checked dynamically, is that > right? That's how it's done in Eiffel, yes. > In other words, we can consider contracts in light of > inheritance, but the actual verificat

Re: Is there a limit to os.popen()?

2006-07-11 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: >Well, running the make on the command line seems to work just fine, no >errors at all. What about running it as make kernelrelease | cat This way the output goes to a pipe, which is what happens when it's c

Re: timeit module for comparing the performance of two scripts

2006-07-11 Thread 3c273
"John Machin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You appear to know what a switch is. I'm therefore surprised that you > appear not to > know that the convention is that any program that uses > command-line switches should do something informative when run with a -h > sw

Re: Is there a limit to os.popen()?

2006-07-11 Thread Carl J. Van Arsdall
Lawrence D'Oliveiro wrote: > In article <[EMAIL PROTECTED]>, > "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: > > >> Well, running the make on the command line seems to work just fine, no >> errors at all. >> > > What about running it as > > make kernelrelease | cat > > This way the

hash() yields different results for different platforms

2006-07-11 Thread Qiangning Hong
I'm writing a spider. I have millions of urls in a table (mysql) to check if a url has already been fetched. To check fast, I am considering to add a "hash" column in the table, make it a unique key, and use the following sql statement: insert ignore into urls (url, hash) values (newurl, hash_of_

Re: Relying on the behaviour of empty container in conditional statements

2006-07-11 Thread Steven D'Aprano
On Tue, 11 Jul 2006 19:43:57 +, Roel Schroeven wrote: > I know that that is the consensus, and I mostly the form without len(), > but somehow I still feel it is not as explicit. In > > if seq: > > there is no distinction between seq is None on the one hand and seq > being a valid empty seq

Re: Restricted Access

2006-07-11 Thread K.S.Sreeram
Paul Rubin wrote: > "K.S.Sreeram" <[EMAIL PROTECTED]> writes: >> Java is not the only restricted execution environment around. >> Javascript, as implemented by most browsers, is an excellent lightweight >> restricted execution environment, and there are many browsers which have >> good implementati

file.readlines() and IOError exceptions

2006-07-11 Thread Astan Chee
Hi everyone, I currently have a problem with reading one of my files. Normally I'd read files like so: overf = 'C:\\overf' my_overf = open(overf,'r') contents = my_overf.readlines() my_overf.close() now the file Im trying to read has recently had alot of read/writes from other users/threads/etc,

Re: hash() yields different results for different platforms

2006-07-11 Thread Paul Rubin
"Qiangning Hong" <[EMAIL PROTECTED]> writes: > However, when I come to Python's builtin hash() function, I found it > produces different values in my two computers! In a pentium4, > hash('a') -> -468864544; in a amd64, hash('a') -> 12416037344. Does > hash function depend on machine's word length

Re: hash() yields different results for different platforms

2006-07-11 Thread Grant Edwards
On 2006-07-11, Qiangning Hong <[EMAIL PROTECTED]> wrote: > I'm writing a spider. I have millions of urls in a table (mysql) to > check if a url has already been fetched. To check fast, I am > considering to add a "hash" column in the table, make it a unique key, > and use the following sql stateme

uTidylib question..

2006-07-11 Thread bruce
hi... you can do : import tidy s = tidy.parseString(foo) which runs the information in "foo" through tidy, for cleaning. this results in "s" being a "document object" print "s" will display the contents of the object. my question, can the "document object" be turned/translated into a string va

Re: Generating all ordered substrings of a string

2006-07-11 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hi, > I want to generate all non-empty substrings of a string of length >=2. > Also, > each substring is to be paired with 'string - substring' part and vice > versa. > Thus, ['abc'] gives me [['a', 'bc'], ['bc', 'a'], ['ab', 'c'], ['c', > 'ab'], ['b', 'ac'], ['ac',

Re: import and global namespace

2006-07-11 Thread Bruno Desthuilliers
nate a écrit : > I'd like a module than I'm importing to be able to use objects in the > global namespace into which it's been imported. is there a way to do > that? It's a very bad idea. Instead of asking how to implement a bad solution, tell us about the real problem. NB : FWIW, the clean sol

I need some help

2006-07-11 Thread dammix
hello, I'm completely a newbye, I've started studying python since 3 weeks and now I need to write a small program that reads the id3 tags from the mp3 contained inside a cd, and then print them into a simple text file, I hope it's possible to do this, and I hope you can help me too. thanks alot a

Re: help a newbie with a IDE/book combination

2006-07-11 Thread SPE - Stani's Python Editor
[EMAIL PROTECTED] schreef: > Is there a good IDE which would be well documented out there? You could choose for SPE (http://pythonide.stani.be). If you donate as little as $1 (more is of course welcome), you'll receive the SPE manual as a pdf. > PS: I use Debian GNU/Linux on all my computers, a 5

Dr. Dobb's Python-URL! - weekly Python news and links (Jul 12)

2006-07-11 Thread Cameron Laird
QOTW: "Write code, not usenet posts." - Fredrik Lundh "If an embedded return isn't clear, the method probably needs to be refactored with 'extract method' a few times until it is clear." - John Roth The comp.lang.python collective has become quite expert at answering "Which book should

Re: Inheritance error: class Foo has no attribute "bar"

2006-07-11 Thread crystalattice
On Sun, 09 Jul 2006 03:51:56 -1000, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sun, 09 Jul 2006 04:24:01 +, crystalattice wrote: > >> I've finally figured out the basics of OOP; I've created a basic >> character >> creation class for my game and it works reasonably well. Now that I'm

Re: I need some help

2006-07-11 Thread Tim Heaney
"dammix" <[EMAIL PROTECTED]> writes: > > I'm completely a newbye, I've started studying python since 3 weeks and > now I need to write a small program that reads the id3 tags from the > mp3 contained inside a cd, and then print them into a simple text file, > I hope it's possible to do this, and I

Re: Generating all ordered substrings of a string

2006-07-11 Thread girish
Quoting Bruno Desthuilliers <[EMAIL PROTECTED]>: > [EMAIL PROTECTED] a écrit : > > Hi, > > I want to generate all non-empty substrings of a string of length > >=2. > > Also, > > each substring is to be paired with 'string - substring' part and vice > > versa. > > Thus, ['abc'] gives me [['a', 'b

Re: Fix for a Tktable bug....

2006-07-11 Thread jerry . levan
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > > [EMAIL PROTECTED] wrote: > > > Hi, > > > I have a Tktable object (self.table) and when I click on a row the > > > whole row is selected. > > > > > > If I click of a button to get the row contents then > > > > > > self.table.curselection() fai

Re: How to generate all substrings of a string

2006-07-11 Thread girish
Quoting Bruno Desthuilliers <[EMAIL PROTECTED]>: > [EMAIL PROTECTED] a écrit : > > Hi, > > I want to generate all non-empty substrings of a string of length > >=2. > > Also, > > each substring is to be paired with 'string - substring' part and vice > > versa. > > Thus, ['abc'] gives me [['a', 'b

Sets and Membership Tests

2006-07-11 Thread JKPeck
I would like to be able use sets where the set members are objects of a class I wrote. I want the members to be distinguished by some of the object content, but I have not figured out how a set determines whether two (potential) elements are identical. I tried implementing __eq__ and __ne__ and __

Re: How to generate all substrings of a string

2006-07-11 Thread girish
Quoting [EMAIL PROTECTED]: > Quoting Bruno Desthuilliers <[EMAIL PROTECTED]>: > > > [EMAIL PROTECTED] a écrit : > > > Hi, > > > I want to generate all non-empty substrings of a string of length > > >=2. > > > Also, > > > each substring is to be paired with 'string - substring' part and > vice > >

Re: Sets and Membership Tests

2006-07-11 Thread Klaas
JKPeck wrote: > I would like to be able use sets where the set members are objects of a > class I wrote. > I want the members to be distinguished by some of the object content, > but I have not figured out how a set determines whether two (potential) > elements are identical. I tried implementing

Re: What is a type error?

2006-07-11 Thread Marshall
Joachim Durchholz wrote: > Marshall schrieb: > > Now, I'm not fully up to speed on DBC. The contract specifications, > > these are specified statically, but checked dynamically, is that > > right? > > That's how it's done in Eiffel, yes. > > > In other words, we can consider contracts in light of

Re: hash() yields different results for different platforms

2006-07-11 Thread Carl Banks
Grant Edwards wrote: > On 2006-07-11, Qiangning Hong <[EMAIL PROTECTED]> wrote: > > > I'm writing a spider. I have millions of urls in a table (mysql) to > > check if a url has already been fetched. To check fast, I am > > considering to add a "hash" column in the table, make it a unique key, > > a

Re: Need help in xml

2006-07-11 Thread Kirt
Thanx Dennis Lee Bieber for ur suggestion. After following ur suggestion i am getting 3 list after reading and comparing the 2 xml document. +, adds ['/home/moq/buc/2+add.py,200606281354\r \n', '/home/moq/buc/1+add.py,200607031215\r \n'] Modified ['/home/moq/buc/2+

Communicating with xterm

2006-07-11 Thread Roy, Anirban (Anirban)
Hi, I am new to Pythion world. My Objective : I want to open an Xterm and try to send message to that xterm. I dont want to use Expect script. I have written a small program import os import commands import pty import re import tty (master,slave) = pty.openpty() print "master = %d , slave = %d

Object Persistence Using a File System

2006-07-11 Thread Chris Spencer
Before I get too carried away with something that's probably unnecessary, please allow me to throw around some ideas. I've been looking for a method of transparent, scalable, and human-readable object persistence, and I've tried the standard lib's Shelve, Zope's ZODB, Divmod's Axiom, and others

Re: Restricted Access

2006-07-11 Thread iapain
> Do you have an IBM s/370 running VM/CMS? VM was sort of an OS for > running multiple OSs, so it would be the "restricted environment" I'm having currently working on OS/2 and Linux platform, I've designed a web based ide for python and i wish to restrict some commands and user can only ac

Re: uTidylib question..

2006-07-11 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, bruce wrote: > import tidy > s = tidy.parseString(foo) > > which runs the information in "foo" through tidy, for cleaning. this results > in "s" being a "document object" > > print "s" will display the contents of the object. If this means it prints out what you want as

Re: Python-2.5beta1 crash

2006-07-11 Thread Martin v. Löwis
Robin Becker wrote: > First off there may be a bunch of other C extensions involved including > PIL, but I built them all against this beta. What should I do to refine > the error? Do I start with trying to establish which of the tests is > guilty or build from source in debug mode and attempt to f

Re: Restricted Access

2006-07-11 Thread Maric Michaud
Le mercredi 12 juillet 2006 08:17, iapain a écrit : > > I'm having currently working on OS/2 and Linux platform, I've designed > a web based ide for python and i wish to restrict some commands There is a restricted environment in Zope for TTW python scripts and ZPT/DTML . These scripts are run i

Re: hash() yields different results for different platforms

2006-07-11 Thread Qiangning Hong
Grant Edwards wrote: > On 2006-07-11, Qiangning Hong <[EMAIL PROTECTED]> wrote: > > However, when I come to Python's builtin hash() function, I > > found it produces different values in my two computers! In a > > pentium4, hash('a') -> -468864544; in a amd64, hash('a') -> > > 12416037344. Does ha

Re: threading troubles

2006-07-11 Thread Piet van Oostrum
> sreekant <[EMAIL PROTECTED]> (S) wrote: >S> Hi folks >S> What am I doing wrong in the following? I just want to run fluidsynth in >S> the background. >S> # >S> class MyThread(threading.Thread): >S> def __init__(self, cmd, callback): >S> sel

Re: document

2006-07-11 Thread nhnh -cuncon
Please send me an anti-virus version. I can not read your attacked file!python-list@python.org wrote: Please read the document. Want to be your own boss? Learn how on Yahoo! Small Business. -- http://mail.python.org/mailman/listinfo/python-list

Re: Detecting 64bit vs. 32bit Linux

2006-07-11 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, Robin Becker <[EMAIL PROTECTED]> wrote: >Michael Yanowitz wrote: >.. >> >>> I need to detect whether the operating system I am running on (not the >>> Python version) is 64bit or 32bit. One requirement is that I need to >>> include support for non-Intel/AMD

Re: Python for modem App

2006-07-11 Thread Bayazee
Any Idea !!!??? --- First Iranian Python & Programming Community --> www.Python.ir -- http://mail.python.org/mailman/listinfo/python-list

Re: language design question

2006-07-11 Thread Fredrik Lundh
"Bryan" wrote: >> and how do you make sure that everything subclasses this base class ? > > in this hypothetical case, i was assuming len() would be put in object and > every > class subclasses object implicitly or explicitly (ie, new style classes only). > if it was done that way, would len(obj)

How to terminate a main script?

2006-07-11 Thread Helmut Jarausch
Hi, I'm still looking for an elegant and clear means to terminate the main script in Python. Unfortunately, Python doesn't allow a 'return' instruction in the main script. Using sys.exit(0) produces an error message which looks dangerous to an uninitiated user. The same is true for an exception

Re: Accessors in Python (getters and setters)

2006-07-11 Thread Bruno Desthuilliers
ZeD wrote: > Bruno Desthuilliers wrote: > > >>>I decided to change the name of an attribute. Problem is I've used the >>>attribute in several places spanning thousands of lines of code. If I >>>had encapsulated the attribute via an accessor, I wouldn't need to do >>>an unreliable and tedious sear

Re: mod_python fails to load under wamp

2006-07-11 Thread Ant
> I suggest you search the download files on Xampp's sourceforge site and > look for an older version with Apache 2.0.55 . I'm not sure, but I > think xampp version 1.5.1 will be ok I did this just a few days ago, you could be right, but version 1.5.1 had no release notes, and a dodgy release num

Re: How to terminate a main script?

2006-07-11 Thread Fredrik Lundh
Helmut Jarausch wrote: > Using sys.exit(0) produces an error > message which looks dangerous to an > uninitiated user. sys.exit(0) doesn't print anything at all. $ python >>> import sys >>> sys.exit(0) $ however, sys.exit() raises an exception to tell the runtime that it wants to terminate the

Re: mod_python fails to load under wamp

2006-07-11 Thread Ant
> Uh... this may sound silly, but aren't .so files UNIX/Linux/Solaris > "shared object" files... Yes, but apache uses them (or at least the same file extension) for modules on Windows and Linux, so mod_python.so is correct. -- http://mail.python.org/mailman/listinfo/python-list

Re: free python hosting !

2006-07-11 Thread Bruno Desthuilliers
Bayazee wrote: > hi > i want a free hosting for python . Then setting up your own hosting might be a good solution - if you can have a decent internet connection. > www.python.ir --> Persian Python Community ! I'm afraid I won't be able to contribute !-) -- bruno desthuilliers python -c "print

Re: threading troubles

2006-07-11 Thread sreekant
I decided in the end to use fork and all is well. Thanks sree -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >