Pythons in Florida (training next month)

2009-09-21 Thread Python Training
Don't miss your chance to attend our first Florida Python training session next month. This 3-day class is being held October 20-22, in Sarasota, Florida. It is open to both individual and group enrollments. For more details on the class, as well as registration instructions, please visit the

SQLObject 0.10.7

2009-09-21 Thread Oleg Broytmann
Hello! I'm pleased to announce version 0.10.7, a minor bugfix release of 0.10 branch of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be

SQLObject 0.11.1

2009-09-21 Thread Oleg Broytmann
Hello! I'm pleased to announce version 0.11.1, a minor bugfix release of 0.11 branch of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be

Reset Your LinkedIn Password

2009-09-21 Thread LinkedIn Password
LinkedIn We have received your request to reset your LinkedIn password. Please use this secure URL to reset your password within 5 days: https://www.linkedin.com/e/pwr/26793251/OGWCdFSS/ To reset your password, please enter your new password twice on the page that opens. Thank

Re: Tkinter - Text - bullets

2009-09-21 Thread eb303
On Sep 19, 5:53 pm, Thomas Lehmann iris-und-thomas-lehm...@t- Online.de wrote: Something like this maybe? from Tkinter import * root = Tk() txt = Text(root, wrap='word') txt.pack() txt.tag_configure('text_body', font=('Times', 18), lmargin1=0, lmargin2=0)

Re: Compile kinterbasdb with mingw32 and python 2.6 - DLL load failed

2009-09-21 Thread Laszlo Nagy
The building and installation went find. But I cannot import kinterbasdb because I get a DLL load failed error. I figured out that has something to do with msvcr90 and _ftime. Can you please give me some advice how to solve this problem? Download Microsoft Visual C++.2008 Express Edition

Re: explicit call to __init__(self) in subclass needed?

2009-09-21 Thread Bruno Desthuilliers
Andrew MacKeith a écrit : Bruno Desthuilliers wrote: Andrew MacKeith a écrit : I create a class like this in Python-2.6 class Y(str): ... def __init__(self, s): ... pass ... y = Y('giraffe') y 'giraffe' How does the base class (str) get initialized with the value passed to

Re: Python-list Digest, Vol 72, Issue 210

2009-09-21 Thread Threader Slash
Hi Roman, I am using MySQL with Python -- in Windows XP for a contract. I hope my comments can be useful: When dealing with installation on Python, I noticed that tiny details can make a difference -- e.g. first I installed the latest version of Python 3.x, but it did not attend what I am

Re: easy question, how to double a variable

2009-09-21 Thread Carl Banks
On Sep 20, 1:27 pm, daggerdvm dagger...@yahoo.com wrote:  Write the definition of a function  twice , that receives an  int parameter and returns an  int that is twice the value of the parameter. how can i do this Simple: Once you define the function, copy it using your editor commands,

Re: Compile kinterbasdb with mingw32 and python 2.6 - DLL load failed

2009-09-21 Thread Gerhard Häring
Laszlo Nagy wrote: The building and installation went find. But I cannot import kinterbasdb because I get a DLL load failed error. I figured out that has something to do with msvcr90 and _ftime. Can you please give me some advice how to solve this problem? Download Microsoft Visual

Re: Compile kinterbasdb with mingw32 and python 2.6 - DLL load failed

2009-09-21 Thread Paul Rudin
Laszlo Nagy gand...@shopzeus.com writes: The building and installation went find. But I cannot import kinterbasdb because I get a DLL load failed error. I figured out that has something to do with msvcr90 and _ftime. Can you please give me some advice how to solve this problem?

SQLObject 0.11.1

2009-09-21 Thread Oleg Broytmann
Hello! I'm pleased to announce version 0.11.1, a minor bugfix release of 0.11 branch of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be

Re:OT - people eaters - was: An assessment of the Unicode standard

2009-09-21 Thread Cousin Stanley
On Friday 18 September 2009 06:39:57 Dennis Lee Bieber wrote: A one-eyed, one-horned, flying purple people eater? {Which brings up the confusing question... Is the eater purple, or does it eat purple people (which is why it is so rare... it only eats people caught in the last stages

Re: Substitute for KConfig in Qt4

2009-09-21 Thread nusch
On Sep 19, 3:53 am, David Boddie da...@boddie.org.uk wrote: On Thursday 17 September 2009 13:04, nusch wrote: I want to remove pyKDE dependencies from my app to make it pure PyQt. What will be the best substitute for KConfig? What exactly do you use KConfig for in your application? David

Re: List comprehension vs generator expression memory allocation

2009-09-21 Thread Duncan Booth
candide cand...@free.invalid wrote: Each of the following two functions mult1() and mult2() solves the question : # - def mult1(a,b,m): return (x for x in range(a,b)[(m-a%m)%m:b:m]) def mult2(a,b,m): return range(a,b)[(m-a%m)%m:b:m] #

Re: testing code in python source package

2009-09-21 Thread Ben Finney
Peng Yu pengyu...@gmail.com writes: I'm wondering if the development of python is test driven. If it is, where in the Python-2.6.2 source directory is the test code for the modules in ./Lib? A great majority of your many questions in this forum are already answered in the available

Re: Am I doing this wrong? Why does this seem so clumsy (time, datetime vs. DateTime)

2009-09-21 Thread Ben Morrow
[This is not a Perl question. F'ups set to c.l.python.] Quoth Schif Schaf schifsc...@gmail.com: The other day I needed to convert a date like August 2009 into a seconds-since-epoch value (this would be for the first day of that month, at the first second of that day). Note that this is not

Re: An assessment of the Unicode standard

2009-09-21 Thread Mel
Dennis Lee Bieber wrote: A one-eyed, one-horned, flying purple people eater? {Which brings up the confusing question... Is the eater purple, or does it eat purple people (which is why it is so rare... it only eats people caught in the last stages of suffocation G)} Since we're spending so

Re: List comprehension vs generator expression memory allocation

2009-09-21 Thread candide
Duncan Booth a écrit : Why are you slicing the result of range? Why not just pass appropriate arguments to range or xrange directly? Why ? Guilty ignorance ;) def f(a,b,m): return xrange((a+m-1)//m*m, b, m) Nice code, furthermore giving the best execution time, thanks. --

[SQL] Pick random rows from SELECT?

2009-09-21 Thread Gilles Ganault
Hello I have a working Python script that SELECTs rows from a database to fetch a company's name from a web-based database. Since this list is quite big and the site is the bottleneck, I'd like to run multiple instances of this script, and figured a solution would be to pick rows at

Re: easy question, how to double a variable

2009-09-21 Thread Tim Chase
Steven D'Aprano wrote: Write the definition of a function twice , that receives an int parameter and returns an int that is twice the value of the parameter. how can i do this Yes, that certainly is an easy question. Here's my solution: class MultiplierFactory(object): [snip a marvel of

Compile kinterbasdb with mingw32 and python 2.6 - DLL load failed

2009-09-21 Thread Threader Slash
I have spent two week working with MinGW. The conclusion I came after a lot of headaches and making the project getting late is: MinGW doesn't work properly on MS Windows -- there are many conflicting variables and functions with similar names on MinGW libs and MS Libs, e.g. windows.h, etc, etc.

Python: automate input to MySQL query

2009-09-21 Thread Threader Slash
Hi Everybody... I have a query that works as follows: Code: db.query(SELECT traveler.travelerFirstName,vaccine.vaccineName from (traveler INNER JOIN takenvaccine ON traveler.travelerID = takenvaccine.travelerID) INNER JOIN vaccine ON takenvaccine.vaccineID=vaccine.vaccineID

raise errors

2009-09-21 Thread daved170
Hi everybody, I need help with exceptions raising. My goal is to print at the outer functions all the errors including the most inner one. For example: def foo1(self): try: foo2() except ? : print outer Err at foo1 + ?? def foo2(self): try: error occured

Re: I look for proxy cache like apt-proxy (for Debian Package) but for python eggs package…

2009-09-21 Thread KLEIN Stéphane
Le Sun, 20 Sep 2009 18:33:10 +0200, Klein Stéphane a écrit : Hi, I look for a tools to do proxy cache like apt-proxy (for Debian Package) but for python eggs package. Can a easy-install option perform this feature ? I found somethings to do that :

Re: raise errors

2009-09-21 Thread Ulrich Eckhardt
daved170 wrote: I need help with exceptions raising. My goal is to print at the outer functions all the errors including the most inner one. For example: def foo1(self): try: foo2() except ? : print outer Err at foo1 + ?? def foo2(self): try:

Re: Is there a concerted effort afoot to improve the Python Wiki?

2009-09-21 Thread Paul Boddie
On 21 Sep, 02:52, s...@pobox.com wrote: I've noticed over the past few weeks a huge increase in the frequency of edits in the Python wiki.  Many of those are due to Carl Trachte's work on non-English pages about Python.  There are plenty of other pages going under the knife as well though.  Is

Re: raise errors

2009-09-21 Thread Peter Otten
daved170 wrote: I need help with exceptions raising. My goal is to print at the outer functions all the errors including the most inner one. For example: def foo1(self): try: foo2() except ? : print outer Err at foo1 + ?? def foo2(self): try:

Re: [SQL] Pick random rows from SELECT?

2009-09-21 Thread Peter Otten
Gilles Ganault wrote: I have a working Python script that SELECTs rows from a database to fetch a company's name from a web-based database. Since this list is quite big and the site is the bottleneck, I'd like to run multiple instances of this script, and figured a solution would be to

Re: Compile kinterbasdb with mingw32 and python 2.6 - DLL load failed

2009-09-21 Thread Christian Heimes
Laszlo Nagy wrote: The building and installation went find. But I cannot import kinterbasdb because I get a DLL load failed error. I figured out that has something to do with msvcr90 and _ftime. Can you please give me some advice how to solve this problem? I know from experience that it's

passing object between classes

2009-09-21 Thread daved170
Hi everybody, I built my owen log obj as a class. I'm passing it to another object (actually to a thread). When I run my app it raise error at the line when I'm using that log obj. is there any problem with the concept of passing object as I do it? How can I do that? class A: def foo1: myLog

Re: [ANN] Athens Python User Group - Meeting September 9, 2009, 19:00.

2009-09-21 Thread Orestis Markou
Blogged about the results of the meeting here: http://orestis.gr/blog/2009/09/21/athens-python-ug-1st-meeting-results/ Also announcing a dedicated maling list: http://mail.python.org/mailman/listinfo/pyathens Orestis On 04 Σεπ 2009, at 7:42 μ.μ., Orestis Markou wrote: == Announcing the

Re: passing object between classes

2009-09-21 Thread Duncan Booth
daved170 daved...@gmail.com wrote: Hi everybody, I built my owen log obj as a class. I'm passing it to another object (actually to a thread). When I run my app it raise error at the line when I'm using that log obj. is there any problem with the concept of passing object as I do it? How

Re: raise errors

2009-09-21 Thread Benjamin Kaplan
On Mon, Sep 21, 2009 at 5:17 AM, daved170 daved...@gmail.com wrote: Hi everybody, I need help with exceptions raising. My goal is to print at the outer functions all the errors including the most inner one. For example: def foo1(self):   try:        foo2()   except ? :         print

Re: Python: automate input to MySQL query

2009-09-21 Thread Philip Semanchuk
On Sep 21, 2009, at 5:18 AM, Threader Slash wrote: Hi Everybody... I have a query that works as follows: Code: db.query(SELECT traveler.travelerFirstName,vaccine.vaccineName from (traveler INNER JOIN takenvaccine ON traveler.travelerID = takenvaccine.travelerID) INNER JOIN vaccine ON

Re: Compile kinterbasdb with mingw32 and python 2.6 - DLL load failed

2009-09-21 Thread Laszlo Nagy
Christian Heimes írta: Laszlo Nagy wrote: The building and installation went find. But I cannot import kinterbasdb because I get a DLL load failed error. I figured out that has something to do with msvcr90 and _ftime. Can you please give me some advice how to solve this problem? I

Re: OK to memoize re objects?

2009-09-21 Thread kj
In mailman.120.1253406305.2807.python-l...@python.org Robert Kern robert.k...@gmail.com writes: kj wrote: My Python code is filled with assignments of regexp objects to globals variables at the top level; e.g.: _spam_re = re.compile('^(?:ham|eggs)$', re.I) Don't like it. My

Re: passing object between classes

2009-09-21 Thread daved170
On Sep 21, 1:44 pm, Duncan Booth duncan.bo...@invalid.invalid wrote: daved170 daved...@gmail.com wrote: Hi everybody, I built my owen log obj as a class. I'm passing it to another object (actually to a thread). When I run my app it raise error at the line when I'm using that log obj. is

Re: OK to memoize re objects?

2009-09-21 Thread Ethan Furman
kj wrote: In mailman.120.1253406305.2807.python-l...@python.org Robert Kern robert.k...@gmail.com writes: kj wrote: My Python code is filled with assignments of regexp objects to globals variables at the top level; e.g.: _spam_re = re.compile('^(?:ham|eggs)$', re.I) Don't like it. My

Re: Non-deprecated equivalent of rfc822.AddressList

2009-09-21 Thread Jason Tackaberry
On Wed, 2009-09-16 at 14:49 -0400, Jason Tackaberry wrote: Since the rfc822 module was removed in Python 3, and is deprecated in 2.3, I am obviously trying to avoid using it. But I'm having a hard time finding an equivalent to rfc822.AddressList in the email module, which I want to use to

Re: Granularity of OSError

2009-09-21 Thread kj
In mailman.122.1253409745.2807.python-l...@python.org MRAB pyt...@mrabarnett.plus.com writes: kj wrote: In mailman.107.1253369463.2807.python-l...@python.org MRAB pyt...@mrabarnett.plus.com writes: If, for example, you're going to copy a file, it's a good idea to check beforehand that

Re: Comparison of parsers in python?

2009-09-21 Thread Nobody
On Sat, 19 Sep 2009 13:21:58 -0700, Peng Yu wrote: I did a google search and found various parser in python that can be used to parse different files in various situation. I don't see a page that summarizes and compares all the available parsers in python, from simple and easy-to-use ones to

Re: OK to memoize re objects?

2009-09-21 Thread Nobody
On Mon, 21 Sep 2009 07:11:36 -0700, Ethan Furman wrote: Looking in the code for re in 2.5: _MAXCACHE = 100 On the other hand, I (a re novice, to be sure) have only used between two to five in any one program... it'll be a while before I hit _MAXCACHE! Do you know how many REs import-ed

Re: recommendation for webapp testing?

2009-09-21 Thread Aahz
In article 2053e5e2-763e-44fb-854e-c17204518...@z34g2000vbl.googlegroups.com, Schif Schaf schifsc...@gmail.com wrote: I need to do some basic website testing (log into account, add item to cart, fill out and submit forms, check out, etc.). What modules would be good to use for webapp testing

Re: passing object between classes

2009-09-21 Thread Jean-Michel Pichavant
daved170 wrote: On Sep 21, 1:44 pm, Duncan Booth duncan.bo...@invalid.invalid wrote: daved170 daved...@gmail.com wrote: Hi everybody, I built my owen log obj as a class. I'm passing it to another object (actually to a thread). When I run my app it raise error at the line when I'm using

Re: Non-deprecated equivalent of rfc822.AddressList

2009-09-21 Thread Aahz
In article mailman.209.1253544558.2807.python-l...@python.org, Jason Tackaberry t...@urandom.ca wrote: On Wed, 2009-09-16 at 14:49 -0400, Jason Tackaberry wrote: Since the rfc822 module was removed in Python 3, and is deprecated in 2.3, I am obviously trying to avoid using it. But I'm having

entry widget won't validate

2009-09-21 Thread Mike
I'm trying to arrange for an Entry widget to check whether its data is all digits and whether the number represented is small enough. The validate function seem to be called once at startup and not afterwards: import sys, Tkinter, tkFileDialog, tkMessageBox tk=Tkinter tkfd=tkFileDialog ...

Re: entry widget won't validate

2009-09-21 Thread Peter Otten
Mike wrote: I'm trying to arrange for an Entry widget to check whether its data is all digits and whether the number represented is small enough. The validate function seem to be called once at startup and not afterwards: import sys, Tkinter, tkFileDialog, tkMessageBox tk=Tkinter

Re: entry widget won't validate

2009-09-21 Thread Mike
On Sep 21, 12:47 pm, Peter Otten __pete...@web.de wrote: Mike wrote: I'm trying to arrange for an Entry widget to check whether its data is all digits and whether the number represented is small enough. The validate function seem to be called once at startup and not afterwards: The

Plotting wav file

2009-09-21 Thread Maggie
What would be the best way to plot a small .wav file in python? If there are any tutorials or sample code, I would really appreciate it! -- http://mail.python.org/mailman/listinfo/python-list

socket send O(N**2) complexity

2009-09-21 Thread Zac Burns
The mysocket.mysend method given at http://docs.python.org/howto/sockets.html has an (unwitting?) O(N**2) complexity for long msg due to the string slicing. I've been looking for a way to optimize this, but aside from a pure python 'string slice view' that looks at the original string I can't

Re: Plotting wav file

2009-09-21 Thread Rami Chowdhury
On Mon, 21 Sep 2009 11:58:30 -0700, Maggie la.f...@gmail.com wrote: What would be the best way to plot a small .wav file in python? If there are any tutorials or sample code, I would really appreciate it! I'm sorry, what are you hoping to plot about the .wav file? -- Rami Chowdhury Never

Re: Plotting wav file

2009-09-21 Thread Maggie
On Sep 21, 3:07 pm, Rami Chowdhury rami.chowdh...@gmail.com wrote: On Mon, 21 Sep 2009 11:58:30 -0700, Maggie la.f...@gmail.com wrote: What would be the best way to plot a small .wav file in python? If there are any tutorials or sample code, I would really appreciate it! I'm sorry, what are

Re: OK to memoize re objects?

2009-09-21 Thread Ethan Furman
Nobody wrote: On Mon, 21 Sep 2009 07:11:36 -0700, Ethan Furman wrote: Looking in the code for re in 2.5: _MAXCACHE = 100 On the other hand, I (a re novice, to be sure) have only used between two to five in any one program... it'll be a while before I hit _MAXCACHE! Do you know how

Re: Plotting wav file

2009-09-21 Thread Rami Chowdhury
On Mon, 21 Sep 2009 12:13:30 -0700, Maggie la.f...@gmail.com wrote: On Sep 21, 3:07 pm, Rami Chowdhury rami.chowdh...@gmail.com wrote: On Mon, 21 Sep 2009 11:58:30 -0700, Maggie la.f...@gmail.com wrote: What would be the best way to plot a small .wav file in python? If there are any

Re: socket send O(N**2) complexity

2009-09-21 Thread Mike
On Sep 21, 2:03 pm, Zac Burns zac...@gmail.com wrote: The mysocket.mysend method given athttp://docs.python.org/howto/sockets.htmlhas an (unwitting?) O(N**2) complexity for long msg due to the string slicing. I've been looking for a way to optimize this, but aside from a pure python 'string

Re: socket send O(N**2) complexity

2009-09-21 Thread Rob Williscroft
Zac Burns wrote in news:mailman.211.1253559803.2807.python-l...@python.org in comp.lang.python: The mysocket.mysend method given at http://docs.python.org/howto/sockets.html has an (unwitting?) O(N**2) complexity for long msg due to the string slicing. I've been looking for a way to

Re: Plotting wav file

2009-09-21 Thread Rami Chowdhury
On Mon, Sep 21, 2009 at 4:11 PM, Rami Chowdhury rami.chowdh...@gmail.com wrote: On Mon, 21 Sep 2009 12:53:44 -0700, Maggie la.f...@gmail.com wrote: I am by far more acquainted with R and generally would use it in this case, however, this particular experiment does require a lot of AFNI work,

Re: socket send O(N**2) complexity

2009-09-21 Thread exarkun
On 08:00 pm, r...@freenet.co.uk wrote: Zac Burns wrote in news:mailman.211.1253559803.2807.python- l...@python.org in comp.lang.python: The mysocket.mysend method given at http://docs.python.org/howto/sockets.html has an (unwitting?) O(N**2) complexity for long msg due to the string slicing.

Re: socket send O(N**2) complexity

2009-09-21 Thread Jack Diederich
On Mon, Sep 21, 2009 at 4:00 PM, Rob Williscroft r...@freenet.co.uk wrote: AIUI, as a python string is imutable, a slice of a string is a new string which points (C char *) to the start of the slice data and with a length that is the length of the slice, about 8 bytes on 32 bit machine. Not

Re: easy question, how to double a variable

2009-09-21 Thread daggerdvm
u don't want to answerthen why post?...get lost. -- http://mail.python.org/mailman/listinfo/python-list

Re: easy question, how to double a variable

2009-09-21 Thread daggerdvm
carl banks.you are a dork -- http://mail.python.org/mailman/listinfo/python-list

Re: Plotting wav file

2009-09-21 Thread Rami Chowdhury
On Mon, 21 Sep 2009 12:53:44 -0700, Maggie la.f...@gmail.com wrote: I am by far more acquainted with R and generally would use it in this case, however, this particular experiment does require a lot of AFNI work, therefore I am a bit lost. the .wav was generated via -- waver -WAV -TR 2.5

Re: socket send O(N**2) complexity

2009-09-21 Thread Rob Williscroft
wrote in news:mailman.216.1253565002.2807.python-l...@python.org in comp.lang.python: Niether of the CPython versions (2.5 and 3.0 (with modified code)) exibited any memory increase between allocated 1 meg + and end You bumped into a special case that CPython optimizes. s[:] is s. If

Re: specify max width to reportlab.canvas.drawString

2009-09-21 Thread juanefren
On Sep 18, 3:20 am, Robin Becker ro...@reportlab.com wrote: juanefren wrote: I am usingreportlabto create pdf documents, everything looks fine, how ever, is there a way to specify a max width to drawString function ? I mean cut the sentence and continue a step down... Cheers You'll

Re: easy question, how to double a variable

2009-09-21 Thread Ethan Furman
daggerdvm wrote: u don't want to answerthen why post?...get lost. On the contrary! We *do* want to answer. Prizes are awarded based on the most outlandish yet correct answer, on the most literal answer, and on the funniest answer! Ridiculous questions like yours are what

Re: socket send O(N**2) complexity

2009-09-21 Thread Zac Burns
On Mon, Sep 21, 2009 at 2:10 PM, Rob Williscroft r...@freenet.co.uk wrote:  wrote in news:mailman.216.1253565002.2807.python-l...@python.org in comp.lang.python: Niether of the CPython versions (2.5 and 3.0 (with modified code)) exibited any memory increase between allocated 1 meg + and end

Re: easy question, how to double a variable

2009-09-21 Thread Sean DiZazzo
On Sep 21, 1:46 pm, daggerdvm dagger...@yahoo.com wrote: u don't want to answerthen why post?...get lost. I eat children... -- http://mail.python.org/mailman/listinfo/python-list

Re: An assessment of the Unicode standard

2009-09-21 Thread Gabriel Genellina
En Sun, 20 Sep 2009 03:33:47 -0300, Greg Ewing greg.ew...@canterbury.ac.nz escribió: Hendrik van Rooyen wrote: In any case, it doesn't affect my point, which was that I was thinking about something that I didn't have a word, or even a convenient phrase for. That is probably true, but on the

using python 2.5

2009-09-21 Thread kunal.k
I have installed python 2.5 for a particular code. Now i have 2.6 already installed. How do i direct this code to use the 2.5 modules?? -- http://mail.python.org/mailman/listinfo/python-list

Re: An assessment of the Unicode standard

2009-09-21 Thread Emile van Sebille
On 9/19/2009 11:33 PM Greg Ewing said... It's possible that some individuals do this more frequently than others, e.g. mathematicians and other people who are in the habit of exploring new ideas may be less influenced by the constraints of language than the general population. As I recall

expy 0.2 released!

2009-09-21 Thread Yingjie Lan
Hi, This is to announce the release of expy 0.2. What's new? 1. fixed the 'const char*' bug. 2. introduced the 'raw_type'. What is expy? -- expy is an expressway to extend Python! For more details, visit http://expy.sf.net/ Have a nice one! Yingjie

Re: How to change string or number passed as argument?

2009-09-21 Thread Gabriel Genellina
En Sat, 19 Sep 2009 22:59:21 -0300, Peng Yu pengyu...@gmail.com escribió: I know that strings or numbers are immutable when they passed as arguments to functions. But there are cases that I may want to change them in a function and propagate the effects outside the function. I could wrap them

Re: OK to memoize re objects?

2009-09-21 Thread Steven D'Aprano
On Mon, 21 Sep 2009 13:33:05 +, kj wrote: I find the docs are pretty confusing on this point. They first make the point of noting that pre-compiling regular expressions is more efficient, and then *immediately* shoot down this point by saying that one need not worry about pre-compiling

Re: easy question, how to double a variable

2009-09-21 Thread Steven D'Aprano
On Mon, 21 Sep 2009 13:50:23 -0500, David C Ullrich wrote: But you actually want to return twice the value. I don't see how to do that. What? Seriously? You're not just yanking the OP's chain??? -- Steven who normally does quite well detecting sarcasm in writing --

Re: using python 2.5

2009-09-21 Thread Sean DiZazzo
On Sep 21, 4:42 pm, kunal.k kunalker...@gmail.com wrote: I have installed python 2.5 for a particular code. Now i have 2.6 already installed. How do i direct this code to use the 2.5 modules?? I don't think you do. You should install the modules for python 2.6. You could try to hand copy the

Re: easy question, how to double a variable

2009-09-21 Thread Tim Chase
But you actually want to return twice the value. I don't see how to do that. Ah, I think I see...returning more than once is done with the yield keyword: def f(param): yield param yield param That returns twice the integer parameter... :-D However, the OP was instructed to Write

Re: Finding application data after install - a solution?

2009-09-21 Thread Gabriel Genellina
En Sat, 19 Sep 2009 12:03:52 -0300, Wolodja Wentland wentl...@cl.uni-heidelberg.de escribió: reliably finding distribution data from your program seems to be an unsolved issue for programs packaged with distutils. I have seen a lot of code that manipulates mod.__file__ to solve this problem,

where is ctrl+newline handled in pywin editor?

2009-09-21 Thread C or L Smith
I use the pywin environment on Windows for python code editing and interactive environment. I've been able to find the place in the editor files where the enter key is handled and where the whitespace is stripped from a line and I've been able to get it to not leave any white space when a

Re: Non-deprecated equivalent of rfc822.AddressList

2009-09-21 Thread Gabriel Genellina
En Mon, 21 Sep 2009 11:49:15 -0300, Jason Tackaberry t...@urandom.ca escribió: On Wed, 2009-09-16 at 14:49 -0400, Jason Tackaberry wrote: Since the rfc822 module was removed in Python 3, and is deprecated in 2.3, I am obviously trying to avoid using it. But I'm having a hard time finding an

Re: easy question, how to double a variable

2009-09-21 Thread Grant Edwards
On 2009-09-21, David C Ullrich dullr...@sprynet.com wrote: On Sun, 20 Sep 2009 13:27:07 -0700, daggerdvm wrote: Write the definition of a function twice , that receives an int parameter and returns an int that is twice the value of the parameter. how can i do this I don't think this

Re: on package import, have it conditionally import a subpackage

2009-09-21 Thread Gabriel Genellina
En Sat, 19 Sep 2009 17:06:11 -0300, Gabriel Rossetti gabriel.rosse...@arimaz.com escribió: Hello everyone, I'd like to ba able to import a package and have it's __init__ conditionally import a subpackage. Suppose that you have this structure : mybase/ mybase/__init__.py mybase/mypkg

Re: Comparison of parsers in python?

2009-09-21 Thread greg
Nobody wrote: What I want: a tokeniser generator which can take a lex-style grammar (not necessarily lex syntax, but a set of token specifications defined by REs, BNF, or whatever), generate a DFA, then run the DFA on sequences of bytes. It must allow the syntax to be defined at run-time. You

Re: Finding application data after install - a solution?

2009-09-21 Thread Wolodja Wentland
On Mon, Sep 21, 2009 at 23:52 -0300, Gabriel Genellina wrote: En Sat, 19 Sep 2009 12:03:52 -0300, Wolodja Wentland wentl...@cl.uni-heidelberg.de escribió: reliably finding distribution data from your program seems to be an unsolved issue for programs packaged with distutils. [...] Isn't

Re: Non-deprecated equivalent of rfc822.AddressList

2009-09-21 Thread Cameron Simpson
On 21Sep2009 10:49, Jason Tackaberry t...@urandom.ca wrote: | On Wed, 2009-09-16 at 14:49 -0400, Jason Tackaberry wrote: | Since the rfc822 module was removed in Python 3, and is deprecated in | 2.3, I am obviously trying to avoid using it. | | But I'm having a hard time finding an equivalent

Re: Tkinter - Text - bullets

2009-09-21 Thread Thomas Lehmann
This is probably why you had all these alignment problems. But it's weird, because the script I posted is copied and pasted from a really script that I've run, and which doesn't cause any error. What is the version of tcl/tk used by your Tkinter module? And what is your Python version? Using

Re: easy question, how to double a variable

2009-09-21 Thread Tim Roberts
daggerdvm dagger...@yahoo.com wrote: carl banks.you are a dork What are you, eleven years old? Look, you asked us to answer for you what is CLEARLY a homework question. It is unethical for you to ask that, and it is unethical for us to answer it. As others have said, show us what you

[issue6071] no longer possible to hash arrays

2009-09-21 Thread Jan Hosang
Jan Hosang jan.hos...@gmail.com added the comment: I tried to implement the new buffer API, but as soon as I add bf_getbuffer/bf_releasebuffer to PyBufferProcs writing an array to a file breaks: f.write(a) TypeError: must be contiguous buffer, not array.array I searched through the file

[issue6864] IDLE 2.6.1 locks up on Mac OS 10.6

2009-09-21 Thread Ned Deily
Ned Deily n...@acm.org added the comment: I also can verify that the problem is not reproducible using a current trunk (2.7) and the 10.6 Apple Tk 8.5.7. Further testing of this issue with both Apple Tk 8.4.x and ActiveState Tk 8.4.19 on 10.4, 10.5, and 10.6 has been hang-free. It looks

[issue5120] Disabling test_ttk_guionly on mac

2009-09-21 Thread Ned Deily
Ned Deily n...@acm.org added the comment: I noticed this while investigating Issue6834. Is this still an open issue for OS X? Could it explain the symptoms in 6834? -- nosy: +ned.deily, ronaldoussoren ___ Python tracker rep...@bugs.python.org

[issue5120] Disabling test_ttk_guionly on mac

2009-09-21 Thread Ned Deily
Ned Deily n...@acm.org added the comment: Sorry, that should be Issue6864. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5120 ___ ___

[issue1766304] improve xrange.__contains__

2009-09-21 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Robert, The patch looks good: thank you. Please use C89-style comments (/* ... */). I'd like to see a few more tests covering the various combinations of start less-than/equal-to/greater-than stop, step positive/negative, tested value

[issue1766304] improve xrange.__contains__

2009-09-21 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Also, it would be good to add a test or two for non-integers, e.g. to make explicit that the following behaviour hasn't changed: class C: ... def __int__(self): return 3 ... def __index__(self): return 5 ... def __eq__(self,

[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

2009-09-21 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: New patch for gamma , with some tweaks: - return exact values for integral arguments: gamma(1) through gamma(23) - apply a cheap correction to improve accuracy of exp and pow computations - use a different form of the reflection

[issue6956] Test creation in unittest.TestProgram should be done in one place

2009-09-21 Thread Michael Foord
New submission from Michael Foord mich...@voidspace.org.uk: Requested by Fernando Perez on the Testing in Python mailing list. Test creation in TestProgram is done in both parseArgs and createTests. It would be better if it was only done in createTests so that controlling test creation only

[issue6957] Extension modules fail to build on OS X 10.6 using python.org 2.x/3.x

2009-09-21 Thread Ned Deily
New submission from Ned Deily n...@acm.org: Potential 2.6.3 release blocker On OS X 10.6 (Snow Leopard), if you attempt to install a package with a extension module using a Python from a python.org OS X installer (say, 2.6.x or 3.1.x), the c compilation steps will likely fail in one of two

[issue6952] deprecated conversion from string constant to char *

2009-09-21 Thread Trundle
Trundle andy-pyt...@hammerhartes.de added the comment: See also issue #1699259. -- nosy: +Trundle ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6952 ___

[issue6957] Extension modules fail to build on OS X 10.6 using python.org 2.x/3.x

2009-09-21 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6957 ___ ___ Python-bugs-list mailing list

[issue6958] Add Python command line flags to configure logging

2009-09-21 Thread Thomas Heller
New submission from Thomas Heller thel...@ctypes.org: I want the Python executable to have command line flags which allow simple configuration of the logging module. Use cases are to run applications/scripts (which use libraries that use logging calls) with different logging output without

[issue6952] deprecated conversion from string constant to char *

2009-09-21 Thread Sebastian Ramacher
Changes by Sebastian Ramacher sebasti...@users.sourceforge.net: -- nosy: +sebastinas ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6952 ___ ___

  1   2   >