Re: Condition.wait(0.5) doesn't respect it's timeout

2009-04-18 Thread stephane . bisinger
On Apr 18, 10:24 am, Piet van Oostrum wrote: > > I haven't run it (too much hassle to setup) but I noticed one strange > thing in your code: > > , > | def groupUpdated(self, gView): > |         # Acquire the lock to do modifications > |         self._mod_lock.acquire() > |   > |         if not

Too early implementation

2009-04-18 Thread Filip Gruszczyński
I am not a very disciplined person. Usually I rush to my next assignment and code furiously, hoping that my initial understanding of the stated problem will be just fine. And Python does very little to stop me ;-) If I had to do something in C++, I know I would have to write all those header files,

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread greg
Steven D'Aprano wrote: To paraphrase Charles Fiterman, the human should always win, because the human can use the machine, but the machine can't use the human. Unless the machine is Omnius. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread BJörn Lindqvist
I first started programming basic and i don't think it has hurt me much. I can somewhat sympathise with the op, neither python nor any other mainstream language can still do this: SCREEN 13 PSET 160,100,255 2009/4/17, Leguia, Tony : > Though I don't know why you would want to reference lines nu

Re: Modifying the value of a float-like object

2009-04-18 Thread Eric . Le . Bigot
On Apr 15, 5:33 pm, Arnaud Delobelle wrote: > I still don't think mutable floats are necessary.  Here is an approach > below - I'll let the code speak because I have to do some shopping! Hats off to you, Arnaud! I'm very impressed by the ideas found in your code. :) Your UExpr object is almost

Re: question about xrange performance

2009-04-18 Thread mmanns
On Fri, 17 Apr 2009 23:40:32 -0700 (PDT) bearophileh...@lycos.com wrote: > Paul McGuire: > > >xrange is not really intended for "in" testing,< > > Let's add the semantic of a good and fast "in" to xrange (and to the > range of Python3). It hurts no one, allows for a natural idiom > (especially w

Re: pyqt4 qTableWidget add items help

2009-04-18 Thread Sebastian Wiesner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [...] > I've been trying > > while(len(orders)> i): > ui.tb1_tblOrders.setCurrentCell(i,0,orders[i][1]) > i+=1 > > which to me, says go add in the first column row with the first order, > and it makes sense to me Rea

Re: pyqt4 qTableWidget add items help

2009-04-18 Thread Diez B. Roggisch
ookrin schrieb: I've been searching around the internet for an example of how to add a list of items to the qTableWidget for the last few hours with little success. I have a list orders [[34,940,30,50,67], [50,56,35,30,57]] as my example here I built the qTableWidget in designer, so it already

Re: Is there a programming language that is combination of Python andBasic?

2009-04-18 Thread Aaron Brady
On Apr 18, 4:44 am, "Hendrik van Rooyen" wrote: > "baykus" wrote: > > I guess I did not articulate myself well enough. I was just looking > > for a toy to play around. I never suggested that Python+Basic would be > > better than Python and everyone should use it. Python is Python and > > Basic is

pyqt4 qTableWidget add items help

2009-04-18 Thread ookrin
I've been searching around the internet for an example of how to add a list of items to the qTableWidget for the last few hours with little success. I have a list orders [[34,940,30,50,67], [50,56,35,30,57]] as my example here I built the qTableWidget in designer, so it already has the header col

Re: send() to a generator in a "for" loop with continue(val)??

2009-04-18 Thread Peter Otten
Dale Roberts wrote: > I've started using generators for some "real" work (love them!), and I > need to use send() to send values back into the yield inside the > generator. When I want to use the generator, though, I have to > essentially duplicate the machinery of a "for" loop, because the "for"

Re: Is there a programming language that is combination of Python andBasic?

2009-04-18 Thread Hendrik van Rooyen
"baykus" wrote: > I guess I did not articulate myself well enough. I was just looking > for a toy to play around. I never suggested that Python+Basic would be > better than Python and everyone should use it. Python is Python and > Basic is Basic. I am not comparing them at all. I understand the

Re: Condition.wait(0.5) doesn't respect it's timeout

2009-04-18 Thread Piet van Oostrum
> stephane.bisin...@gmail.com (SB) wrote: >SB> Hi all, >SB> I have a problem with Condition.wait(), it doesn't return after the >SB> given timeout. The thing is that if I try to create a simple program, >SB> it works as expected, but in the actual code, the timeout is not >SB> respected (albei

Re: Play sound at wanted frequency

2009-04-18 Thread Matteo
On 15 Apr, 19:25, Scott David Daniels wrote: > Diez B. Roggisch wrote: > > Matteo schrieb: > >> I need to playback a sound on a linux machine of a pre-determined > >> frequency like, say, 440 Hz. How can I do that with python? I found > >> the ossaudiodev package, but it says that the ossaudiodev.

Re: Question to python C API

2009-04-18 Thread Wolfgang Strobl
Andreas Otto wrote about his attempts to install and run Cython: > 5. and start to build the hello world example > >I changed: print "Hello World" >to: print("Hello World")-> this is V3 AFAIK Cython doesn't support Python 3, yet. See http://trac.cython.org/c

Re: binary file compare...

2009-04-18 Thread Piet van Oostrum
> Adam Olsen (AO) wrote: >AO> The Wayback Machine has 150 billion pages, so 2**37. Google's index >AO> is a bit larger at over a trillion pages, so 2**40. A little closer >AO> than I'd like, but that's still 56294995000 to 1 odds of having >AO> *any* collisions between *any* of the file

Re: Registering Cron using CronTab

2009-04-18 Thread gurcharan . saini
On Apr 18, 5:21 am, Lawrence D'Oliveiro wrote: > In message , Philip > > Semanchuk wrote: > > > On Apr 17, 2009, at 9:51 AM,gurcharan.sa...@gmail.com wrote: > > >> I'm stuck with the issue - if we execute the code from Apache the > >> crontab is not getting updated, while it get updated if we run

Re: script question

2009-04-18 Thread Peter Otten
pyt...@bdurham.com wrote: > Peter, > >> Another eval-free variant: >> >> [x() for x in vars().values() if hasattr(x, "_included")] >> >> If you use getattr(x, "_included", False) instead of hasattr() >> you can "un-include" functions with ... > > YES! That's what I was struggling to do with my

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread Steven D'Aprano
On Fri, 17 Apr 2009 20:45:30 -0700, Mensanator wrote: >> Nevertheless, somebody *has* implemented such functionality in Python. >> Not just GOTO, but also COMEFROM. > > Really? Well, _I_ for one, won't be beating a path to his door. Well you should. It's very clever code, and the way he solved t

Re: Suggestions wanted on Tkinter problem

2009-04-18 Thread Steven D'Aprano
On Thu, 16 Apr 2009 16:18:03 -0700, norseman wrote: > At this point the program runs, but I cannot control gray-out of a > specific Radiobutton. > > If I: > > counter=0 > for mode, text > c[counter] = Radiobuton(specified_frame,.. >

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread Steven D'Aprano
On Fri, 17 Apr 2009 22:26:32 -0700, norseman wrote: > The > average programmer, who takes a moment to think it out, "A moment"? As in, a second or less? > can out optimize > all but the best commercial compilers. The meticulous individual can > usually match or best the best commercials with fe

Re: Question to python C API

2009-04-18 Thread Stefan Behnel
Andreas Otto wrote: > just my first step in Cython > > 1. download Cython-0.11.1 > > 2. read INSTALL.txt > > < > (1) Run the setup.py script in this directory > as follows: > > python setup.py install > > This will install the Pyrex package > into your Pyt

<    1   2