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: 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: 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: 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: 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

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

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

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+

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: 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: 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: 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 > >

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 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: 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: 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: 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

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: 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

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: 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

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',

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: 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

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

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: 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

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

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: 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

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 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: 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: 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: 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: 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: 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: 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: 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: 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.

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

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 (

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

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: 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: 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: 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: 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? > > . > >

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 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

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: 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: 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: 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: 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: 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: 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

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: 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' >>

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 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: 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: 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"

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: 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

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

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: 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,

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: 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: 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: 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: 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: 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

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

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

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

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? > . > . >

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

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

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

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: 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: 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

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: 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

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
rzimerman ha scritto: > I'm hoping to write a program that will read any number of urls from > stdin (1 per line), download them, and process them. So far my script > (below) works well for small numbers of urls. However, it does not > scale to more than 200 urls or so, because it issues HTTP reque

Re: os.access() problem

2006-07-11 Thread Larry Bates
Phil Schmidt wrote: > I just got a new PC with Windows XP, and I want to run Leo on it. Leo > uses the os.access() function to check for read-only files. For some > reason, os.access(, os.W_OK) always returns false. > > I wrote a 2-liner Python script to just test os.access on any file. > I have t

Re: Identifying apparently unused globals

2006-07-11 Thread skip
Simon> I haven't used it myself, but pychecker Simon> (http://pychecker.sourceforge.net/) is supposed to be able to Simon> perform such stunts. From the page: "Types of problems that can Simon> be found include: Unused globals and locals (module or variable)" Thanks. I've used b

Re: What is a type error?

2006-07-11 Thread Chris Smith
Marshall <[EMAIL PROTECTED]> wrote: > Chris Smith wrote: > > Going back to my > > handy copy of Pierce's book again, he claims that range checking is a > > solved problem in theory, and the only remaining work is in how to > > integrate it into a program without prohibitive amounts of type > > anno

Re: What is a type error?

2006-07-11 Thread George Neuner
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 annotations, and understanding

Re: Restricted Access

2006-07-11 Thread Paul Rubin
"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 implementations. And we hear about

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Carl J. Van Arsdall
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 everything generally is a bad idea. In this case, > my

Re: Restricted Access

2006-07-11 Thread iapain
> The most knowledgeable people have effectively given up, in > regard to Python. I guess now I am up with only one option, i.e hope that user input code wont be evil to the system. **which is rarely possible** -- http://mail.python.org/mailman/listinfo/python-list

Re: Identifying apparently unused globals

2006-07-11 Thread Simon Forman
[EMAIL PROTECTED] wrote: > At work we have a fairly large application (about 20 packages, 300+ modules) > that looks like we might be heading into a bit of a plateau stage. Now > seems like a good time to identify and delete old, unused code that's flown > under the radar screen for awhile simply

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Ant
Sybren wrote: > Try to make a habit out of catching only the exceptions you know will > be thrown. Yes - you are right of course - this was just a minimal example of course to illustrate the sort of thing I'm using function attriutes for. Fredrik Lundh wrote: > Peter Otten wrote: > > assertion =

win32 and System Font Size

2006-07-11 Thread Fuzzyman
Hello all, I'm writing a windows application with a Tkinter GUI. Tkinter ignores the Windows user setting for system default font size - which can be 'normal', 'large' or 'extra large'. Does anyone know how to retrieve this information from the win32api, or using win32com ? All the best, Fuzz

Re: Restricted Access

2006-07-11 Thread K.S.Sreeram
Steven D'Aprano wrote: > Creating a restricted execution environment is *hard*. As far as I know, > even Microsoft has never attempted it. And for all of Sun's resources and > talent, security holes are sometimes found even in Java. Java is not the only restricted execution environment around. Jav

  1   2   >