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

2009-04-19 Thread Michele Simionato
On Apr 19, 8:09 am, Michele Simionato wrote: > Coroutines instead could have been implemented as > a library, without requiring any syntax change. Here is a proof of principle, just to make clearer what I have in mind. Suppose you have the following library: $ cat coroutine.py from abc import abs

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

2009-04-19 Thread Hendrik van Rooyen
"Steven D'Aprano" wrote: COMEFROM on the other hand is just the purest evil imaginable. *grin* - I expect you say this because it is a bit like COBOL's alter - you cannot *see* it in place when you read the code, and the effect is only apparent at run time after the distant statement has been

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

2009-04-19 Thread Hendrik van Rooyen
"Aaron Brady" wrote: On Apr 18, 4:44 am, "Hendrik van Rooyen" wrote: >> to untangle some spaghetti code. He did not mention if >> the spaghetti was actually doing it's job, bug free, which >> IMO is the only rational test for the quality of a piece > >I don't use 'rational' in the same way.

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

2009-04-19 Thread Hendrik van Rooyen
"BJörn Lindqvist" wrote: >I can somewhat sympathise with the op, neither python nor any other >mainstream language can still do this: > >SCREEN 13 >PSET 160,100,255 Oh come on! Don't be like that! Tell us what it does, please. - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

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

2009-04-19 Thread Hendrik van Rooyen
Brian Blais wrote: >On Apr 18, 2009, at 5:44 , Hendrik van Rooyen wrote: >>to untangle some spaghetti code. He did not mention if >>the spaghetti was actually doing it's job, bug free, which >>IMO is the only rational test for the quality of a piece >>of code, because it is the reason for its

Re: Can some1 review my code?

2009-04-19 Thread bearophileHUGS
zaheer.ag...: > I am asking free advice,The program is not very complex it is around > 500 lines with most the code being reused, 500 lines is not a small Python program :-) If you don't want to show it, then you can write another program, a smaller one, for the purpose of letting people review it

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

2009-04-19 Thread Hendrik van Rooyen
"Mensanator" wrote: 8< -- description of bugs in spaghetti --- Looks like that design really needed sorting out! >A programmer once said to me "Why should I run it, I know >how it works, I wrote it." Are you serious? In my opinion, anybody who says this is not a programmer

Re: Can some1 review my code?

2009-04-19 Thread liangguanhui
On 4月19日, 下午2时18分, zaheer.ag...@gmail.com wrote: > hi > > I am from java background, I have written some code that actually > works :) > Need to some one to look at it and tell me if there are better ways of > doing same things > > Will some one help? > > Thanks Post first, then someone will revie

Re: Useful MySQL Routines

2009-04-19 Thread Tino Wildenhain
Lawrence D'Oliveiro wrote: I've done a writeup on some of the basic routines I frequently use here . Why is that specific to mysql? Btw, the bulkinserter could be better done by using executemany and select usefull batch sizes. I

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

2009-04-19 Thread Peter Otten
Aahz wrote: > In article > <07ad771b-a6d1-4f08-b16c-07caf7462...@e18g2000yqo.googlegroups.com>, > Michele Simionato wrote: >>On Apr 18, 3:03=A0pm, a...@pythoncraft.com (Aahz) wrote: >>> In article , >>> Peter Otten =A0<__pete...@web.de> wrote: If it were up to me I'd rip out send() imme

Re: Useful MySQL Routines

2009-04-19 Thread Lawrence D'Oliveiro
In message , Tino Wildenhain wrote: > Lawrence D'Oliveiro wrote: >> I've done a writeup on some of the basic routines I frequently use here >> . > > Why is that specific to mysql? Because that's all I've used so far. Though sqlite

can python access OS level features like bash scripting?

2009-04-19 Thread Krishnakant
Hello all, Right now I am a bit confused on a final stage of my project. I need to create an installer and an executable file for my python program for gnu/linux. The install script has to put the package into site-packages folder where all other libraries reside. Then put the executable file in

Re: Can some1 review my code?

2009-04-19 Thread Martin P. Hellwig
zaheer.ag...@gmail.com wrote: hi I am from java background, I have written some code that actually works :) Need to some one to look at it and tell me if there are better ways of doing same things Will some one help? Thanks My crystal ball is a bit cloudy today so forgive me if my suggestion

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

2009-04-19 Thread Brian Blais
On Apr 19, 2009, at 4:35 , Hendrik van Rooyen wrote: Brian Blais wrote: On Apr 18, 2009, at 5:44 , Hendrik van Rooyen wrote: to untangle some spaghetti code. He did not mention if the spaghetti was actually doing it's job, bug free, which IMO is the only rational test for the quality of

Re: pyqt4 qTableWidget add items help

2009-04-19 Thread Sebastian Wiesner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > from PyQt4 import ?? QtGui? QtCore? Those are already loaded other > options are pyqtconfig and uic and those don't sound correct... from PyQt4 import QtGui QtGui.QTableWidgetItem See [1] for an example. [1] http://hg.lunaryorn.de/snippets/fi

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

2009-04-19 Thread Tim Wintle
On Sun, 2009-04-19 at 06:26 +, Steven D'Aprano wrote: > > (btw, how come nobody has mentioned python bytecode? Most flow > control is jumps) > > > I wrote yesterday: > > "GOTO, after all, is just a jump, and we use jumps in Python all the > time: > > raise Exception > break > continue > if.

Re: can python access OS level features like bash scripting?

2009-04-19 Thread News123
Hi, I think you got lost in the wrong thread. Though your subject line is correct your post threads under "Is there a programming language, that . . . " Perhaps you 'replied' to above thread and changed 'just' the subject line. Chances to get an answer might be higher if you repost your question

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

2009-04-19 Thread D'Arcy J.M. Cain
On Sun, 19 Apr 2009 05:08:32 GMT Zaphod wrote: > Friend of mine made a really nice asm development environment for his > home made OS. Too bad he didn't have any marketing skills. Was your friend's name Gary Kildall? :-) -- D'Arcy J.M. Cain | Democracy is three wolves http://www.dru

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

2009-04-19 Thread Aahz
In article , Peter Otten <__pete...@web.de> wrote: >Aahz wrote: >> In article >> <07ad771b-a6d1-4f08-b16c-07caf7462...@e18g2000yqo.googlegroups.com>, >> Michele Simionato wrote: >>>On Apr 18, 3:03=A0pm, a...@pythoncraft.com (Aahz) wrote: In article , Peter Otten =A0<__pete...@web.de> w

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

2009-04-19 Thread Aahz
In article , Peter Otten <__pete...@web.de> wrote: > >Generators at the moment seem to have turned into what in German we call >an "eierlegende Wollmilchsau"*. One more point: there has always been a tension within the Python community between people pushing the bleeding edge and people who prefe

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

2009-04-19 Thread Tim Hoffman
I started my commercial programming in Business Basic, (actually MAI Basic 4, and it's equivalent on primos (can't think of it's name at the moment) then later BBX (Basis) We ran the same code (all development on MAI, and then translated the few differences programatically between MAI and Prime) a

Re: can python access OS level features like bash scripting?

2009-04-19 Thread Krishnakant
sorry, but I was not replying to another thread. My mistake. happy hacking. Krishnakant. -- http://mail.python.org/mailman/listinfo/python-list

Re: Can some1 review my code?

2009-04-19 Thread zaheer . agadi
> When done all this you might feel it is not necessary to review the code > any more, which is then is a good moment to actually request a review :-) > > I'll be happy to have a look at it though you might consider posting it > here, more chance of useful feedback ;-) Great, Thanks a lot I will

Re: wxPython 2.8 for Python 2.6 on Linux

2009-04-19 Thread David Robinow
On Sun, Apr 19, 2009 at 1:58 AM, Kenny x wrote: > Hello, I use Ubuntu 8.10 and the latest version of Python. > > I started programming wxPython on my Windows computer, > > but now I have access to my ubuntu box, and want wxPython for 2.6 > > All the debs in the package manager are for 2.5, not 2.6

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

2009-04-19 Thread Piet van Oostrum
> stephane.bisin...@gmail.com (sb) wrote: >sb> I'll also file a bug report because I am more and more convinced this >sb> is a bug, if anything else at least in the documentation... I looked at it more closely, and I found that the Condition.wait is stuck on obtaining the GIL while the main t

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

2009-04-19 Thread Aaron Brady
On Apr 19, 3:05 am, "Hendrik van Rooyen" wrote: >  "Aaron Brady" wrote: > > On Apr 18, 4:44 am, "Hendrik van Rooyen" wrote: > > >> to untangle some spaghetti code. He did not mention if > >> the spaghetti was actually doing it's job, bug free, which > >> IMO is the only rational test for the qua

Re: Passing all extra commandline arguments to python program, Optparse raises exception

2009-04-19 Thread David Stanek
On Thu, Apr 16, 2009 at 10:05 AM, sapsi wrote: > Hello, > Im using optparse and python 2.6 to parse some options, my commandline > looks like > > prog [options] start|stop extra-args-i-will-pas-on > > The options are --b --c --d > > The extra options are varied are are passed onto another program

Re: can python access OS level features like bash scripting?

2009-04-19 Thread Krishnakant
hi very sorry for that On Sun, 2009-04-19 at 14:50 +0200, News123 wrote: > Hi, > > I think you got lost in the wrong thread. > Though your subject line is correct your post threads under "Is there a > programming language, that . . . " > > Perhaps you 'replied' to above thread and changed 'just

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

2009-04-19 Thread stephane . bisinger
On Apr 18, 8:29 pm, Piet van Oostrum wrote: > 2. Importing in a thread is discouraged. I think it is cleaner to put >    the import sys in the top of the module. Yes I know I shouldn't import inside of threads, but that is something that is going away, it's just for debugging this issue. On Apr

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

2009-04-19 Thread stephane . bisinger
On Apr 19, 2:31 pm, Piet van Oostrum wrote: > It appears that GTK and Python threads are incompatible UNLESS you call > gtk.gdk.threads_init() before gtk.main(). In your case you can do it > after the import gtk in contact_list.py. Then it should work. Ok here's the deal: I'm not ending up in the

wxPython 2.8 for Python 2.6

2009-04-19 Thread Kenny x
I hate building from the source. Especially when wxPython has all these flags and I don't know what they mean. Is there any way? I hate building from the source, and want to use Python 2.6 with wxPython 2.8 -- http://mail.python.org/mailman/listinfo/python-list

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

2009-04-19 Thread stephane . bisinger
On Apr 19, 3:14 pm, stephane.bisin...@gmail.com wrote: > Ok here's the deal: I'm not ending up in the gtk frontend. My code is > for the ncurses frontend, so there is no "import gtk" and "gtk.main()" > that gets executed in that case. But it is definitely around the > gobject thing, I'll try to sea

imaplib and smtplib

2009-04-19 Thread Vistro
I want to download a message from my Gmail inbox with imaplib, then forward (basically resend it) with smtplib. I can log in with both. I just need to know how to download a message with imaplib, and what needs to be converted into what to be able to send it with smtplib. **

Re: Useful MySQL Routines

2009-04-19 Thread Tino Wildenhain
Lawrence D'Oliveiro wrote: In message , Tino Wildenhain wrote: Lawrence D'Oliveiro wrote: I've done a writeup on some of the basic routines I frequently use here . Why is that specific to mysql? Because that's all I've used s

Re: can python access OS level features like bash scripting?

2009-04-19 Thread Chris Jones
On Sun, Apr 19, 2009 at 09:55:08AM EDT, Krishnakant wrote: > hi very sorry for that > > On Sun, 2009-04-19 at 14:50 +0200, News123 wrote: > > Hi, > > > > I think you got lost in the wrong thread. > > Though your subject line is correct your post threads under "Is there a > > programming language

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

2009-04-19 Thread Scott David Daniels
Hendrik van Rooyen wrote: "Mensanator" wrote: 8< -- description of bugs in spaghetti --- Looks like that design really needed sorting out! A programmer once said to me "Why should I run it, I know how it works, I wrote it." Are you serious? In my opinion, anybody who s

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

2009-04-19 Thread Scott David Daniels
Hendrik van Rooyen wrote: In my defense of the goto, I would like to make clear that I do not support its use to produce spaghetti. In general, muddled thinking, coupled with expediency, is what I think are the true precursors of spaghetti code. The goto is an innocent tool that can be used for g

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

2009-04-19 Thread Aahz
In article <6c04c7da-6b54-4a49-803f-aac3126e3...@f19g2000yqh.googlegroups.com>, wrote: >On Apr 18, 8:29=A0pm, Piet van Oostrum wrote: >> >> By the way, I wonder why you need a timeout in your wait. I think the >> notifications should be sufficient to keep the gui updated. > >The reason is simpl

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

2009-04-19 Thread Chris Jones
On Sun, Apr 19, 2009 at 04:35:27AM EDT, Hendrik van Rooyen wrote: > Brian Blais wrote: > > >On Apr 18, 2009, at 5:44 , Hendrik van Rooyen wrote: > >>to untangle some spaghetti code. He did not mention if the > >>spaghetti was actually doing it's job, bug free, which IMO is the > >>only ration

Python interpreter speed

2009-04-19 Thread Ryniek90
Hi. Standard Python interpreter's implementation is written in C language. C code while compilation, is compilled into machine code (the fastest code). Python code is compiled into into byte-code which is also some sort of fast machine code. So why Python interpreter is slower than Java VM? B

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

2009-04-19 Thread MRAB
Chris Jones wrote: On Sun, Apr 19, 2009 at 04:35:27AM EDT, Hendrik van Rooyen wrote: Brian Blais wrote: [snip] In my defense of the goto, I would like to make clear that I do not support its use to produce spaghetti. In general, muddled thinking, coupled with expediency, is what I think a

Re: Python interpreter speed

2009-04-19 Thread Krishnakant
I don't mean to start a flame war, but a productive debate will be wonderful. I have been writing heavy applications in java for a few years untill recent past. My experience is that python is not just fast but also zippy and smooth when it comes to running the applications. Infact I have a coupl

Re: [ANN] pyxser-0.2r --- Python XML Serialization

2009-04-19 Thread Daniel Molina Wegener
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Stefan Behnel on Sunday 19 April 2009 02:25 wrote in comp.lang.python: > Daniel Molina Wegener wrote: >> * Every serilization is made into unicode objects. > > Hmm, does that mean that when I serialise, I get a unicode object back? > What

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

2009-04-19 Thread stephane . bisinger
On Apr 19, 4:50 pm, a...@pythoncraft.com (Aahz) wrote: > The redraw thread should keep track of the last time it did a redraw; > each time it receives an update event, it should check to see whether it > has been more than a specified period of time since the last redraw. That's what I do ;) -- ht

Re: Python interpreter speed

2009-04-19 Thread Pascal Chambon
Hello I'm not expert in low level languages, but I'd say that Python and Java are "compiled" to bytecodes of similar level. The difference lies in the information contained in those bytecodes : java is statically typed, so attribute access and other basic operations are rather quick, allowing

The Python standard library and PEP8

2009-04-19 Thread Emmanuel Surleau
Hi there, Exploring the Python standard library, I was surprised to see that several packages (ConfigParser, logging...) use mixed case for methods all over the place. I assume that they were written back when the Python styling guidelines were not well-defined. Given that it's rather irritati

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

2009-04-19 Thread Mensanator
On Apr 19, 3:51�am, "Hendrik van Rooyen" wrote: > "Mensanator" wrote: > > 8< -- description of bugs in spaghetti --- > > Looks like that design really needed sorting out! Since I was translating to Pascal, I couldn't emulate that code if I wanted to. > > >A programmer once s

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

2009-04-19 Thread Mensanator
On Apr 19, 10:12�am, Scott David Daniels wrote: > Hendrik van Rooyen wrote: > > "Mensanator" wrote: > > > 8< -- description of bugs in spaghetti --- > > > Looks like that design really needed sorting out! > > >> A programmer once said to me "Why should I run it, I know > >> ho

print as a function in 2.5 ?

2009-04-19 Thread Stef Mientki
hello, For several reasons I still use Python version 2.5. I understand that the print-statement will be replaced in Python version 3.0. At the moment I want to extend the print statement with an optional traceback. So I've 2 options: 1- make a new function, like "eprint ()", where "e" stand

Interest in generational GC for Python

2009-04-19 Thread Borked Pseudo Mailed
Hello, Is there any interest in generational garbage collection in Python these days ? Anyone working on it ? Thanks -- http://mail.python.org/mailman/listinfo/python-list

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

2009-04-19 Thread Zaphod
On Sun, 19 Apr 2009 09:09:07 -0400, D'Arcy J.M. Cain wrote: > On Sun, 19 Apr 2009 05:08:32 GMT > Zaphod wrote: >> Friend of mine made a really nice asm development environment for his >> home made OS. Too bad he didn't have any marketing skills. > > Was your friend's name Gary Kildall? :-) Nop

Re: The Python standard library and PEP8

2009-04-19 Thread Pascal Chambon
I agree that there are still some styling inconsistencies in python stdlib, but I'm not advocating a cleaning because I've always found camelCase much prettier than those multi_underscore_methods :p Concerning the length property of strings, isn't the __len__() method sufficient ? I know they'

Re: print as a function in 2.5 ?

2009-04-19 Thread Christian Heimes
Stef Mientki wrote: > Now doesn't seem to be allowed, > nor is there an import from __future__ :-( > > What's the best solution (other than moving to 2.6 or up ? The word 'print' is a reserved word like is, class or def. You can't have a function named 'print' in Python 2.5. You have to call you

Re: The Python standard library and PEP8

2009-04-19 Thread Gabriel Genellina
En Sun, 19 Apr 2009 13:43:10 -0300, Emmanuel Surleau escribió: Exploring the Python standard library, I was surprised to see that several packages (ConfigParser, logging...) use mixed case for methods all over the place. I assume that they were written back when the Python styling guideli

Re: print as a function in 2.5 ?

2009-04-19 Thread Pascal Chambon
Hello, I had found some article on this some months ago, can't remember where exactly... But if you don't want harassments, I'd just advise you to create a function with a properly specific name (like "exprint()"), and to make it mimic closely the signature and behaviour of Py3k's print() fu

Re: The Python standard library and PEP8

2009-04-19 Thread Paul Hankin
On Apr 19, 7:37 pm, "Gabriel Genellina" wrote: > The threading module has such aliases, but there are no plans for mass   > renaming all the stdlib that I know of. You'll have to live with this   > inconsistency. It's been fixed in Python 3.0! -- Paul Hankin -- http://mail.python.org/mailman/lis

Re: can python access OS level features like bash scripting?

2009-04-19 Thread Gabriel Genellina
En Sun, 19 Apr 2009 08:16:15 -0300, Krishnakant escribió: I need to create an installer and an executable file for my python program for gnu/linux. The install script has to put the package into site-packages folder where all other libraries reside. Then put the executable file into /usr/bi

Re: The Python standard library and PEP8

2009-04-19 Thread Gabriel Genellina
En Sun, 19 Apr 2009 14:52:23 -0300, Paul Hankin escribió: On Apr 19, 7:37 pm, "Gabriel Genellina" wrote: The threading module has such aliases, but there are no plans for mass   renaming all the stdlib that I know of. You'll have to live with this   inconsistency. It's been fixed in Pytho

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

2009-04-19 Thread Scott David Daniels
Chris Jones wrote: ... Intellectually, assembler programming is the less demanding since its level of abstraction does not go any further than mapping a few binary numbers to a small set of usually well-chosen mnemonics. Unless it features a powerful macro-language that lets the apprentice cre

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

2009-04-19 Thread Piet van Oostrum
> stephane.bisin...@gmail.com (sb) wrote: >>> By the way, I wonder why you need a timeout in your wait. I think the >>> notifications should be sufficient to keep the gui updated. >sb> The reason is simple: when first downloading the contactss list, I >sb> receive a swarm of *Updated() calls

Re: Interest in generational GC for Python

2009-04-19 Thread Scott David Daniels
Borked Pseudo Mailed wrote: Hello, Is there any interest in generational garbage collection in Python these days ? Anyone working on it ? Thanks Not really all that useful for CPython (you cannot move live objects, without breaking faith with C-coded extensions). PyPy would be where to look

Re: Overriding methods per-object

2009-04-19 Thread Pavel Panchekha
On Apr 18, 9:43 pm, Aaron Brady wrote: > On Apr 17, 9:41 pm, Steven D'Aprano > cybersource.com.au> wrote: > > On Fri, 17 Apr 2009 18:22:49 -0700, Pavel Panchekha wrote: > > > I've got an object which has a method, __nonzero__ The problem is, that > > > method is attached to that object not that c

Re: The Python standard library and PEP8

2009-04-19 Thread Emmanuel Surleau
On Sunday 19 April 2009 19:37:59 Gabriel Genellina wrote: > En Sun, 19 Apr 2009 13:43:10 -0300, Emmanuel Surleau > > escribió: > > Exploring the Python standard library, I was surprised to see that > > several > > packages (ConfigParser, logging...) use mixed case for methods all over > > the > >

Re: [ANN] pyxser-0.2r --- Python XML Serialization

2009-04-19 Thread Stefan Behnel
Daniel Molina Wegener wrote: > Stefan Behnel > on Sunday 19 April 2009 02:25 > wrote in comp.lang.python: > > >> Daniel Molina Wegener wrote: >>> * Every serilization is made into unicode objects. >> Hmm, does that mean that when I serialise, I get a unicode object back? >> What about th

Re: PEP 401

2009-04-19 Thread Stefan Behnel
alessiogiovanni.bar...@gmail.com wrote: > Are 19 days that I read this PEP; it's all true? Yep. Actually, the Cython project was lucky that the FLUFL did not recognise it as an "alternative implementation of Python". That way, we can easily finish up world domination, say, 10-20 years before Pytho

Re: How to create a virtual serial port?

2009-04-19 Thread Nick Craig-Wood
Grant Edwards wrote: > On 2009-04-12, JanC wrote: > > Grant Edwards wrote: > > > >> On 2009-04-10, Stuart Davenport wrote: > >> > >>> I am trying to work out if its possible, to create a virtual serial > >>> port with Python? > >> > >> On Linux: no. > > > > I wonder if there is no way to emulat

How can I get path/name of the softlink to my python script when executing it

2009-04-19 Thread Saravanan Shanmugham (sarvi)
Hi, I am writiing a script say "wabexec" in python I will then have softlinks from other softlinks like ls, waf,hello, etc that are in the same directory and pointing to wabexec. When some executes ./waf or ./hello and wabexec gets invoked because of the softlink, how do I find out fro

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

2009-04-19 Thread stephane . bisinger
On Apr 19, 7:21 pm, Piet van Oostrum wrote: >                 while time.time() - t < 0.5 or not self._modified: >                     print >> sys.stderr, "Going to sleep\n" >                     self._mod_lock.wait(timeout=1) >                     print >> sys.stderr, "Ok time to see if we must

Re: The Python standard library and PEP8

2009-04-19 Thread Christian Heimes
Emmanuel Surleau wrote: > First off, it's pretty commonplace in OO languages. Secondly, given the > number of methods available for the string objects, it is only natural to > assume that dir("a") would show me a len() or length() or size() method. > Having to use a function for such a mundane o

Re: The Python standard library and PEP8

2009-04-19 Thread Gabriel Genellina
En Sun, 19 Apr 2009 15:41:02 -0300, Emmanuel Surleau escribió: On Sunday 19 April 2009 19:37:59 Gabriel Genellina wrote: En Sun, 19 Apr 2009 13:43:10 -0300, Emmanuel Surleau > On an unrelated note, it would be *really* nice to have a length > property on > strings. Even Java has that! Wh

Re: print as a function in 2.5 ?

2009-04-19 Thread Tino Wildenhain
Stef Mientki wrote: hello, For several reasons I still use Python version 2.5. I understand that the print-statement will be replaced in Python version 3.0. At the moment I want to extend the print statement with an optional traceback. So I've 2 options: 1- make a new function, like "eprint

Re: print as a function in 2.5 ?

2009-04-19 Thread Stef Mientki
Tino Wildenhain wrote: Stef Mientki wrote: hello, For several reasons I still use Python version 2.5. I understand that the print-statement will be replaced in Python version 3.0. At the moment I want to extend the print statement with an optional traceback. So I've 2 options: 1- make a ne

Re: The Python standard library and PEP8

2009-04-19 Thread Carl Banks
On Apr 19, 11:41 am, Emmanuel Surleau wrote: > First off, it's pretty commonplace in OO languages. Secondly, given the > number of methods available for the string objects, it is only natural to > assume that dir("a") would show me a len() or length() or size() method. > Having to use a function f

Re: The Python standard library and PEP8

2009-04-19 Thread Aahz
In article , Emmanuel Surleau wrote: >On Sunday 19 April 2009 19:37:59 Gabriel Genellina wrote: >> En Sun, 19 Apr 2009 13:43:10 -0300, Emmanuel Surleau >> escribi=F3: >>> >>> On an unrelated note, it would be *really* nice to have a length >>> property on strings. Even Java has that! >> >> Why

Re: The Python standard library and PEP8

2009-04-19 Thread Emmanuel Surleau
> Perhaps in statically typed languages. Python is dynamic, so a x.length() > requires a method lookup and that's expensive. len(x) on the contrary, can > be optimized on a case by case basis -- it DOESN'T translate to > x.__len__() as some might think. > See > http://www.python.org/doc/faq/general

Re: The Python standard library and PEP8

2009-04-19 Thread Emmanuel Surleau
On Sunday 19 April 2009 21:46:46 Christian Heimes wrote: > Emmanuel Surleau wrote: > > First off, it's pretty commonplace in OO languages. Secondly, given the > > number of methods available for the string objects, it is only natural to > > assume that dir("a") would show me a len() or length() or

Re: The Python standard library and PEP8

2009-04-19 Thread Emmanuel Surleau
> What makes you think Python is "an OO language"? Python is a dynamic object-oriented programming language that can be used for many kinds of software development. First line on the Python official website. Was this a trick question? > What kind of OO > language allows you to do this: > > def

Re: How can I get path/name of the softlink to my python script when executing it

2009-04-19 Thread Pascal Chambon
Hello I fear that in this case the whole indirection operations on softlink occur only in the shell, and that the final command is only executed as if it were called directly on the real file... Have you tried typing "python ./waf", to see how the resolution occurs in that case ? Regards,

Re: can python access OS level features like bash scripting?

2009-04-19 Thread Krishnakant
On Sun, 2009-04-19 at 14:55 -0300, Gabriel Genellina wrote: > Write a setup.py script using the distutils package: > http://docs.python.org/distutils/index.html > So that can distutil do the work of setting up the database and can it find for itself if psycopg2 and other related libraries are ins

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

2009-04-19 Thread Dale Roberts
On Apr 17, 10:07 pm, Aaron Brady wrote: > You can do it with a wrapping generator.  I'm not sure if it > interferes with your needs.  It calls 'next' the first time, then just > calls 'send' on the parameter with the value you send it. Aaron, Thanks for the hint. I'd made a modified version of m

ANN: Mock 0.5.0 Release

2009-04-19 Thread Fuzzyman
Mock 0.5.0 has just been released. * Mock Homepage http://www.voidspace.org.uk/python/mock/ * Download Mock 0.5.0 release (zip) http://www.voidspace.org.uk/downloads/mock-0.5.0.zip * Mock Documentation as a PDF http://www.voidspace.org.uk/downloads/mock.pdf * Mock entry on PyPI http://pypi.python

RE: How can I get path/name of the softlink to my python script when executing it

2009-04-19 Thread Saravanan Shanmugham (sarvi)
Sorry. I should have responded earlier to close this thread. It was my programming error. Both sys.argv[0] and __file__ do point to the name and path of the softlink and not the actual program it is linked to. So. Soryy. My bad programming got in my way. Sarvi _

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

2009-04-19 Thread Dale Roberts
On Apr 19, 6:10 am, Peter Otten <__pete...@web.de> wrote: > ... > I only just started reading Beazley's presentation, it looks interesting. > Thanks for the hint! > > Are you currently using coroutines in Python? If so, what kind of practical > problems do they simplify for you? I thought I'd chim

Re: The Python standard library and PEP8

2009-04-19 Thread Martin P. Hellwig
Emmanuel Surleau wrote: What makes you think Python is "an OO language"? Python is a dynamic object-oriented programming language that can be used for many kinds of software development. First line on the Python official website. Was this a trick question? What kind of OO language allows y

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

2009-04-19 Thread Tim Rowe
2009/4/19 Steven D'Aprano : > "GOTO, after all, is just a jump, and we use jumps in Python all the time: > > raise Exception > break > continue > if... elif... else... > for... else... > etc." So as a syllogism: P1: GOTO is a jump; P2: GOTO is bad. C: Jumps are bad. And then by showing the conc

Keyerror addhandler

2009-04-19 Thread Steven Macintyre
Hi all, I'm wondering if anyone can assist me with this as I am very confused about it now. I am getting the following error; Traceback (most recent call last): File "/usr/lib/python2.4/logging/config.py", line 191, in fileConfig logger.addHandler(handlers[hand]) KeyError: 'handler_mylogfi

Re: Keyerror addhandler

2009-04-19 Thread Diez B. Roggisch
Steven Macintyre schrieb: Hi all, I'm wondering if anyone can assist me with this as I am very confused about it now. I am getting the following error; Traceback (most recent call last): File "/usr/lib/python2.4/logging/config.py", line 191, in fileConfig logger.addHandler(handlers[hand]

Re: Useful MySQL Routines

2009-04-19 Thread Lawrence D'Oliveiro
In message , Tino Wildenhain wrote: > Lawrence D'Oliveiro wrote: > >> In message , Tino >> Wildenhain wrote: >> >>> Btw, the bulkinserter could be better done by using executemany >>> and select usefull batch sizes. >> >> Hmm, I've never bothered with executemany. The code as written copes >> c

Re: QT , Wxwidgets are not just UI framework ?

2009-04-19 Thread Deep_Feelings
thank you so much -- http://mail.python.org/mailman/listinfo/python-list

Re: The Python standard library and PEP8

2009-04-19 Thread Dan Sommers
On Sun, 19 Apr 2009 18:43:10 +0200, Emmanuel Surleau wrote: > On an unrelated note, it would be *really* nice to have a length > property on strings. Even Java has that! And even in Java, they have sin(x) rather than x.sin(). Dan -- Dan Sommers A death spiral

Re: The Python standard library and PEP8

2009-04-19 Thread Steven D'Aprano
On Sun, 19 Apr 2009 13:46:23 -0700, Aahz wrote: > What makes you think Python is "an OO language"? The fact that everything in Python is an object is a good hint. > What kind of OO language allows you to do this: > > def square(x): > return x*x > > for i in range(10): > print square

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

2009-04-19 Thread Steven D'Aprano
On Sun, 19 Apr 2009 23:23:03 +0100, Tim Rowe wrote: > 2009/4/19 Steven D'Aprano : > >> "GOTO, after all, is just a jump, and we use jumps in Python all the >> time: >> >> raise Exception >> break >> continue >> if... elif... else... >> for... else... >> etc." > > So as a syllogism: > P1: GOTO is

Re: The Python standard library and PEP8

2009-04-19 Thread Aahz
[BTW, please make sure to retain attributions for quotes] In article , Emmanuel Surleau wrote: >Aahz: >> >> What makes you think Python is "an OO language"? > >Python is a dynamic object-oriented programming language that can be used >for many kinds of software development. > >First line on th

Re: Interest in generational GC for Python

2009-04-19 Thread Benjamin Peterson
Borked Pseudo Mailed pseudo.borked.net> writes: > > Hello, > > Is there any interest in generational garbage > collection > in Python these days ? > > Anyone working on it ? The PyPy project has implemented more GC's than you want to think about including a ref counting gc, mark-sweep, and se

Re: Definition of Pythonic?

2009-04-19 Thread Lawrence D'Oliveiro
In message <49e30ac0$0$6828$5fc3...@news.tiscali.it>, Francesco Bochicchio wrote: > Which is pretty sensible, since good engineering is often based more on > choosing the right trade-off rather than choosing the One Right Thing to > do. Yes, but remember that, too, is a tradeoff. Moderation is f

Re: How to create an unclosed dialog in wxPython?

2009-04-19 Thread Mike Driscoll
On Apr 19, 4:36 am, liangguan...@gmail.com wrote: > On 4月18日, 下午9时40分, 书虫 wrote: > > > In wxPython, after I create a wx.Frame, I want to create a modeless > > and unclosed dialog. Here is my step: > > > app = wx.PySimpleApp() > > f = wx.Frame(None, -1, "Test") > > d = wx.Dialog(f, -1, "Test Dialog

Re: wxPython 2.8 for Python 2.6 on Linux

2009-04-19 Thread Mike Driscoll
On Apr 19, 8:30 am, David Robinow wrote: > On Sun, Apr 19, 2009 at 1:58 AM, Kenny x wrote: > > Hello, I use Ubuntu 8.10 and the latest version of Python. > > > I started programming wxPython on my Windows computer, > > > but now I have access to my ubuntu box, and want wxPython for 2.6 > > > All

Re: [ANN] pyxser-0.2r --- Python XML Serialization

2009-04-19 Thread Daniel Molina Wegener
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Stefan Behnel on Sunday 19 April 2009 15:08 wrote in comp.lang.python: > Daniel Molina Wegener wrote: >> Stefan Behnel >> on Sunday 19 April 2009 02:25 >> wrote in comp.lang.python: >> >> >>> Daniel Molina Wegener wrote: * Every se

Re: QT , Wxwidgets are not just UI framework ?

2009-04-19 Thread Old Listener
On Apr 17, 10:20 am, Phil Thompson wrote: > On Fri, 17 Apr 2009 07:04:40 -0700 (PDT), Deep_Feelings > > > > wrote: > > On Apr 17, 1:52 pm, "Diez B. Roggisch" wrote: > >> Deep_Feelings wrote: > >> > qt include many libraries : network , threading,database ..etc while > >> > Wxwidgets seem similar

Re: [ANN] pyxser-0.2r --- Python XML Serialization

2009-04-19 Thread Daniel Molina Wegener
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Stefan Behnel on Sunday 19 April 2009 15:08 wrote in comp.lang.python: > Daniel Molina Wegener wrote: >> Stefan Behnel >> on Sunday 19 April 2009 02:25 >> wrote in comp.lang.python: >> >> >>> Daniel Molina Wegener wrote: * Every se

  1   2   >