Distribute 0.6.4 released

2009-10-11 Thread Tarek Ziadé
On behalf of the Distribute team I am happy to announce the release of Distribute 0.6.4. == What is Distribute == Distribute is a fork of the Setuptools project. Distribute is intended to replace Setuptools as the standard method for working with Python module distributions, on the top of

Re: The rap against while True: loops

2009-10-11 Thread Hendrik van Rooyen
On Saturday, 10 October 2009 22:15:21 kj wrote: I'm coaching a group of biologists on basic Python scripting. One of my charges mentioned that he had come across the advice never to use loops beginning with while True. Of course, that's one way to start an infinite loop, but this seems

Why ELIF?

2009-10-11 Thread metal
I wonder the reason for ELIF. it's not aligned with IF, make code ugly IMHO OR maybe better? if foo == bar: ... or foo == baz: ... or foo == bra: ... else: ... -- http://mail.python.org/mailman/listinfo/python-list

Re: code in a module is executed twice (cyclic import problems) ?

2009-10-11 Thread Hendrik van Rooyen
On Sunday, 11 October 2009 02:24:34 Stephen Hansen wrote: It's really better all around for modules to be considered like libraries, that live over There, and aren't normally executed. Then you have scripts over Here which may just be tiny and import a module and call that module's main

Re: Why ELIF?

2009-10-11 Thread Erik Max Francis
metal wrote: I wonder the reason for ELIF. it's not aligned with IF, make code ugly IMHO OR maybe better? if foo == bar: ... or foo == baz: ... or foo == bra: ... else: ... Because that's uglier. `or` means something completely unrelated in expressions.

Re: organizing your scripts, with plenty of re-use

2009-10-11 Thread Steven D'Aprano
On Sat, 10 Oct 2009 13:44:18 -0300, Gabriel Genellina wrote: The frustrating thing, for me, is that all these requirements are met if you leave the scripts in jumbled into a flat directory. I bet that's not true. I bet that they Just Work only if the user cd's into the directory first. In

ANN: yappi 0.1 beta : Yet Another Python Profiler

2009-10-11 Thread Sümer Cip
Hi all, After implementing a game server on which 100k people playing games per-day, it turns out to be that continuous and efficient profiling is key to improve an long-running applications like these. With this idea in mind, I am motivated to write a profiler. I am not a Python expert or even

Re: The rap against while True: loops

2009-10-11 Thread Steven D'Aprano
On Sat, 10 Oct 2009 20:15:21 +, kj wrote: I use while True-loops often, and intend to continue doing this while True, but I'm curious to know: how widespread is the injunction against such loops? Has it reached the status of best practice? Such an injunction probably made more sense back

Re: Why ELIF?

2009-10-11 Thread Steven D'Aprano
On Sat, 10 Oct 2009 23:47:38 -0700, metal wrote: I wonder the reason for ELIF. it's not aligned with IF, make code ugly IMHO OR maybe better? if foo == bar: ... or foo == baz: ... or foo == bra: ... else: ... `or` has another meaning in Python, and many

Re: Script to complete web form fields

2009-10-11 Thread ryles
On Oct 10, 9:39 pm, Feyo dkatkow...@gmail.com wrote: How can I use Python to complete web form fields automatically? My work web-based email time-out is like 15 seconds. Every time I need to access my calendar, address book, or email, I have to type in my username and password. I'm just tired

Re: code in a module is executed twice (cyclic import problems) ?

2009-10-11 Thread ryles
On Oct 10, 7:36 pm, Stef Mientki stef.mien...@gmail.com wrote: hello, I always thought code in a module was only executed once, but doesn't seem to be true. I'm using Python 2.5. And this is the example: == A.py == My_List = [] == B.py == from A import * My_List.append ( 3 ) print

Re: code in a module is executed twice (cyclic import problems) ?

2009-10-11 Thread Stef Mientki
thanks very much Stephen, This is the first time I become aware of the difference between script and module !! Starting with the wrong book Learning Python second edition, from Lutz and Ascher, based on Python 2.3 in combination with using Python only from a high level IDE (PyScripter),

Re: code in a module is executed twice (cyclic import problems) ?

2009-10-11 Thread Dave Angel
(please don't top-post. Put your reply *after* the message you're quoting.) Stef Mientki wrote: div class=moz-text-flowed style=font-family: -moz-fixedthanks very much Stephen, This is the first time I become aware of the difference between script and module !! Starting with the wrong book

Re: python performance on Solaris

2009-10-11 Thread Antoine Pitrou
inaf cem.ezberci at gmail.com writes: My code seem to return lookups from a in memory data structure I build combining bunch of dictionaries and lists 6-8 times faster on a 32 bit Linux box than on a Solaris zone. Well, if your workload is CPU-bound, the issue here is not really Solaris vs.

Re: mxDateTime history (Re: mktime, how to handle dates before 01-01-1970 ?)

2009-10-11 Thread Rhodri James
On Fri, 09 Oct 2009 13:39:43 +0100, Tim Chase python.l...@tim.thechases.com wrote: Month arithmetic is a bit of a mess, since it's not clear how to map e.g. Jan 31 + one month. Jan 31 + one month usually means add one to the month value and then keep backing off the day if you get an

Re: Script to complete web form fields

2009-10-11 Thread Diez B. Roggisch
Feyo schrieb: How can I use Python to complete web form fields automatically? My work web-based email time-out is like 15 seconds. Every time I need to access my calendar, address book, or email, I have to type in my username and password. I'm just tired of it. I found the ClientForm module and

Writing to function arguments during execution

2009-10-11 Thread John O'Hagan
I'm writing a (music-generating) program incorporating a generator function which takes dictionaries as its arguments. I want to be able to change the values of the arguments while the program is running. I have it working as in this toy example (python 2.5): from sys import argv from

Re: except KeyError: print(this was not a key error?)

2009-10-11 Thread gert
On Oct 11, 7:48 am, Michel Alexandre Salim michael.silva...@gmail.com wrote: On Oct 10, 7:59 pm, gert gert.cuyk...@gmail.com wrote: http://code.google.com/p/appwsgi/source/browse/appwsgi/wsgi/order.wsgi I screwed up some sql statement INSERT INTO orders (pid,uid,bid,time) VALUES

interfacing python haskell code with ctypes on linux

2009-10-11 Thread Alia Khouri
Hi Folks, Just in case anyone is interested, I've just added a very simple example for linux showing how to access haskell functions from python code using ctypes. It's on the wiki: http://wiki.python.org/moin/PythonVsHaskell AK -- http://mail.python.org/mailman/listinfo/python-list

Re: strange behaviour when inheriting from tuple

2009-10-11 Thread metal
On 10月11日, 下午5时30分, ryles ryle...@gmail.com wrote: On Oct 11, 3:04 am, metal metal...@gmail.com wrote: Environment: PythonWin 2.5.4 (r254:67916, Apr 27 2009, 15:41:14) [MSC v.1310 32 bit (Intel)] on win32. Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for

Re: Writing to function arguments during execution

2009-10-11 Thread Rhodri James
On Sun, 11 Oct 2009 14:18:25 +0100, John O'Hagan resea...@johnohagan.com wrote: Now I can change the output of the work function while it's running via raw_input(). However it's very crude, not least because the terminal echo of the new options is interspersed with the output of the

Re: The rap against while True: loops

2009-10-11 Thread Grant Edwards
On 2009-10-11, Hendrik van Rooyen hend...@microcorp.co.za wrote: It is often necessary, in long running applications, to set up loops that you would really like to run until the end of time. - the equivalent of a serve forever construct. Then while True is the obvious way to spell it. Once

Re: Why ELIF?

2009-10-11 Thread Grant Edwards
On 2009-10-11, metal metal...@gmail.com wrote: I wonder the reason for ELIF. it's not aligned with IF, make code ugly It most certainly is aligned with IF: if cond1: do this elif cond2: do that else: do the other The if elif and else are all aligned in all of the code

Re: Why ELIF?

2009-10-11 Thread TerryP
On Oct 11, 7:07 am, Erik Max Francis m...@alcyone.com wrote: Because that's uglier.  `or` means something completely unrelated in expressions.  Variations of `else if` in `if ... else if ...` chains is routine in computer languages.  Choosing a deliberately different syntax just for the sake

run exe and create exe

2009-10-11 Thread daved170
Hi everybody, I have 2 questions: 1) I created my python application. It has QT Gui. How can I make exe of it? I don't want everytime I run the file it'll open the command line window which does nothing. 2) My Application suppose to be a client server app. Anyhow, for now It's running only on

Re: Why ELIF?

2009-10-11 Thread Esmail
Steven D'Aprano wrote: By the way, if you're testing a single name against a series of alternatives, it is often better to look up the value in a dictionary: table = {bar: 23, baz: 42, boop: 73, beep: 124} value = table[foo] instead of: if foo == bar: value = 23 elif foo == baz:

Re: Why ELIF?

2009-10-11 Thread MRAB
Grant Edwards wrote: On 2009-10-11, metal metal...@gmail.com wrote: I wonder the reason for ELIF. it's not aligned with IF, make code ugly It most certainly is aligned with IF: if cond1: do this elif cond2: do that else: do the other The if elif and else are all

Re: run exe and create exe

2009-10-11 Thread r
On Oct 11, 10:15 am, daved170 daved...@gmail.com wrote: Hi everybody, I have 2 questions: 1) I created my python application. It has QT Gui. How can I make exe of it? I don't want everytime I run the file it'll open the command line window which does nothing. If you want to run your script

Re: mxDateTime history (Re: mktime, how to handle dates before 01-01-1970 ?)

2009-10-11 Thread MRAB
Rhodri James wrote: On Fri, 09 Oct 2009 13:39:43 +0100, Tim Chase python.l...@tim.thechases.com wrote: Month arithmetic is a bit of a mess, since it's not clear how to map e.g. Jan 31 + one month. Jan 31 + one month usually means add one to the month value and then keep backing off the day

Re: run exe and create exe

2009-10-11 Thread MRAB
daved170 wrote: Hi everybody, I have 2 questions: 1) I created my python application. It has QT Gui. How can I make exe of it? I don't want everytime I run the file it'll open the command line window which does nothing. 2) My Application suppose to be a client server app. Anyhow, for now It's

Re: The rap against while True: loops

2009-10-11 Thread Gabriel Genellina
En Sat, 10 Oct 2009 19:32:25 -0300, Björn Lindqvist bjou...@gmail.com escribió: I have many times screwed up while True-loops. When I thought I had a safe exit condition which turned out to be never reached in some rare corner cases. Leading to weird bugs with hanging threads. I have seen

Re: Persistent Distributed Objects

2009-10-11 Thread John Haggerty
Does pyro work inside of stackless? On Sat, Oct 10, 2009 at 9:54 AM, Simon Forman sajmik...@gmail.com wrote: On Fri, Oct 9, 2009 at 1:11 AM, John Haggerty bouncy...@gmail.com wrote: I am interested in seeing how it would be possible in python to have persistent objects (basically be able to

Re: code in a module is executed twice (cyclic import problems) ?

2009-10-11 Thread Stephen Fairchild
ryles wrote: I always thought code in a module was only executed once, but doesn't seem to be true. I'm using Python 2.5. And this is the example: == A.py == My_List = [] == B.py == from A import * My_List.append ( 3 ) print 'B', My_List import C == C.py == from A import * from

Re: postprocessing in os.walk

2009-10-11 Thread jordilin
Well, you could use the alternative os.path.walk instead. You can pass a callback as a parameter, which will be invoked every time you bump into a new directory. The signature is os.path.walk (path,visit,arg). Take a look at the python library documentation. On 11 Oct, 00:12, kj

getting equal behavior for scripts and modules ?

2009-10-11 Thread Stef Mientki
hello, I do agree that circular references should preferable be avoided. In languages like Delphi, you get an error message, trying to use circular references, but solving them in large programs with a lot of history can be very painful. Now I finally (after 2 years) knowing there's a

Re: getting equal behavior for scripts and modules ?

2009-10-11 Thread Stephen Hansen
On Sun, Oct 11, 2009 at 10:50 AM, Stef Mientki stef.mien...@gmail.comwrote: [...] In languages like Delphi, you get an error message, trying to use circular references, but solving them in large programs with a lot of history can be very painful. [...] === solution 1 === Inserting a

Re: A new Internet-search website written in Python

2009-10-11 Thread hrg...@gmail.com
On 10/10/09, John Nagle na...@animats.com wrote: hrg...@gmail.com wrote: The purpose of this email is to inform the Python-list mailing-list subscribers of an Internet-search website that is run by software written in Python. All the site seems to do is frame the results from other

Re: Why ELIF?

2009-10-11 Thread TerryP
On Oct 11, 3:42 pm, Esmail ebo...@hotmail.com wrote: cool .. I hadn't seen that. Not working quite at the 'pythonic' level yet I am not sure I think it's more readable that the if statement. Also, curious if the dictionary approach is more efficient. Somehow I doubt that Look up X in

Re: getting equal behavior for scripts and modules ?

2009-10-11 Thread Gabriel Genellina
En Sun, 11 Oct 2009 14:50:31 -0300, Stef Mientki stef.mien...@gmail.com escribió: I do agree that circular references should preferable be avoided. In languages like Delphi, you get an error message, trying to use circular references, but solving them in large programs with a lot of

Re: Why ELIF?

2009-10-11 Thread Simon Forman
On Sun, Oct 11, 2009 at 2:15 PM, TerryP bigboss1...@gmail.com wrote: On Oct 11, 3:42 pm, Esmail ebo...@hotmail.com wrote: cool .. I hadn't seen that. Not working quite at the 'pythonic' level yet I am not sure I think it's more readable that the if statement. Also, curious if the dictionary

Re: Persistent Distributed Objects

2009-10-11 Thread Simon Forman
On Sun, Oct 11, 2009 at 12:46 PM, John Haggerty bouncy...@gmail.com wrote: Does pyro work inside of stackless? I have no idea, but you wouldn't need both. Only one or the other. ~Simon On Sat, Oct 10, 2009 at 9:54 AM, Simon Forman sajmik...@gmail.com wrote: On Fri, Oct 9, 2009 at 1:11 AM,

Re: run exe and create exe

2009-10-11 Thread Benjamin Kaplan
On Sun, Oct 11, 2009 at 11:15 AM, daved170 daved...@gmail.com wrote: Hi everybody, I have 2 questions: 1) I created my python application. It has QT Gui. How can I make exe of it? I don't want everytime I run the file it'll open the command line window which does nothing. Two things about

Re: Why ELIF?

2009-10-11 Thread Mick Krippendorf
TerryP schrieb: Note: let Commands be a dictionary, such that { ham : ..., spam : ..., eggs : ... }. args = re.split('\s', line) cmd = args.pop(0) if cmd in Commands: Commands[cmd](args) else: raise SyntaxWarning(Syntax error in above program) [...] I might take

Re: Why ELIF?

2009-10-11 Thread MRAB
Simon Forman wrote: [snip] I'll often do that this way: args = re.split('\s', line) This has the same result, but is shorter and quicker: args = line.split() -- http://mail.python.org/mailman/listinfo/python-list

Re: datetime.datetime. or datetime. ?

2009-10-11 Thread niklasr
On Oct 10, 8:43 pm, Carl Banks pavlovevide...@gmail.com wrote: On Oct 10, 2:26 am, niklasr nikla...@gmail.com wrote: On Oct 8, 10:17 pm, Carl Banks pavlovevide...@gmail.com wrote: On Oct 8, 3:11 pm, niklasr nikla...@gmail.com wrote: On Oct 8, 5:25 pm, Diez B. Roggisch

Re: getting equal behavior for scripts and modules ?

2009-10-11 Thread Stef Mientki
Stephen Hansen wrote: On Sun, Oct 11, 2009 at 10:50 AM, Stef Mientki stef.mien...@gmail.com mailto:stef.mien...@gmail.com wrote: [...] In languages like Delphi, you get an error message, trying to use circular references, but solving them in large programs with a lot of history

Error en el bus from python

2009-10-11 Thread Yusniel
Hi. I did installed a library for python named pyswip-0.2.2 but when I run a python example with the next lines, the python interpreter, it throw me the following error: Error en el bus. The code lines are: from pyswip.prolog import Prolog from pyswip.easy import getList, registerForeign N = 3

Re: getting equal behavior for scripts and modules ?

2009-10-11 Thread Stef Mientki
Gabriel Genellina wrote: En Sun, 11 Oct 2009 14:50:31 -0300, Stef Mientki stef.mien...@gmail.com escribió: I do agree that circular references should preferable be avoided. In languages like Delphi, you get an error message, trying to use circular references, but solving them in large

Re: Why ELIF?

2009-10-11 Thread Steven D'Aprano
On Sun, 11 Oct 2009 11:15:06 -0700, TerryP wrote: On Oct 11, 3:42 pm, Esmail ebo...@hotmail.com wrote: cool .. I hadn't seen that. Not working quite at the 'pythonic' level yet I am not sure I think it's more readable that the if statement. Also, curious if the dictionary approach is more

Re: The rap against while True: loops

2009-10-11 Thread bartc
Mensanator wrote: On Oct 10, 3:15�pm, kj no.em...@please.post wrote: I'm coaching a group of biologists on basic Python scripting. �One of my charges mentioned that he had come across the advice never to use loops beginning with while True. �Of course, that's one way to start an infinite loop,

Re: Why ELIF?

2009-10-11 Thread Carl Banks
On Oct 11, 7:10 am, Grant Edwards inva...@invalid.invalid wrote: On 2009-10-11, metal metal...@gmail.com wrote: I wonder the reason for ELIF. it's not aligned with IF, make code ugly It most certainly is aligned with IF:   if cond1:       do this   elif cond2:       do that   else:    

Re: getting equal behavior for scripts and modules ?

2009-10-11 Thread Steven D'Aprano
On Sun, 11 Oct 2009 19:50:31 +0200, Stef Mientki wrote: Now I finally (after 2 years) knowing there's a difference between modules and scripts, I want to guarantee that I always get the same functional behavior. You are confused. Scripts *are* modules. What makes a script a script is that it

Re: Error en el bus from python

2009-10-11 Thread Steven D'Aprano
On Sun, 11 Oct 2009 13:45:54 -0700, Yusniel wrote: Hi. I did installed a library for python named pyswip-0.2.2 but when I run a python example with the next lines, the python interpreter, it throw me the following error: Error en el bus. ... where hanoy.pl is a program with python code. Any

Re: The rap against while True: loops

2009-10-11 Thread Mensanator
On Oct 11, 4:51�pm, bartc ba...@freeuk.com wrote: Mensanator wrote: On Oct 10, 3:15 pm, kj no.em...@please.post wrote: I'm coaching a group of biologists on basic Python scripting. One of my charges mentioned that he had come across the advice never to use loops beginning with while True.

Re: The rap against while True: loops

2009-10-11 Thread Philip Semanchuk
On Oct 11, 2009, at 5:51 PM, bartc wrote: Mensanator wrote: On Oct 10, 3:15�pm, kj no.em...@please.post wrote: I'm coaching a group of biologists on basic Python scripting. �One of my charges mentioned that he had come across the advice never to use loops beginning with while True. �Of

What do I do now?

2009-10-11 Thread Someone Something
I've been programming since about 3 years, and come to think of it never written anything large. I know a few languages: c, python, perl, java. Right now, I just write little IRC bots that basically don't do anything. I have two questions: 1) What should I start programming (project that takes

Re: Why ELIF?

2009-10-11 Thread Mensanator
On Oct 11, 5:05�pm, Carl Banks pavlovevide...@gmail.com wrote: On Oct 11, 7:10�am, Grant Edwards inva...@invalid.invalid wrote: On 2009-10-11, metal metal...@gmail.com wrote: I wonder the reason for ELIF. it's not aligned with IF, make code ugly It most certainly is aligned with IF:

Re: Why ELIF?

2009-10-11 Thread Carl Banks
On Oct 11, 4:12 pm, Mensanator mensana...@aol.com wrote: On Oct 11, 5:05 pm, Carl Banks pavlovevide...@gmail.com wrote: On Oct 11, 7:10 am, Grant Edwards inva...@invalid.invalid wrote: On 2009-10-11, metal metal...@gmail.com wrote: I wonder the reason for ELIF. it's not aligned

Inserting into a database

2009-10-11 Thread aditya shukla
Hello Guy's I am using python 2.6 on windows 7 and MySQLdb to make connections to the database.The issue here is that I am not able to insert from the python script to the database.When I run the same query in mysql query brower then the insert statement works .I am able to select from the

Re: Inserting into a database

2009-10-11 Thread Stephen Hansen
On Sun, Oct 11, 2009 at 4:46 PM, aditya shukla adityashukla1...@gmail.comwrote: Hello Guy's I am using python 2.6 on windows 7 and MySQLdb to make connections to the database.The issue here is that I am not able to insert from the python script to the database.When I run the same query in

Re: Inserting into a database

2009-10-11 Thread aditya shukla
Hello Guys I am using python 2.6 on windows 7 and MySQLdb to make connections to the database.The issue here is that I am not able to insert from the python script to the database.When I run the same query in mysql query brower then the insert statement works .I am able to select from the

Re: Inserting into a database

2009-10-11 Thread aditya shukla
On Sun, Oct 11, 2009 at 5:06 PM, aditya shukla adityashukla1...@gmail.comwrote: Hello Stephen, I have put the code and the traceback.Can you please help me now? .I am scratching my head :) I am using python 2.6 on windows 7 and MySQLdb to make connections to the database.The issue

Re: Inserting into a database

2009-10-11 Thread Stephen Hansen
On Sun, Oct 11, 2009 at 5:06 PM, aditya shukla adityashukla1...@gmail.comwrote: this what the code looks like. db = MySQLdb.connect(localhost,root,juventus12,factoids,charset = utf8, use_unicode = True ) cursor= db.cursor() # i added charset = utf8, use_unicode = True just now and

Re: An assessment of Tkinter and IDLE

2009-10-11 Thread r
A few things i forgot to mention... +--+ Things i forgot... IDLE Editor +--+ 1. class and path browsers should be available in a tabbed widget located in the left side of the Editor window. Should also have a show/ hide button or have them

Re: Why ELIF?

2009-10-11 Thread John Machin
MRAB python at mrabarnett.plus.com writes: Simon Forman wrote: [snip] I'll often do that this way: args = re.split('\s', line) This has the same result, but is shorter and quicker: args = line.split() HUH? Shorter and quicker, yes, but provides much better functionality;

Re: The rap against while True: loops

2009-10-11 Thread RDrewD
On Oct 11, 6:46 pm, Philip Semanchuk phi...@semanchuk.com wrote: On Oct 11, 2009, at 5:51 PM, bartc wrote: Mensanator wrote: On Oct 10, 3:15 pm, kj no.em...@please.post wrote: I'm coaching a group of biologists on basic Python scripting. One of my charges mentioned that he had come

Re: The rap against while True: loops

2009-10-11 Thread Gabriel Genellina
En Sun, 11 Oct 2009 19:46:06 -0300, Philip Semanchuk phi...@semanchuk.com escribió: On Oct 11, 2009, at 5:51 PM, bartc wrote: Mensanator wrote: On Oct 10, 3:15�pm, kj no.em...@please.post wrote: I'm coaching a group of biologists on basic Python scripting. �One of my charges mentioned that

Re: Error en el bus from python

2009-10-11 Thread Yusniel
On 11 oct, 18:29, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Sun, 11 Oct 2009 13:45:54 -0700, Yusniel wrote: Hi. I did installed a library for python named pyswip-0.2.2 but when I run a python example with the next lines, the python interpreter, it throw me the

Re: Error en el bus from python

2009-10-11 Thread Philip Semanchuk
On Oct 11, 2009, at 4:45 PM, Yusniel wrote: Hi. I did installed a library for python named pyswip-0.2.2 but when I run a python example with the next lines, the python interpreter, it throw me the following error: Error en el bus. The code lines are: from pyswip.prolog import Prolog from

Re: The rap against while True: loops

2009-10-11 Thread Gabriel Genellina
En Sun, 11 Oct 2009 23:01:47 -0300, RDrewD drewl...@gmail.com escribió: On Oct 11, 6:46 pm, Philip Semanchuk phi...@semanchuk.com wrote: On Oct 11, 2009, at 5:51 PM, bartc wrote: Mensanator wrote: On Oct 10, 3:15 pm, kj no.em...@please.post wrote: I'm coaching a group of biologists on basic

Re: Why ELIF?

2009-10-11 Thread Mensanator
On Oct 11, 6:43�pm, Carl Banks pavlovevide...@gmail.com wrote: On Oct 11, 4:12�pm, Mensanator mensana...@aol.com wrote: On Oct 11, 5:05 pm, Carl Banks pavlovevide...@gmail.com wrote: On Oct 11, 7:10 am, Grant Edwards inva...@invalid.invalid wrote: On 2009-10-11, metal

Re: Delete all list entries of length unknown

2009-10-11 Thread r
On Oct 4, 11:05 pm, Mark Tolonen metolone+gm...@gmail.com wrote: Chris Rebert c...@rebertia.com wrote in message Tuples are immutable (i.e. they cannot be modified after creation) and are createdusingparentheses. Slight correction: tuples are createdusingcommas.  Parentheses are only

Re: Error en el bus from python

2009-10-11 Thread Philip Semanchuk
On Oct 11, 2009, at 11:56 PM, Dennis Lee Bieber wrote: On Sun, 11 Oct 2009 13:45:54 -0700 (PDT), Yusniel yhidalg...@gmail.com declaimed the following in gmane.comp.python.general: prolog.consult(hanoi.pl) snip where hanoy.pl is a program with python code. Any solution for

Re: Inserting into a database

2009-10-11 Thread Stephen Hansen
On Sun, Oct 11, 2009 at 8:56 PM, Dennis Lee Bieber wlfr...@ix.netcom.comwrote: On Sun, 11 Oct 2009 17:00:42 -0700, Stephen Hansen apt.shan...@gmail.com declaimed the following in gmane.comp.python.general: Otherwise, the only thing anyone will be able to do is guess wildly. Which no one

Re: What do I do now?

2009-10-11 Thread Donn
On Monday 12 October 2009 00:53:42 Someone Something wrote: 1) What should I start programming (project that takes 1-2 months, not very short term)? 2) Whtat are some good open source projects I can start coding for? These kinds of questions amaze me. Surely you are a kid in a candy shop when

Re: Is pythonic version of scanf() or sscanf() planned?

2009-10-11 Thread TerryP
On Oct 9, 5:59 pm, Joshua Kugler jos...@joshuakugler.com wrote: ryniek90 wrote: So maybe someone, someday decide to put in Python an alternative, really great implementation ofscanf() ? My idea of a greatscanf() function would be a clever combination of re.match(), int(), and float(). j

Re: Is pythonic version of scanf() or sscanf() planned?

2009-10-11 Thread r
On Oct 3, 8:17 pm, Grant Edwards inva...@invalid.invalid wrote: (--snip--) One of the fist things I remember being taught as a C progrmmer was to never use scanf.  Programs that use scanf tend to fail in rather spectacular ways when presented with simple typos and other forms of unexpected

Re: python performance on Solaris

2009-10-11 Thread inaf
On Oct 11, 6:59 am, Antoine Pitrou solip...@pitrou.net wrote: inaf cem.ezberci at gmail.com writes: My code seem to return lookups from a in memory data structure I build combining bunch of dictionaries and lists 6-8 times faster on a 32 bit Linux box than on a Solaris zone. Well, if

Re: Why ELIF?

2009-10-11 Thread TerryP
On Oct 11, 9:43 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Sun, 11 Oct 2009 11:15:06 -0700, TerryP wrote: I might take flak here, for writing something like 'dict[key] (func_args)' instead of something more Pythonic, Looking up a first-class function in a dictionary

Re: An assessment of Tkinter and IDLE

2009-10-11 Thread TerryP
On Aug 27, 9:22 pm, r rt8...@gmail.com wrote: - from Tkinter import * - *Too many noobs start out with the from Tkinter import * idiom, unknowing that they are horribly polluting their namespace. I feel

[issue6894] urllib2 doesn't respect no_proxy environment (python2.6.2)

2009-10-11 Thread Senthil Kumaran
Senthil Kumaran orsent...@gmail.com added the comment: merged in release31-maint in revision 75336 Closing the issue. -- status: open - closed versions: +Python 2.7, Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org

[issue4064] distutils.util.get_platform() is wrong for universal builds on macosx

2009-10-11 Thread Ronald Oussoren
Changes by Ronald Oussoren ronaldousso...@mac.com: -- nosy: -ronaldoussoren ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4064 ___ ___

[issue7102] Problems building pyhton from source on Snow Leopard (Mac OS X 10.6)

2009-10-11 Thread Fredrik Hedman
New submission from Fredrik Hedman fredrik.hed...@me.com: -*- mode: outline -*- * Problems building pyhton from source on Snow Leopard (Mac OS X 10.6) 1 error and 39 warnings and a quick fix. ** Building python from source with --enable-framework I have a fresh install of Snow Leopard and the

[issue7102] Problems building pyhton from source on Snow Leopard (Mac OS X 10.6)

2009-10-11 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com added the comment: Fredrik: OSX 10.6 was released after Python 3.1.1. I know that we had to apply a number of patches to the 2.6 branch to get that to compile properly on 10.6, and those should have been forward ported to the 3.1 branch. Could you

[issue7100] test_xmlrpc: global name 'stop_serving' is not defined

2009-10-11 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I can't repro on my windows box. From what I can see, for some reason the server thread isn't terminating, so we enter an errorhandling codepath that is broken. The slew of errors that follow occur when the process is exiting and

[issue7060] test_multiprocessing dictionary changed size errors and hang

2009-10-11 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: It was a bad idea to revert the change, because we may now forget about the problem rather than fix it. It is likely that the dictionary changed size during iteration occurs because a GC collection gets triggered during the iteration on the

[issue7060] test_multiprocessing dictionary changed size errors and hang

2009-10-11 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: The unittest only keeps an exception _object_ around, not the associated traceback. There should be no frames and thus reference cycles associated with this. I agree that the problem should be tackled, rather than swept under the

[issue7060] test_multiprocessing dictionary changed size errors and hang

2009-10-11 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The unittest only keeps an exception _object_ around, not the associated traceback. In py3k, the traceback is attached to the exception (on the __traceback__ attribute) ;) -- ___ Python tracker

[issue7060] test_multiprocessing dictionary changed size errors and hang

2009-10-11 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: I disagree about reverting it. We have this bug report, and that change is sitting on the merge queue again... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7060

[issue7103] Error in config parser example (w/ Patch)

2009-10-11 Thread Thomas Courbon
New submission from Thomas Courbon hart...@yahoo.fr: When ran in python 3.1.1 (hand compiled, fedora 11), the first example of configparser module fail with : Traceback (most recent call last): File test1.py, line 22, in module config.write(configfile) File

[issue7103] Error in config parser example (w/ Patch)

2009-10-11 Thread Thomas Courbon
Changes by Thomas Courbon hart...@yahoo.fr: -- keywords: +patch Added file: http://bugs.python.org/file15101/configparser_example_issue_7103.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7103

[issue7060] test_multiprocessing dictionary changed size errors and hang

2009-10-11 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I didn't realize that the traceback was attached to the exception object in py3k. This makes the use of such objects more dangerous because of the circular references. The recommended practice of exc_type, exc_obj =

[issue6027] test_xmlrpc_net fails when the ISP returns 302 Found

2009-10-11 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +krisvale, loewis priority: - low ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6027 ___

[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2009-10-11 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7092 ___ ___ Python-bugs-list

[issue6896] Intermittent failures in test_mailbox

2009-10-11 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +akuchling ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6896 ___ ___ Python-bugs-list

[issue2100] unit test UnicodeWarning

2009-10-11 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: That try/except no longer exists on trunk. This issue can probably be closed. -- status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2100

[issue1729305] test_doctest fails when run in verbose mode

2009-10-11 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: This test still fail on Win7 with Py2.6.3rc1 in verbose mode, it works fine in normal mode. I attached a file with the traceback. -- nosy: +ezio.melotti versions: +Python 2.6 -Python 2.5 Added file:

[issue7103] Error in config parser example (w/ Patch)

2009-10-11 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- assignee: georg.brandl - ezio.melotti nosy: +ezio.melotti priority: - low ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7103 ___

[issue7104] test_descr uses __cmp__ which will never be called

2009-10-11 Thread Daniel Stutzbach
New submission from Daniel Stutzbach dan...@stutzbachenterprises.com: The following is from Lib/test/test_descr.py. It's trying to test if looking up a special method on an object leaks references. It tests it by using __cmp__. The test will always pass because Python 3 is trying to look up

[issue7105] weak dict iterators are fragile because of unpredictable GC runs

2009-10-11 Thread Antoine Pitrou
New submission from Antoine Pitrou pit...@free.fr: As mentioned in issue7060, weak dict iterators are easily broken by cyclic garbage collection changing the size of the underlying dict storage: File /home/rdmurray/python/py3k/Lib/weakref.py, line 121, in items for wr in

  1   2   >