Re: Tkinter Checkboxes

2006-02-20 Thread Mikael Olofsson
D wrote: > Ok, I'm sure this is something extremely simple that I'm missing, > but..how do I set a variable in a Tkinter Checkbox? i.e. I have a > variable "test" - if the checkbox is selected, I want to set test=1, > otherwise 0. Thanks! > http://www.pythonware.com/library/tkinter/introduction

Re: Mutable numbers

2006-02-20 Thread Erik Max Francis
Suresh Jeevanandam wrote: > But why not have mutable numbers also in the language. The short answer I'd give is probably that this is so easy to do with a user-defined class that it's never been all that pressing. > In any application most of the operation is numerical. So, i think, we > shoul

Re: Multiplication optimization

2006-02-20 Thread Tim Roberts
"Paul McGuire" <[EMAIL PROTECTED]> wrote: > >Does Python's run-time do any optimization of multiplication >operations, like it does for boolean short-cutting? That is, for a >product a*b, is there any shortcutting of (potentially expensive) >multiplication operations as in: Integer multiplication

Re: Multiple assignment and the expression on the right side

2006-02-20 Thread Suresh Jeevanandam
Alex Martelli wrote: > Suresh Jeevanandam <[EMAIL PROTECTED]> wrote: > >> Dear all, >> I read in "Python in a Nutshell" that when we have multiple assignments >> made on a single line, it is equivalent to have those many simple >> assignments and that the right side is evaluated once for ea

Re: Augmented assignment

2006-02-20 Thread Andrea Griffini
I think it heavily depends on what is "x". If x is bound to a mutable x=x+1 and x+=1 can not only have different speed but indeed can do two very unrelate things (the former probably binding to a new object, the latter probably modifying the same object). For example consider what happens with list

Re: deriving from float or int

2006-02-20 Thread Sybren Stuvel
Russ enlightened us with: > Does it ever make sense to derive a class from a basic type such as > float or int? Suppose, for example, that I want to create a class > for physical scalars with units. That makes sense. > I thought about deriving from float, then adding the units. I played > around

Mutable numbers

2006-02-20 Thread Suresh Jeevanandam
# I am new to python. In python all numbers are immutable. This means there is one object ( a region in the memory ) created every time we do an numeric operation. I hope there should have been some good reasons why it was designed this way. But why not have mutable numbers also in the language

Re: Multiple assignment and the expression on the right side

2006-02-20 Thread Andrea Griffini
While I think that the paragraph is correct still there is IMO indeed the (low) risk of such a misunderstanding. The problem is that "the statement executes" can IMO easily be understood as "the statements execute" (especially if your background includes only languages where there's no multiple ass

Re: Augmented assignment

2006-02-20 Thread bonono
Terry Reedy wrote: > Program performance might be noticeable if 'x' is something like a.b.c.d > that takes some lookup time. But again, I would use the += form for > readability without testing run time. Would x=x + 1 be more readable, regardless of the background(whether being introduced to the

Re: Safe Python Execution

2006-02-20 Thread [EMAIL PROTECTED]
It looks like untrustedinterpreter has at least two major obstacles to executing reasonably complex code: augmented assignment is not supported: a.b = 'foo' is translated into __getattr__(a,b) = 'foo' Second, this is mysterious, but nevertheless... """This form of restricted Python assume

Re: Augmented assignment

2006-02-20 Thread Suresh Jeevanandam
Thanks Alex. I was not aware of mtimeit. regards, Suresh Alex Martelli wrote: > Suresh Jeevanandam <[EMAIL PROTECTED]> wrote: > >> Hi, >> Is there any gain in performance because of augmented assignments. >> >> x += 1 vs x = x+1 >> >> Or are both of them the same. > > Just *MEASURE*

Re: Augmented assignment

2006-02-20 Thread Terry Reedy
"Suresh Jeevanandam" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > Is there any gain in performance because of augmented assignments. > > x += 1 vs x = x+1 > > Or are both of them the same. The main gain is in programmer performance for writing a long name such as number_

deriving from float or int

2006-02-20 Thread Russ
Does it ever make sense to derive a class from a basic type such as float or int? Suppose, for example, that I want to create a class for physical scalars with units. I thought about deriving from float, then adding the units. I played around with it a bit, but it doesn't seem to work very well. Am

Re: Databases and python

2006-02-20 Thread Bryan Olson
Dan Stromberg wrote: > I've been putting a little bit of time into a file indexing engine [...] To solve the O.P.'s first problem, the facility we need is an efficient externally-stored multimap. A multimap is like a map, except that each key is associated with a collection of values, not just a s

Re: Multiple assignment and the expression on the right side

2006-02-20 Thread Alex Martelli
Suresh Jeevanandam <[EMAIL PROTECTED]> wrote: > Dear all, > I read in "Python in a Nutshell" that when we have multiple assignments > made on a single line, it is equivalent to have those many simple > assignments and that the right side is evaluated once for each > assignment. [The wordin

Re: number ranges

2006-02-20 Thread Alex Martelli
Colin J. Williams <[EMAIL PROTECTED]> wrote: ... > >>I am also open to such arguments but it will be tough to convince me > >>that "x to y" should mean something different from what it means in > >>Pascal, BASIC, and English. ... > 1. Why not treat '2 to 5' or '(2 to 5)' as a semi-open interv

Re: Augmented assignment

2006-02-20 Thread Alex Martelli
Suresh Jeevanandam <[EMAIL PROTECTED]> wrote: > Hi, > Is there any gain in performance because of augmented assignments. > > x += 1 vs x = x+1 > > Or are both of them the same. Just *MEASURE*, man! helen:~/apy alex$ python -mtimeit -s'x=0.0' 'x=x+1' 100 loops, best of 3: 0.507

Re: Multiple assignment and the expression on the right side

2006-02-20 Thread Robert Kern
Suresh Jeevanandam wrote: > Dear all, > I read in "Python in a Nutshell" that when we have multiple assignments > made on a single line, it is equivalent to have those many simple > assignments and that the right side is evaluated once for each > assignment. [The wordings are mine. I am no

Augmented assignment

2006-02-20 Thread Suresh Jeevanandam
Hi, Is there any gain in performance because of augmented assignments. x += 1 vs x = x+1 Or are both of them the same. regards, Suresh -- http://mail.python.org/mailman/listinfo/python-list

Multiple assignment and the expression on the right side

2006-02-20 Thread Suresh Jeevanandam
Dear all, I read in "Python in a Nutshell" that when we have multiple assignments made on a single line, it is equivalent to have those many simple assignments and that the right side is evaluated once for each assignment. [The wordings are mine. I am not sure if this is what he intende

Re: Print a PDF transparently

2006-02-20 Thread Roger Upole
This seems to work ok with acrobat 7 (don't know if it will work with earlier versions). The only thing I had to tweak was acrobat's security setting for allowing print via script operations. I didn't try to figure out how to wait until the print was finished. hth Roger impor

Re: Any Tkinker based rich text widget?

2006-02-20 Thread Sullivan WxPyQtKinter
Thank you so much for help. It is my honor to get a reply from a prestigious figure like you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Any Tkinker based rich text widget?

2006-02-20 Thread Sullivan WxPyQtKinter
yes, I have tried Text Widget for quite some time. However, its speed is far from satisfying. When it holds more than 20,000 characters, it starts to response quite slow. When you drag your mouse over some text to select, the selection is usually done after 0.5second or so. My intent to use this w

Re: Building python 2.4.2 on Cygwin

2006-02-20 Thread Stephen Gross
> On Mon, Feb 20, 2006 at 12:24:34PM -0800, mrstephengross wrote: >> Ok, I'm working on building python 2.4.2 on cygwin. I *think* it's >> version 3.0 or 3.1 (is there a quick way to find out what version of >> cygwin is running within a shell?) > > Use "uname -r". What version are you running?

Re: Writing my own typing monitor program for RSI sufferers...

2006-02-20 Thread samslists
So, so close The problem with this implementation is that it doesn't monitor usb keyboards under linux at all as far as I can tellsince no keyboard entry will show up in /proc/interrupts with a usb keyboard. I absolutely need the keyboard monitoring as well. Otherwise, your project would

Zope 3?? How do you start it on Windows?

2006-02-20 Thread kbperry
Call me crazy and stupid, but how do you start zope? I downloaded the thing, installed it, and then nothing. I can find a stupid README.txt that is useful. Can someone help?Please! Thx. -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing my own typing monitor program for RSI sufferers...

2006-02-20 Thread Sam's Lists
Skip... So, so close  The problem with this implementation is that it doesn't monitor usb keyboards under linux at all as far as I can tellsince no keyboard entry will show up in /proc/interrupts with a usb keyboard.  I absolutely need the keyboard monitoring as well. Otherwise, your proj

Re: Changing values of 1st column of a matrix using take(mymatrix, (0, ), axis=1)

2006-02-20 Thread Anthony Liu
Thanks, Tim, that is really cool. I know there must be some convenient way of doing this. --- Tim Hochberg <[EMAIL PROTECTED]> wrote: > Anthony Liu wrote: > > I am talking about the 'take' method of numarray. > > > > See here for more info: > > > > http://stsdas.stsci.edu/numarray/Doc/node33

Re: Writing my own typing monitor program for RSI sufferers...

2006-02-20 Thread skip
>> I want to write a program that will let me know after thirty minutes >> of typing that I need to take a five minute typing break. But when I >> stop typing it's smart enough to pause the 30 minute timer >> automatically. This is under the X-Window System (Linux). Take a look a

RE: Python vs. Lisp -- please explain

2006-02-20 Thread Delaney, Timothy (Tim)
Donn Cave wrote: > for very long. If you give me a Python program, you have 3 choices: > cross your fingers and hope that I have the required Python > interpreter version, slip in a 25Mb Python interpreter install and > hope I won't notice, or come clean and tell me that your program > needs an

Re: Changing values of 1st column of a matrix using take(mymatrix, (0, ), axis=1)

2006-02-20 Thread Tim Hochberg
Anthony Liu wrote: > I am talking about the 'take' method of numarray. > > See here for more info: > > http://stsdas.stsci.edu/numarray/Doc/node33.html > > If I initialize a matrix 'mymatrix' by zeros((3,3), > type="Float64"), I get a 3*3 matrix of all zeros. > > Look: > > from numarray i

Re: In need of a virtual filesystem / archive

2006-02-20 Thread Paul Rubin
"Enigma Curry" <[EMAIL PROTECTED]> writes: > Is there any archive format that can allow Python to modify a file in > the archive *in place*? That is to say if my archive is 2GB large and I > have a small text file in the archive I want to be able to modify that > small text file (or delete it) with

Re: 2.4.2 + Zone Alarm

2006-02-20 Thread DannyB
>Well, good look in court, then...!-) LOL! wow thats funny =). Type-o's can be pretty amusing sometimes. I will definatly try to reproduce the error w/o running ZA. I'll post the bug if it does happen again. Thanks for the help!! Dan -- http://mail.python.org/mailman/listinfo/python-list

Writing my own typing monitor program for RSI sufferers...

2006-02-20 Thread samslists
Hi... I want to write a program that will let me know after thirty minutes of typing that I need to take a five minute typing break. But when I stop typing it's smart enough to pause the 30 minute timer automatically. This is under the X-Window System (Linux). The tricky part is obviously knowin

Re: Python vs. Lisp -- please explain

2006-02-20 Thread Donn Cave
Quoth Steven D'Aprano <[EMAIL PROTECTED]>: ... | Nobody denies that Python code running with no optimization tricks is | (currently) slower than compiled C code. That's a matter of objective | fact. Nobody denies that Python can be easily run in interactive mode. | Nobody denies that *at some level

Re: In need of a virtual filesystem / archive

2006-02-20 Thread bonono
may be store them in sqlite ? On linux, fuse can also be an interesting option, gmailfs is written in python. Enigma Curry wrote: > I need to store a large number of files in an archive. From Python, I > need to be able to create an archive, put files into it, modify files > that are already in i

Re: html parser , unexpected '<' char in declaration

2006-02-20 Thread Jesus Rivero - (Neurogeek)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 hmmm, that's kind of different issue then. I can guess, from the error you pasted earlier, that the problem shown is due to the fact Python is interpreting a "<" as an expression and not as a char. review your code or try to figure out the exact input

In need of a virtual filesystem / archive

2006-02-20 Thread Enigma Curry
I need to store a large number of files in an archive. From Python, I need to be able to create an archive, put files into it, modify files that are already in it, and delete files already in it. The easy solution would be to use a zip file or a tar file. Python has good standard modules for acces

Re: number ranges

2006-02-20 Thread Colin J. Williams
Alex Martelli wrote: > John Zenger <[EMAIL PROTECTED]> wrote: >... > >>>for i in 2 to 5: >>>print i, >>> >>>which would print 2 3 4 5 >> >>This proposed syntax is also easy to understand, maybe more than "..", >>because it uses natural language. The only criticism is that it creates >>a l

Changing values of 1st column of a matrix using take(mymatrix, (0, ), axis=1)

2006-02-20 Thread Anthony Liu
I am talking about the 'take' method of numarray. See here for more info: http://stsdas.stsci.edu/numarray/Doc/node33.html If I initialize a matrix 'mymatrix' by zeros((3,3), type="Float64"), I get a 3*3 matrix of all zeros. Look: >>> from numarray import * >>> mymatrix = zeros((3,3), type="Fl

Re: html parser , unexpected '<' char in declaration

2006-02-20 Thread Sakcee
thanks for the reply well probabbly I should explain more. this is part of an email . after the mta delivers the email, it is stored in a local dir. After that the email is being parsed by the parser inside an web based imap client at display time. I dont think I have the choice of rewriting the

Re: how to break a for loop?

2006-02-20 Thread bonono
Gregory Petrosyan wrote: >I need to remove zeros from > the begining of list, but I can't :-(. I believe the following is almost a direct translation of the above sentence. import itertools as it a=[0,0,0,1,0] a[:]=it.dropwhile(lambda x: x is 0, a) -- http://mail.python.org/mailman/listinfo/py

Re: Activestate python installation

2006-02-20 Thread BartlebyScrivener
Are you installing with an msi file from a logical drive other than C:? If so, that's probably the trouble. Copy the msi file to C:\ and try it from there. rpd -- http://mail.python.org/mailman/listinfo/python-list

Re: how to break a for loop?

2006-02-20 Thread Scott David Daniels
Gregory Petrosyan wrote: > Hello! > It's 1:56 o'clock in St.-Petersburg now, and I am still coding... maybe > that's why I encountered stupid problem: I need to remove zeros from > the begining of list, but I can't :-(. I use > > for i,coef in enumerate(coefs): > if coef == 0:

Re: 2.4.2 + Zone Alarm

2006-02-20 Thread Alex Martelli
DannyB <[EMAIL PROTECTED]> wrote: ... > IIs there a fix? I'm pretty sure that this problem started with 2.3.1 > (i'm suing 2.4.2). Well, good look in court, then...!-) Seriously, looks like we've omitted a SO_REUSEADDR somewhere in the IDLE startup code, so that abrupt termination of an IDLE

Re: Python vs. Lisp -- please explain

2006-02-20 Thread Alexander Schmolck
"Michele Simionato" <[EMAIL PROTECTED]> writes: > Alexander Schmolck wrote: > > As common lisp and scheme demonstrate you can have high level of dynamism > > (and > > in a number of things both are more dynamic than python) and still get very > > good performance (in some cases close to or better

Re: html parser , unexpected '<' char in declaration

2006-02-20 Thread Jesus Rivero - (Neurogeek)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sakcee wrote: > html = > ' \r\n Foo foo , blah blah > ' > > html = """ Foo foo , blah blah """ Try checking your html code. It looks really messy. '

Re: how to break a for loop?

2006-02-20 Thread Jesus Rivero - (Neurogeek)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello Gregory! I would also use lists to implement this. They are more practical and you could take advantage of pop() or remove() methods instead of using the Oh-so-Scary del. You could also use a lambda+map or reduce methods to remove all ze

Re: Python vs. Lisp -- please explain

2006-02-20 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > > > efficient? Is there some *specific* basic reason it's tough? Or is it > > > that this type of problem in general is tough, and Lisp has 40+ years > > > vs Python's ~15 years? > > > > It is by design. > Python is not slow by design. Python is dynam

Re: Python vs. Lisp -- please explain

2006-02-20 Thread Paul Rubin
[EMAIL PROTECTED] writes: > I'm wondering if someone can explain to me please what it is about > Python that is so different from Lisp that it can't be compiled into > something as fast as compiled Lisp? From this above website and > others, I've learned that compiled Lisp can be nearly as fast as

Re: Is inifinite loop not a good practice?

2006-02-20 Thread Felipe Almeida Lessa
Em Seg, 2006-02-20 às 17:01 -0500, Roy Smith escreveu: > In article <[EMAIL PROTECTED]>, > "Terry Reedy" <[EMAIL PROTECTED]> wrote: > > def fact(n): > > res = 1 > > while n != 0: > > res *= n > > n -= 1 > > return res > > > > fact(-1) > > Could be worse. You could have written: >

Re: getting started, .py file

2006-02-20 Thread Ingrid
I found it! I needed to set sys.path ("sys.path.append("c:\\documents and settings\\my documents\\ingrid")") Ingrid -- http://mail.python.org/mailman/listinfo/python-list

2.4.2 + Zone Alarm

2006-02-20 Thread DannyB
I believe this issue is known - I haven't found a way around it. ZoneAlarm seems to be stopping IDLE from running. I get two errors: "Socket Error: Connection refused" and "IDLE's subprocess didn'tt make connection. Either IDLE can't start a subprocess or personal firewall software is blocking

Re: Newbie question: Multiple installations of Python on Windows machines

2006-02-20 Thread Larry Bates
Don Taylor wrote: > I have Python 2.4.2 installed on a Windows XP machine. > > There is an application that I want to use that refuses to install > unless I have Python 2.3.x installed. (The only way that I can install > this is to use it's .exe installer) > > Can I install two versions of Pytho

Re: decorator and function local variable

2006-02-20 Thread Diez B. Roggisch
Grzegorz Smith schrieb: > Hi all. I have got situation that I need make parameter injection into > function and I want that parametet be a local variable of that function. > eg. something like > def decorator(): > > @decorator > def myfun(): >a = 20 > > and in myfun i can use b wariable

Dr. Dobb's Python-URL! - weekly Python news and links (Feb 20)

2006-02-20 Thread Cameron Laird
QOTW: "On the other hand, lousy testing is practically worthless." - Steve D'Aprano "Komodo adds no goo to your code." - Trent Mick A nice if implicit comparison of stylish use of a regular expression vs. an equally stylish procedural approach: which is easier for *you* to maintain

Re: Activestate python installation

2006-02-20 Thread Trent Mick
[Chris Smith wrote] > > "mik3" == mik3 <[EMAIL PROTECTED]> writes: > > mik3> hi this is a question regarding installing Activestate > mik3> python whenever i try to install the latest Activestate > mik3> Python on WinXP SP2, it gives me error saying "The wizard > mik3> was int

Re: Embedding a binary file in a python script

2006-02-20 Thread Florent Manens
Hi, Le 15-02-2006, mrstephengross <[EMAIL PROTECTED]> a écrit : > I want to find a way to embed a tar file *in* my python script, and > then use the tarfile module to extract it. That is, instead of > distributing two files (extractor.py and archive.tar) I want to be able > to distribute *one* fil

Re: editor for Python on Linux

2006-02-20 Thread Chris Smith
> "Sriram" == Sriram Krishnan <[EMAIL PROTECTED]> writes: >> Mladen Adamovic wrote: >> Hi! I wonder which editor or IDE you can recommend me for >> writing Python programs. I tried with jEdit but it isn't >> perfect. >> Check out http://wiki.python.org/moin/PythonEditors

Re: urllib2 auth error

2006-02-20 Thread rtilley
rtilley wrote: > I have the right username and password. I may be using the above code > wrong. Any tips? I had the _wrong_ password... Sorry. -- http://mail.python.org/mailman/listinfo/python-list

urllib2 auth error

2006-02-20 Thread rtilley
I get this error: HTTP Error 401: Authorization Required When I do this: try: handler = urllib2.HTTPBasicAuthHandler() handler.add_password('realm', 'website', 'user', 'pass') opener = urllib2.build_opener(handler) urllib2.install_opener(opener) f = urllib2.urlopen('http

Re: how to break a for loop?

2006-02-20 Thread Petr Jakes
zero_list=[0,0,0,0,0,1,2,3,4] for x in range(len(zero_list)): if zero_list[x]!=0: break nonzero_list=zero_list[x:] print nonzero_list but some more "pythonic" solutions will be posted from other users I guess :) HTH Petr Jakes -- http://mail.python.org/mailman/listinfo/python-list

Tkinter Checkboxes

2006-02-20 Thread D
Ok, I'm sure this is something extremely simple that I'm missing, but..how do I set a variable in a Tkinter Checkbox? i.e. I have a variable "test" - if the checkbox is selected, I want to set test=1, otherwise 0. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs. Lisp -- please explain

2006-02-20 Thread Alexander Schmolck
"Kay Schluehr" <[EMAIL PROTECTED]> writes: > Alexanders hypothesis is completely absurd. You're currently not in the best position to make this claim, since you evidently misunderstood what I wrote (I certainly did not mean to suggest that Guido *deliberately* chose to make python slow; quite th

Re: how to break a for loop?

2006-02-20 Thread Schüle Daniel
Gregory Petrosyan wrote: > Hello! > It's 1:56 o'clock in St.-Petersburg now, and I am still coding... maybe > that's why I encountered stupid problem: I need to remove zeros from > the begining of list, but I can't :-(. I use > > for i,coef in enumerate(coefs): > if coef == 0:

Dr. Dobb's Python-URL! - weekly Python news and links (Feb 20)

2006-02-20 Thread Cameron Laird
QOTW: "On the other hand, lousy testing is practically worthless." - Steve D'Aprano "Komodo adds no goo to your code." - Trent Mick A nice if implicit comparison of stylish use of a regular expression vs. an equally stylish procedural approach: which is easier for *you* to maintain

Re: editor for Python on Linux

2006-02-20 Thread Echo
On 2/20/06, billie <[EMAIL PROTECTED]> wrote: > I really think that IDLE is one of the best around in Python source editing. For me, I find that IDLE is about the worse for editing Python sources. I used to use Notepad++ before I started using Boa. Sometimes I still use Notepad++ because I can eas

decorator and function local variable

2006-02-20 Thread Grzegorz Smith
Hi all. I have got situation that I need make parameter injection into function and I want that parametet be a local variable of that function. eg. something like def decorator(): @decorator def myfun(): a = 20 and in myfun i can use b wariable like that: b = "ok it's working" I try to

html parser , unexpected '<' char in declaration

2006-02-20 Thread Sakcee
html = ' \r\n Foo foo , blah blah ' >>> import htmllib >>> import formatter >>> parser=htmllib.HTMLParser(formatter.NullFormatter()) >>> parser.feed(html) Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.4/sgmllib.py", line 95, in feed self.goahead(0) File

Re: getting started, .py file

2006-02-20 Thread Ingrid
Thanks everyone. That's exactly what I was looking for, but I still can't seem to make it work. I've got the interpreter starting in "C:\Program Files\Python2.4", and my code is in "C:\Documents and Settings\Ingrid\My Documents". So, I did: import os os.chdir("C:\\Documents and Settings\\Ingrid

how to break a for loop?

2006-02-20 Thread Gregory Petrosyan
Hello! It's 1:56 o'clock in St.-Petersburg now, and I am still coding... maybe that's why I encountered stupid problem: I need to remove zeros from the begining of list, but I can't :-(. I use for i,coef in enumerate(coefs): if coef == 0: del coefs[i]

Re: converting sqlite return values

2006-02-20 Thread Jason Drew
Hi, You can use the built-in function "eval" to return how Python evaluates your string. For example: >>> eval( '(1,2,3,4)' ) (1, 2, 3, 4) In other words, eval will take your string that looks like a tuple, and return an actual tuple object. Note that the 'u' prefix in your string will cause an

Re: PyQt and Threading to update a dialog?

2006-02-20 Thread Phil Thompson
On Monday 20 February 2006 10:07 pm, Fabian Steiner wrote: > Hello! > > I have just written a MyDialog class which is derived from the orginial > QDialog class. MyDialog only possesses a QLabel and a QPushButton. Now I > would like to get the QLabel updated every second so that it displays > the cu

Re: Difference between CPython, Python for .NET and IronPython?

2006-02-20 Thread Ian Bicking
Claudio Grondi wrote: > I have asked similar 'question' some weeks ago in the German Python > newsgroup. > It seems, that that Pythonistas have generally not much interest in > IronPython waiting for at least release 2.0 of it which is _perhaps_ > expected to support Mono. My understanding is that

Re: Processing text using python

2006-02-20 Thread Alex Martelli
Xavier Morel <[EMAIL PROTECTED]> wrote: > Fredrik Lundh wrote: > > did you read the string chapter in the tutorial ? > > > > http://docs.python.org/tut/node5.html#SECTION00512 > > > > around the middle of that chapter, there's a section on slicing: > > > > "substrings can be

Re: Processing text using python

2006-02-20 Thread Xavier Morel
Fredrik Lundh wrote: > did you read the string chapter in the tutorial ? > > http://docs.python.org/tut/node5.html#SECTION00512 > > around the middle of that chapter, there's a section on slicing: > > "substrings can be specified with the slice notation: two indices > sep

Re: Python vs. Lisp -- please explain

2006-02-20 Thread Paul Boddie
Torsten Bronger wrote: > > By the way, this is my main concern about optional static typing: It > may change the target group, i.e. it may move Python closer to those > applications where speed really matters, which again would have an > effect on what will be considered Pythonic. Yes, I think tha

Re: Python vs. Lisp -- please explain

2006-02-20 Thread Alexander Schmolck
Torsten Bronger <[EMAIL PROTECTED]> writes: > I was rather stunned, too, when I read his line of thought. > Nevertheless, I think it's not pointless, albeit formulated in an > awkward way. Of course, Python has not been deliberately slowed > down. Indeed -- and I'm really not sure what defect in

Re: editor for Python on Linux

2006-02-20 Thread Mladen Adamovic
Benji York wrote: > I don't know anything about gedit, but why not take Emacs and Vim (not > vi) seriously? I'm not used to their approach. I usually program in Java but recently I reliazed if I'm making Linux shell scripts, Python seems to be good choice to me. So, that Pydev Eclipse plug-in

Re: editor for Python on Linux

2006-02-20 Thread Mladen Adamovic
[EMAIL PROTECTED] wrote: > Actually gedit does have syntax highlighting and works quite well. Uops, it seems that I should give a second chance to it, I haven't noticed its settings. > If you put down emacs so casually you obviously have no experience with > one of the most powerful text editors

Re: share function argument between subsequent calls but not between class instances!

2006-02-20 Thread Steven D'Aprano
On Mon, 20 Feb 2006 08:52:09 +, Duncan Booth wrote: > Ben Finney wrote: > >> Duncan Booth <[EMAIL PROTECTED]> writes: >>> If you intend to only use the default some of the time, and at other >>> times pass in a different list, then save the 'default' in the >>> instance and use a special mark

Re: why does close() fail miserably on popen with exit code -1 ?!

2006-02-20 Thread Terry Reedy
"Atanas Banov" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > my gripe is about exit with MINUS ONE, not +1. see my post again. FWIW, I reproduced the error message for -1 (and the no error for -2, -3) in the Idle Python Shell uder Win XP home. tjr -- http://mail.python.or

PyQt and Threading to update a dialog?

2006-02-20 Thread Fabian Steiner
Hello! I have just written a MyDialog class which is derived from the orginial QDialog class. MyDialog only possesses a QLabel and a QPushButton. Now I would like to get the QLabel updated every second so that it displays the current time. I think I will have to work with Threads in order to ac

Re: Is inifinite loop not a good practice?

2006-02-20 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Alvin A. Delagon" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > I've been hearing comments that infinite loop is a bad programming > > practice. > > What is bad is an *unintended* loop that goobles c

Re: Python vs. Lisp -- please explain

2006-02-20 Thread Steven D'Aprano
On Mon, 20 Feb 2006 16:54:34 +, Donn Cave wrote: > The reason this isn't just an abstruse philosophical argument where it > makes sense for us to obtusely cling to some indefensible point of view, > is that as the man points out, there are differences that we can't hide > forever from potentia

Re: getting started, .py file

2006-02-20 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > I am just getting started with Python, and I think I may be thinking > about it wrong. I'd like to be able to work interactively with some > code that I've got in a file. The only interpreted language I have much > experience with is Tcl/Tk, and in that I would use "sourc

Newbie question: Multiple installations of Python on Windows machines

2006-02-20 Thread Don Taylor
I have Python 2.4.2 installed on a Windows XP machine. There is an application that I want to use that refuses to install unless I have Python 2.3.x installed. (The only way that I can install this is to use it's .exe installer) Can I install two versions of Python on Windows, and if so is the

Re: Quesion about the proper use of __slots__

2006-02-20 Thread Zefria
I am aware of this; but with too much Java still running through my brain I've never bothered with the idea yet because that's simply not the way I learned and I've never had a chance to need new attributes for singular instances. "__slots__ is not a method, so it falls outside that purpose as sta

Re: getting started, .py file

2006-02-20 Thread Sam Pointon
python -i source_file.py will do what you want. -Sam -- http://mail.python.org/mailman/listinfo/python-list

Re: getting started, .py file

2006-02-20 Thread Steve Holden
[EMAIL PROTECTED] wrote: > I am just getting started with Python, and I think I may be thinking > about it wrong. I'd like to be able to work interactively with some > code that I've got in a file. The only interpreted language I have much > experience with is Tcl/Tk, and in that I would use "sourc

Re: Building python 2.4.2 on Cygwin

2006-02-20 Thread Jason Tishler
Steve, On Mon, Feb 20, 2006 at 12:24:34PM -0800, mrstephengross wrote: > Ok, I'm working on building python 2.4.2 on cygwin. I *think* it's > version 3.0 or 3.1 (is there a quick way to find out what version of > cygwin is running within a shell?) Use "uname -r". What version are you running? J

Re: Is inifinite loop not a good practice?

2006-02-20 Thread Terry Reedy
"Alvin A. Delagon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I've been hearing comments that infinite loop is a bad programming > practice. What is bad is an *unintended* loop that goobles cpu time while outputting nothing. Example: def fact(n): res = 1 while n != 0:

Re: Quesion about the proper use of __slots__

2006-02-20 Thread Alex Martelli
Peter Hansen <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > Zefria <[EMAIL PROTECTED]> wrote: > >... > >>this special case I'm expecting each "carrier" to have up to 150 > >>fighters, and 3 to 5 carriers for each of the two teams, which comes > >>out to be quite large. > > > > The prob

Re: Python vs. Lisp -- please explain

2006-02-20 Thread Kay Schluehr
Steven D'Aprano wrote: > On Mon, 20 Feb 2006 05:18:39 -0800, Kay Schluehr wrote: > > >> What's far more interesting to me, however, is that I think there a good > >> reasons to suspect python's slowness is more of a feature than a flaw: I'd > >> not > >> be suprised if on the whole it greatly incr

Re: Python vs. Lisp -- please explain

2006-02-20 Thread Torsten Bronger
Hallöchen! [EMAIL PROTECTED] (Cameron Laird) writes: > In article <[EMAIL PROTECTED]>, I wondered: > >> [...] Do you truly believe that fewer people would use Python if >> its execution were faster? > > I think I can answer my own question: yes. Since posting, I came > across a different follow

getting started, .py file

2006-02-20 Thread nibiery
I am just getting started with Python, and I think I may be thinking about it wrong. I'd like to be able to work interactively with some code that I've got in a file. The only interpreted language I have much experience with is Tcl/Tk, and in that I would use "source file.tcl" in the console to loa

Re: why does close() fail miserably on popen with exit code -1 ?!

2006-02-20 Thread Jeffrey Schwab
Atanas Banov wrote: > i ran onto this weirdness today: seems like close() on popen-ed > (pseudo)file fails miserably with exception instead of returning exit > code, when said exit code is -1. > > here is the simplest example (under Windows): > > print popen('exit 1').close() > > 1 > p

Re: Python solutions for old Police software?

2006-02-20 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > http://www.cityfremontof.com This has nothing to do with Python, nor software. It's totally off-topic spam. Ignore. -- http://mail.python.org/mailman/listinfo/python-list

Re: Processing text using python

2006-02-20 Thread plahey
Hi, you have plenty of good responses. I thought I would add one more: def data_iter(file_name): data = file(file_name) while True: value = data.read(3) if not value: break yield value data.close() With the above, you can grab the entire data set

Re: Quesion about the proper use of __slots__

2006-02-20 Thread Peter Hansen
Alex Martelli wrote: > Zefria <[EMAIL PROTECTED]> wrote: >... >>this special case I'm expecting each "carrier" to have up to 150 >>fighters, and 3 to 5 carriers for each of the two teams, which comes >>out to be quite large. > > The problem with the spread of email is that it reduces the numbe

  1   2   3   >