Re: Fibonacci series recursion error

2011-04-30 Thread Steven D'Aprano
On Sat, 30 Apr 2011 08:32:55 +0200, Peter Otten wrote: > harrismh777 wrote: > >> Ian Kelly wrote: >>> since the fact is that if >>> the function were properly coded, the call stack for fib(20) would >>> never be more than 20 entries deep at any one time. >>> >>> >> Not so much... and much more !.

Re: Fibonacci series recursion error

2011-04-30 Thread harrismh777
Peter Otten wrote: I don't understand what you are trying to say -- but it's wrong;) ... that was the point!:-)) -- http://mail.python.org/mailman/listinfo/python-list

Re: Development tools and practices for Pythonistas

2011-04-30 Thread Hans Georg Schaathun
On Fri, 29 Apr 2011 20:21:58 -0700 (PDT), CM wrote: : While we're on the topic, when should a lone developer bother to start : using : a VCS? At what point in the complexity of a project (say a hobby : project, but : a somewhat seriousish one, around ~5-9k LOC) is the added complexity : o

Re: Fibonacci series recursion error

2011-04-30 Thread harrismh777
Peter Otten wrote: For the record, the one true way to implement the Fibonacci series in Python is >>> def fib(): ... a = b = 1 ... while True: ... yield a ... a, b = b, a+b # look ma, no temporary variable [snip] I created two scripts, stressed them a bit,

Re: Installing programs that depend on, or are, python extensions.

2011-04-30 Thread Miki Tebeka
I used py2exe and InnoSetup in the past for various Python project, always with great success. What is the process that you are following? -- http://mail.python.org/mailman/listinfo/python-list

Re: Aborting Python from C code

2011-04-30 Thread Miki Tebeka
> In our sandboxed Python environment, I would like to be able to > trigger an abort of the currently-running Python script (from a signal > handler or another thread). There's os.abort -- http://mail.python.org/mailman/listinfo/python-list

Re: Aborting Python from C code

2011-04-30 Thread Chris Angelico
On Sat, Apr 30, 2011 at 6:08 PM, Miki Tebeka wrote: >> In our sandboxed Python environment, I would like to be able to >> trigger an abort of the currently-running Python script (from a signal >> handler or another thread). > There's os.abort That core dumps the process; what I want is to force t

Re: Fibonacci series recursion error

2011-04-30 Thread Thomas Rachel
Am 30.04.2011 09:43 schrieb harrismh777: On the other hand, I am very much interested in "yield," because of its obvious persistent state, On the other hand, I don't like you fib() function because it does not encapsulate the fib generator. I suppose you are considering whatever module is holdin

Re: Deditor

2011-04-30 Thread jmfauth
On 29 avr, 23:01, Kruptein wrote: > On 29 apr, 20:25, jmfauth wrote: > > > > > On 28 avr, 22:16, Kruptein wrote: > > > > On 28 apr, 07:46, jmfauth wrote: > > > > > On 27 avr, 19:22, Alec Taylor wrote: > > > > > > Thanks, any plans for a Windows version? > > > > > - Download the deb > > > > - U

Re: Installing programs that depend on, or are, python extensions.

2011-04-30 Thread David Cournapeau
On Sat, Apr 30, 2011 at 2:19 PM, James A. Donald wrote: > I have noticed that installing python programs tends to be hell, > particularly under windows, and installing python programs that rely > on, or in large part are, python extensions written in C++ tends to be > hell on wheels with large spi

how to do random / SystemRandom switch

2011-04-30 Thread Matthias Kievernagel
Dear list, In my top-level script I want to select if my program is to use random.xxx functions or the random.SystemRandom.xxx ones. All the other modules shouldn't know about that switch and simply use import random ... return random.randint(1, 6) ... for example. In C I would do a simil

Re: Development tools and practices for Pythonistas

2011-04-30 Thread Martin Schöön
On 2011-04-30, Hans Georg Schaathun wrote: > On Fri, 29 Apr 2011 20:21:58 -0700 (PDT), CM > wrote: >: While we're on the topic, when should a lone developer bother to start >: using >: a VCS? At what point in the complexity of a project (say a hobby >: project, but >: a somewhat seriousish

Re: Aborting Python from C code

2011-04-30 Thread Dylan Evans
I think i see what you are trying to do but it depends on the environment and your goals. Generally i think you need to separate your code by forking (or perhaps you have already done that?), then you can run a check to see if the process died as expected. I don't know though, this not much inform

Re: Fibonacci series recursion error

2011-04-30 Thread Thomas Rachel
Am 30.04.2011 07:35, schrieb harrismh777: Ian Kelly wrote: since the fact is that if the function were properly coded, the call stack for fib(20) would never be more than 20 entries deep at any one time. Not so much... and much more ! ... because each recursion level 'return' calls fib()

Re: Zope with mySQL

2011-04-30 Thread Tony
Could you provide more details of what you are trying to do and what help you need? On 28/04/11 20:19, harryjatt wrote: > > Hi, i am doing web development with Zope. My connected database is mySQL. I > am new to this combination.I have to upload the files to mySQL with > programming in zope and t

wxPython - Tools for creating docs for wxPython App

2011-04-30 Thread R . Faxli
Hi, what are the "canonical" tools for the creation of docs for a wxPython based application? Thanx R -- http://mail.python.org/mailman/listinfo/python-list

Re: Fibonacci series recursion error

2011-04-30 Thread Hans Georg Schaathun
On Sat, 30 Apr 2011 06:43:42 +0100, Paul Rudin wrote: : Writing recurive code is acceptable and is a nice clear way of : expressing things when you have naturally recursive data structures, and : can lead to perfectly good compiled code. The problem in CPython is the : lack of tail optimizat

Re: Zope with mySQL

2011-04-30 Thread harryjatt
thanks for the reply. I am doing web development with Zope which is connected to mySQL. my project is that my customer will upload files(with some logical title) and his clients will download that files on their computer.It is my first project.please let meknow if you need further details. i will

Re: Fibonacci series recursion error

2011-04-30 Thread Paul Rudin
Hans Georg Schaathun writes: > On Sat, 30 Apr 2011 06:43:42 +0100, Paul Rudin >wrote: > : Writing recurive code is acceptable and is a nice clear way of > : expressing things when you have naturally recursive data structures, and > : can lead to perfectly good compiled code. The problem in

Re: how to do random / SystemRandom switch

2011-04-30 Thread Thomas Rachel
Am 30.04.2011 11:10 schrieb Matthias Kievernagel: In my top-level script I want to select if my program is to use random.xxx functions or the random.SystemRandom.xxx ones. On which criteria do you fix that? Anyway, you could use a module myrandom.py: import random if use_sys: randobj =

Re: how to do random / SystemRandom switch

2011-04-30 Thread Peter Otten
Matthias Kievernagel wrote: > In my top-level script I want to select if my program > is to use random.xxx functions or the random.SystemRandom.xxx > ones. All the other modules shouldn't know about that > switch and simply use > import random > ... > return random.randint(1, 6) > ... > for exampl

Re: how to do random / SystemRandom switch

2011-04-30 Thread Matthias Kievernagel
Peter Otten <__pete...@web.de> wrote: > Matthias Kievernagel wrote: > >> In my top-level script I want to select if my program >> is to use random.xxx functions or the random.SystemRandom.xxx >> ones. All the other modules shouldn't know about that >> switch and simply use >> import random >> ...

Re: Fibonacci series recursion error

2011-04-30 Thread Hans Georg Schaathun
On Sat, 30 Apr 2011 12:29:00 +0100, Paul Rudin wrote: : Clearly it makes a difference in any case where you'd hit the recursion : limit. What kind of problems make you hit the limit? Other than when you forget the base case, I mean. : It's no big deal to do your own unwinding of th

Re: [OT] VCS for non-text (was Development tools and practices for Pythonistas)

2011-04-30 Thread Tim Chase
On 04/30/2011 04:15 AM, Martin Schöön wrote: You guys are very code focused, which is natural given where we are. Having absorbed what I have seen here, looked a little at Mercurial, read a little on the webs of Fossil and Bazaar I start to think there is great merit in all this VCS stuff for ot

ANN: Sixth Pyggy Awards

2011-04-30 Thread Gregory Ewing
Registrations are now open for the Sixth Pyggy Awards. Judging will be from 17-31 July 2011. http://pyggy.pyweek.org/ This time, entry is open to any Python-based game, not just PyWeek games, and not just games developed during PyWeek or Pyggy. So if you've had a Python game project on the ba

Re: Fibonacci series recursion error

2011-04-30 Thread Paul Rudin
Hans Georg Schaathun writes: > On Sat, 30 Apr 2011 12:29:00 +0100, Paul Rudin >wrote: > : Clearly it makes a difference in any case where you'd hit the recursion > : limit. > > What kind of problems make you hit the limit? > > Other than when you forget the base case, I mean. Anytime you h

Re: Fibonacci series recursion error

2011-04-30 Thread Peter Otten
harrismh777 wrote: > Peter Otten wrote: >> For the record, the one true way to implement the Fibonacci series in >> Python is >> > >>> def fib(): >> ... a = b = 1 >> ... while True: >> ... yield a >> ... a, b = b, a+b # look ma, no temporary variable > > [snip

mrjob v0.2.5 released

2011-04-30 Thread Jimmy Retzlaff
What is mrjob? --- mrjob is a Python package that helps you write and run Hadoop Streaming jobs. mrjob fully supports Amazon's Elastic MapReduce (EMR) service, which allows you to buy time on a Hadoop cluster on an hourly basis. It also works with your own Hadoop cluster. Som

Re: Zope with mySQL

2011-04-30 Thread Thomas 'PointedEars' Lahn
harryjatt wrote: > Hi, i am doing web development with Zope. My connected database is mySQL. > I am new to this combination.I have to upload the files to mySQL with > programming in zope and then downloading them via zope.Can you help me in > this regard? Perhaps. > I will be very thankfull to y

ctypes and twain_32.dll

2011-04-30 Thread Patrick Vrijlandt
Hi, I'm trying to access TWAIN from python 3.2 on Vista, using ctypes. I'm stuck at line 2: PythonWin 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)] on win32. >>> from ctypes import * >>> windll.twain_32 Traceback (most recent call last): File "", line 1, in File "C:\Pyth

Python competitions and learnings

2011-04-30 Thread Alexander Lyabah
Hi. My name is Alexander. I spend a lot of time in writing a new service checkio.org It's all about python, learn python, find the best solution in python. And Im looking for feedback from peoples who best in python. Here I make some video tutorial about this service http://checkio.blip.tv/ What

Re: Deditor

2011-04-30 Thread Kruptein
On 30 apr, 10:30, jmfauth wrote: > On 29 avr, 23:01, Kruptein wrote: > > > > > > > On 29 apr, 20:25, jmfauth wrote: > > > > On 28 avr, 22:16, Kruptein wrote: > > > > > On 28 apr, 07:46, jmfauth wrote: > > > > > > On 27 avr, 19:22, Alec Taylor wrote: > > > > > > > Thanks, any plans for a Windo

Re: Fibonacci series recursion error

2011-04-30 Thread harrismh777
Thomas Rachel wrote: You can have both with the following: def fib(max=None): a = b = 1 while max is None or a <= max: yield a a, b = b, a+b from itertools import islice flist = list(islice(fib(), 10)) flist2 = list(fib(10)) Yes, yes, yes... but what

Re: Fibonacci series recursion error

2011-04-30 Thread harrismh777
Peter Otten wrote: > But, this should also go to show you... that there is*never* just > one obvious way to do anything... contrary to the ZEN of Python...;-) I take that as an indication that you are not Dutch;) True enough... American Irish - mostly... :-} -- http://mail.pyth

Re: (beginner) logging config not working

2011-04-30 Thread Unknown Moss
On Apr 29, 10:09 pm, Peter Otten <__pete...@web.de> wrote: > Unknown Moss wrote: > > Hi > > > This is a beginner question. Thanks for the hand. > > > I've been asked to maintain some poorly constructed python code. > > Logging is weak. Getting it to work with python logging > > programmatically was

Re: (beginner) logging config not working

2011-04-30 Thread Unknown Moss
On Apr 29, 10:09 pm, Peter Otten <__pete...@web.de> wrote: > Unknown Moss wrote: > > Hi > > > This is a beginner question. Thanks for the hand. > > > I've been asked to maintain some poorly constructed python code. > > Logging is weak. Getting it to work with python logging > > programmatically was

Re: Python competitions and learnings

2011-04-30 Thread Terry Reedy
On 4/30/2011 3:22 PM, Alexander Lyabah wrote: I spend a lot of time in writing a new service checkio.org It's all about python, learn python, find the best solution in python. And Im looking for feedback from peoples who best in python. Here I make some video tutorial about this service http:/

Re: Python competitions and learnings

2011-04-30 Thread harrismh777
Terry Reedy wrote: And Im looking for feedback from peoples who best in python. Here I make some video tutorial about this service http://checkio.blip.tv/ What do you think about it? Pretty impressive. My main disappointment is that you are using 2.7 instead of 3.2, as I feel that beginners

Re: Fibonacci series recursion error

2011-04-30 Thread Jayme Proni Filho
I tested your function. So You must remeber: By definition, the first two Fibonacci numbers are 0 and 1, and each subsequent number is the sum of the previous two. Some sources omit the initial 0, instead beginning the sequence with two 1s. In math terms it means: F(n) = F(n - 1) + F(n - 2) I di

Re: Python competitions and learnings

2011-04-30 Thread harrismh777
Alexander Lyabah wrote: What do you think about it? I'm also have a not a very good English, so I need help with it too, Alexander, your site is very interesting. I spent some time this afternoon appreciating your work. Nice job. Be encouraged, your English is much better than my Russian! I

Re: Development tools and practices for Pythonistas

2011-04-30 Thread Ben Finney
Roy Smith writes: > No need to use VCS at the very beginning of a project. You can easily > wait until you've written 10 or 20 lines of code :-) +1 QOTW > > Should I bother to try a VCS? > > Absolutely. Even if you don't need it for a small one-person project, > it's a good habit to get into.

Re: Development tools and practices for Pythonistas

2011-04-30 Thread Shawn Milochik
For what it's worth, the Python core developers have selected Mercurial. I personally use git and love it. Most open-source people seem to use one or the other of the two. They're pretty similar in most ways. Look at the big two sites for open-source repositories -- github and bitbucket. One's

click

2011-04-30 Thread DINESH PATIL
http://123maza.com/65/born511/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Zope with mySQL

2011-04-30 Thread harryjatt
SORRY, i think that you are not happy with my elaboration. I am trying to generate a code for uploading and downloading the pdf files to mysql by web application through zope. but i can not make it right. I want your assistance in this. Tony Middleton wrote: > > Could you provide more details of