Re: Fibonacci series recursion error

2011-05-02 Thread Hans Georg Schaathun
On Mon, 2 May 2011 06:49:41 +1000, Chris Angelico ros...@gmail.com wrote: : Sure. Serialize this Python object in a way that can be given to, say, PHP: : foo={asdf:qwer,zxcv:1234}; foo[self]=[1,2,3,foo] : Recurse from self into the list, recurse from there into a : dictionary... Okay, that's

Re: Fibonacci series recursion error

2011-05-02 Thread Chris Angelico
On Mon, May 2, 2011 at 3:36 PM, Hans Georg Schaathun h...@schaathun.net wrote: On Mon, 2 May 2011 06:49:41 +1000, Chris Angelico  ros...@gmail.com wrote: :  Sure. Serialize this Python object in a way that can be given to, say, PHP: :  foo={asdf:qwer,zxcv:1234}; foo[self]=[1,2,3,foo]

Re: Fibonacci series recursion error

2011-05-02 Thread Chris Angelico
On Mon, May 2, 2011 at 4:28 PM, Chris Angelico ros...@gmail.com wrote: reduce(`*,range(1,n+1)) reduce(`*,xrange(1,n+1)) Whoops, forgot which language I was using. Back-tick functions not being available, these need to be: reduce(operator.mul,range(1,n+1)) reduce(operator.mul,xrange(1,n+1))

Re: Py_INCREF() incomprehension

2011-05-02 Thread Hegedüs , Ervin
hello, Thomas, Gregory, thank you for your ansrwers, I guess this is the point where yo should start printf programing. oh', already done :) * What happens during module initialization? successfully initialized, * What happens n the functions? * Where does the stuff fail? * What are

Re: Compile 32bit C-lib on 64 bit

2011-05-02 Thread Hegedüs , Ervin
Hello, thanks for all reply, On Mon, May 02, 2011 at 03:20:40AM +0100, Nobody wrote: You need to build your module for a 32-bit version of Python. ok, I believed it, I was hoping there is another solution, On a 64-bit system, each process is either 32-bit or 64-bit process. You can't mix

Re: Py_INCREF() incomprehension

2011-05-02 Thread Stefan Behnel
Hegedüs, Ervin, 02.05.2011 08:41: Thomas, I guess this is the point where yo should start printf programing. oh', already done :) FWIW, Cython 0.14+ has special support for gdb now, so, in addition to print and printf debugging, you can also use gdb to explore the state of your

Re: Development tools and practices for Pythonistas

2011-05-02 Thread Algis Kabaila
On Monday 02 May 2011 13:22:44 Ben Finney wrote: rusi rustompm...@gmail.com writes: You may want to look at rcs if you are in the space where But today, Bazaar or Mercurial fill that role just as well: quick simple set up, good tool support (yes, even in Emacs using VC mode), and easy to

Re: Fibonacci series recursion error

2011-05-02 Thread rusi
On Apr 30, 11:14 am, Peter Otten __pete...@web.de 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 Not any claim

Re: Development tools and practices for Pythonistas

2011-05-02 Thread rusi
On May 2, 12:08 pm, Algis Kabaila akaba...@pcug.org.au wrote: Actually, Bazaar is more convenient than rcs for a single user, as the repository can be the working directory (with a hidden .bzr directory that stores diffs).   Dont exactly understand... Is it that you want it specifically

Re: PIL Question

2011-05-02 Thread nirinA raseliarison
[PyNewbie] Question: I can't seem to find the captured image, where does it go? for me, it just goes to the current working directory: $ python -i Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type help, copyright, credits or license for more

Re: Development tools and practices for Pythonistas

2011-05-02 Thread Algis Kabaila
On Monday 02 May 2011 17:19:57 rusi wrote: On May 2, 12:08 pm, Algis Kabaila akaba...@pcug.org.au wrote: Actually, Bazaar is more convenient than rcs for a single user, as the repository can be the working directory (with a hidden .bzr directory that stores diffs). Dont exactly

Re: What other languages use the same data model as Python?

2011-05-02 Thread Jorgen Grahn
On Sun, 2011-05-01, Terry Reedy wrote: On 5/1/2011 4:45 AM, Steven D'Aprano wrote: ... What other languages use the same, or mostly similar, data model as Python? Natural languages. That is why I think it is better to think of Python as an algorithm language or information-object

build the sql where cause dynamic

2011-05-02 Thread christian
Hi, from some radio buttons in a django app i concat string like that: But have no idea how i get the or when there different values for a specified p column (# is currently my intended splitter maybe i can concat a better input?). input: p2=1#p2=2#p1=3#p1=1#p1=5#pc=1#py=1 output: p2 in

Re: build the sql where cause dynamic

2011-05-02 Thread Chris Angelico
On Mon, May 2, 2011 at 5:48 PM, christian oz...@web.de wrote: Hi, from some radio buttons in a django app i concat  string like that: But have no idea how i get the or when there different values for a specified p column (# is currently my intended splitter maybe i can concat a better

Re: How to build an application in Django which will handle Multiple servers accross network

2011-05-02 Thread Anurag Agarwal
Hi All, Thanks for the resposes. I think I was not able to communicate my problem very well. Here I am not managing any network devices, what i am doing is getting some info from various servers on netowrk. I don't know how to explain what kind of info is needed, but for the time if you just

HI

2011-05-02 Thread anvar
Hello, Could you please help me with the modeling in Python the following problem: (e.g., g_t means g with index t) Min∑_(i=1)^n▒∑_(t=1)^l▒[s_i (t)-min[s ̂_i (t)×α_t×exp(g_t ),C_i (t) ] ]^2 subject to s_i (t)=f_i (t)[S_i+f_(i-1) (t)[S_(i-1)+f_(i-2) (t)[S_(i-2)+⋯f_2 (t) [S_2+f_1 (t) S_1 ]…] ]

Re: HI

2011-05-02 Thread anvar
Here we need to estimate p_i, q_i, and β. Thank you, Min∑_(i=1)^n▒∑_(t=1)^l▒[s_i (t)-min[s ̂_i (t)×α_t×exp(g_t ),C_i (t) ] ]^2 subject to s_i (t)=f_i (t)[S_i+f_(i-1) (t)[S_(i-1)+f_(i-2) (t)[S_(i-2)+⋯f_2 (t) [S_2+f_1 (t) S_1 ]…] ] ][1-f_(i+1) (t)] f_i (t)=F_i (t)-F_i (t-1) F_i

Re: Fibonacci series recursion error

2011-05-02 Thread rusi
On Apr 30, 12:18 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: The number of calls is given by a recursive function with a similar form as that of Fibonacci. As far as I know, it doesn't have a standard name, but I'll call it R(n): R(n) = R(n-1) + R(n-2) + 1, where R(0) =

Re: Compile 32bit C-lib on 64 bit

2011-05-02 Thread Jorgen Grahn
On Sun, 2011-05-01, Hegedüs Ervin wrote: Hello, this is not a clear Python question - I've wrote a module in C, which uses a 3rd-party lib - it's a closed source, I just get the .so, .a and a header file. Looks like it works on 32bit (on my desktop), but it must be run on 64bit servers.

Re: What other languages use the same data model as Python?

2011-05-02 Thread Duncan Booth
Dennis Lee Bieber wlfr...@ix.netcom.com wrote: As I recall from my programming language design class (only and intro, it was so small we met in a meeting room rather than classroom), ALGOL was described as call by name; It is true that Algol had 'call by name', but (at least the Algol-W that

Re: Fibonacci series recursion error

2011-05-02 Thread Steven D'Aprano
On Mon, 02 May 2011 01:27:39 -0700, rusi wrote: On Apr 30, 12:18 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: The number of calls is given by a recursive function with a similar form as that of Fibonacci. As far as I know, it doesn't have a standard name, but I'll call

Re: Development tools and practices for Pythonistas

2011-05-02 Thread jacek2v
On May 2, 9:48 am, Algis Kabaila akaba...@pcug.org.au wrote: On Monday 02 May 2011 17:19:57 rusi wrote: On May 2, 12:08 pm, Algis Kabaila akaba...@pcug.org.au wrote: Actually, Bazaar is more convenient than rcs for a single user, as the repository can be the working directory (with a

codec for UTF-8 with BOM

2011-05-02 Thread Ulrich Eckhardt
Hi! I want to write a file starting with the BOM and using UTF-8, and stumbled across some problems: 1. I would have expected one of the codecs to be 'UTF-8 with BOM' or something like that, but I can't find the correct name. Also, I can't find a way to get a list of the supported codecs at

Re: Deditor

2011-05-02 Thread Alec Taylor
Yes On Mon, May 2, 2011 at 2:12 AM, Kruptein darragh@gmail.com wrote: On 1 mei, 17:50, Alec Taylor alec.tayl...@gmail.com wrote: Traceback (most recent call last):  File O:\deditor\deditor\deditor.py, line 7, in modul e    import wx, os, datetime, sys, ConfigParser, wx.aui,

Re: codec for UTF-8 with BOM

2011-05-02 Thread Chris Rebert
On Mon, May 2, 2011 at 1:34 AM, Ulrich Eckhardt ulrich.eckha...@dominolaser.com wrote: Hi! I want to write a file starting with the BOM and using UTF-8, and stumbled across some problems: 1. I would have expected one of the codecs to be 'UTF-8 with BOM' or something like that, but I can't

Re: Fibonacci series recursion error

2011-05-02 Thread Hans Georg Schaathun
On 02 May 2011 01:09:21 GMT, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: : Ah, I see where you're coming from now! You think I'm arguing *against* : the use of recursion. Not at all. Earlier in this thread, I said: Fair enough. Somebody said something about recursion mainly

Re: Fibonacci series recursion error

2011-05-02 Thread Hans Georg Schaathun
On 02 May 2011 08:56:57 GMT, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: : I see your smiley, but there are a number of similar series as Fibonacci, : with the same recurrence but different starting values, or similar but : slightly different recurrences. E.g. Lucas,

Re: codec for UTF-8 with BOM

2011-05-02 Thread John Machin
On Monday, 2 May 2011 19:47:45 UTC+10, Chris Rebert wrote: On Mon, May 2, 2011 at 1:34 AM, Ulrich Eckhardt ulrich@dominolaser.com wrote: The correct name, as you found below and as is corroborated by the webpage, seems to be utf_8_sig: uFOøbar.encode('utf_8_sig')

Re: build the sql where cause dynamic

2011-05-02 Thread christian
On 2 Mai, 10:13, Chris Angelico ros...@gmail.com wrote: On Mon, May 2, 2011 at 5:48 PM, christian oz...@web.de wrote: Hi, from some radio buttons in a django app i concat  string like that: But have no idea how i get the or when there different values for a specified p column (# is

Re: Development tools and practices for Pythonistas

2011-05-02 Thread Algis Kabaila
On Monday 02 May 2011 19:09:38 jacek2v wrote: On May 2, 9:48 am, Algis Kabaila akaba...@pcug.org.au wrote: On Monday 02 May 2011 17:19:57 rusi wrote: On May 2, 12:08 pm, Algis Kabaila akaba...@pcug.org.au wrote: Actually, Bazaar is more convenient than rcs for a single user, as

Re: Fibonacci series recursion error

2011-05-02 Thread rusi
On May 2, 2:53 pm, Hans Georg Schaathun h...@schaathun.net wrote: On 02 May 2011 08:56:57 GMT, Steven D'Aprano  steve+comp.lang.pyt...@pearwood.info wrote: :  I see your smiley, but there are a number of similar series as Fibonacci, :  with the same recurrence but different starting values,

Re: codec for UTF-8 with BOM

2011-05-02 Thread Ulrich Eckhardt
Chris Rebert wrote: 3. The docs mention encodings.utf_8_sig, available since 2.5, but I can't locate that thing there either. What's going on here? Works for me™: Python 2.6.6 (r266:84292, Jan 12 2011, 13:35:00) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type help, copyright, credits or

Re: HI

2011-05-02 Thread Ulrich Eckhardt
anvar wrote: Could you please help me with the modeling in Python the following problem: (e.g., g_t means g with index t) Typically, you would use either a list or a dict to simulate something like that: # list g = [1, 2, 4, 8, 16] print g[3] # dictionary h = {} h[0] = 1 h[1] =

Re: codec for UTF-8 with BOM

2011-05-02 Thread Peter Otten
Ulrich Eckhardt wrote: Chris Rebert wrote: 3. The docs mention encodings.utf_8_sig, available since 2.5, but I can't locate that thing there either. What's going on here? Works for me™: Python 2.6.6 (r266:84292, Jan 12 2011, 13:35:00) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type

Re: Fibonacci series recursion error (slightly OT)

2011-05-02 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Chris Angelico wrote: On Mon, May 2, 2011 at 3:36 PM, Hans Georg Schaathunh...@schaathun.net wrote: On Mon, 2 May 2011 06:49:41 +1000, Chris Angelico ros...@gmail.com wrote: : Sure. Serialize this Python object in a way that can be given to, say, PHP: :

Re: HI

2011-05-02 Thread Jean-Michel Pichavant
anvar wrote: Hello, Could you please help me with the modeling in Python the following problem: (e.g., g_t means g with index t) Min∑_(i=1)^n▒∑_(t=1)^l▒[s_i (t)-min[s ̂_i (t)×α_t×exp(g_t ),C_i (t) ] ]^2 subject to s_i (t)=f_i (t)[S_i+f_(i-1) (t)[S_(i-1)+f_(i-2) (t)[S_(i-2)+⋯f_2 (t) [S_2+f_1

Re: What other languages use the same data model as Python?

2011-05-02 Thread Grant Edwards
On 2011-05-02, Jorgen Grahn grahn+n...@snipabacken.se wrote: On Sun, 2011-05-01, Terry Reedy wrote: On 5/1/2011 4:45 AM, Steven D'Aprano wrote: ... What other languages use the same, or mostly similar, data model as Python? Natural languages. That is why I think it is better to think of

Re: HI

2011-05-02 Thread anvar
Dear Ulrich Eckhardt and Jean-Michel Pichavant! First of all thank you for your attention. I'have never expected to receive response. Actually, I am doing my internship in Marketing Division in small company., I got this assignment yesterday morning. My boss wants perfect technology diffusion

Re: Fibonacci series recursion error

2011-05-02 Thread Hans Georg Schaathun
On Sun, 01 May 2011 18:24:30 -0400, Terry Reedy tjre...@udel.edu wrote: : This does not make linear recursion 'bad', just impractical for general : use on finite-memory machines. While I consider it very useful for : learning, it is unnecessary because it is easy to write an iterative :

Development software

2011-05-02 Thread Petey
Hi! I'm new to programming. I started with php earlier and I dropped it for Python. I use Eclipse+PyDev for python, html and css. Which programmes should I start using because they might be useful in the future? Which functions of eclipse are useful but unused/unnoticed by beginners. What do

Re: Python competitions and learnings

2011-05-02 Thread Alexander Lyabah
On May 1, 7:22 pm, Alexander Lyabah alexan...@lyabah.com wrote: On May 1, 3:26 am, harrismh777 harrismh...@charter.net wrote: 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

Re: Fibonacci series recursion error

2011-05-02 Thread Steven D'Aprano
On Mon, 02 May 2011 10:53:52 +0100, Hans Georg Schaathun wrote: On 02 May 2011 08:56:57 GMT, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: : I see your smiley, but there are a number of similar series as Fibonacci, : with the same recurrence but different starting values, or

Re: Python competitions and learnings

2011-05-02 Thread Alexander Lyabah
On May 2, 1:33 am, Terry Reedy tjre...@udel.edu wrote: On 5/1/2011 12:49 PM, Alexander Lyabah wrote: And what do you think about Score Games and competitions? The rules of the first score game were not clear to me. I could not figure out how to play it interactively myself so I could see

Re: Fibonacci series recursion error

2011-05-02 Thread Steven D'Aprano
On Mon, 02 May 2011 14:14:20 +0100, Hans Georg Schaathun wrote: On Sun, 01 May 2011 18:24:30 -0400, Terry Reedy tjre...@udel.edu wrote: : This does not make linear recursion 'bad', just impractical for general : use on finite-memory machines. While I consider it very useful for :

setup.py rebuilds EVERYTHING on windows?

2011-05-02 Thread Mathew
Hi I'm trying to build an extension (spice-0.12) on windows. Whenever I change a single file, everything gets rebuilt. ?? Python2.7.1 Windows XP Visual Studio 9 setuptools 0.6c11 -Mathew -- http://mail.python.org/mailman/listinfo/python-list

Re: Composition instead of inheritance

2011-05-02 Thread Alan Meyer
On 4/28/2011 1:15 PM, Ethan Furman wrote: For anybody interested in composition instead of multiple inheritance, I have posted this recipe on ActiveState (for python 2.6/7, not 3.x): http://code.activestate.com/recipes/577658-composition-of-classes-instead-of-multiple-inherit/ Comments

Coolest Python recipe of all time

2011-05-02 Thread Raymond Hettinger
I think it is time to give some visibility to some of the instructive and very cool recipes in ActiveState's python cookbook. My vote for the coolest recipe of all time is: http://code.activestate.com/recipes/365013-linear-equations-solver-in-3-lines/ What are your favorites? Raymond

Re: setup.py rebuilds EVERYTHING on windows?

2011-05-02 Thread Stefan Behnel
Mathew, 02.05.2011 18:45: I'm trying to build an extension (spice-0.12) on windows. Whenever I change a single file, everything gets rebuilt. Did you report this to the authors? I suppose there's a project mailing list? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Development tools and practices for Pythonistas

2011-05-02 Thread Dietmar Schwertberger
Am 02.05.2011 01:33, schrieb David Boddie: After noting the warnings it contains, see the following page for a description of the Python API for Mercurial: http://mercurial.selenic.com/wiki/MercurialApi Ah, yes, no need to use os.sytem(), but all in all not much difference from doing so

Re: Running a script with command line arguments

2011-05-02 Thread MRAB
Hi, I'm new to python and trying to run a borrowed script. The error I get suggests that I need to give a proper command to run it. The input file is c26_1plus.csv and the intended output file is c26_1plus_backbone.csv. Can anyone help? The usage string in the script says that the

Re: Fibonacci series recursion error

2011-05-02 Thread Terry Reedy
On 5/2/2011 9:14 AM, Hans Georg Schaathun wrote: On Sun, 01 May 2011 18:24:30 -0400, Terry Reedy : Python does not do this automatically because 1) it can be a semantic : change under some circumstances; 2) one who wants the iterative version : can just as easily write it directly; That's

Re: ctypes and twain_32.dll

2011-05-02 Thread Michel Claveau - MVP
Hi! On my system, thera are not twain32.dll or twain_32.dll, but twain.dll @+ -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

raise (type, value, traceback) and raise type, value, traceback

2011-05-02 Thread Jack Bates
Hi, anyone know why these two statements aren't equivalent? raise (type, value, traceback) raise type, value, traceback -- http://mail.python.org/mailman/listinfo/python-list

Re: raise (type, value, traceback) and raise type, value, traceback

2011-05-02 Thread Ian Kelly
On Mon, May 2, 2011 at 11:23 AM, Jack Bates ms...@freezone.co.uk wrote: Hi, anyone know why these two statements aren't equivalent? raise (type, value, traceback) raise type, value, traceback The latter is the syntax of the raise statement: up to 3 expressions, separated by commas. The

Pushing for Pythoncard 1.0

2011-05-02 Thread John Henry
Attempt to push Pythoncard to a 1.0 status is now underway. A temporary website has been created at: http://code.google.com/p/pythoncard-1-0/ The official website continues to be http://pythoncard.sourceforge.net/ Pythoncard is such a wonderful package that it would be a shame to allow

Re: Fibonacci series recursion error

2011-05-02 Thread Hans Georg Schaathun
On 02 May 2011 16:41:37 GMT, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: : You must be new to the Internet then :) OK. Maybe I heard something worse last time I was an active news users, years ago. Anyway, most of the silly things I hear do not qualify as arguments :-) :

Re: Coolest Python recipe of all time

2011-05-02 Thread David Monaghan
On Mon, 2 May 2011 10:33:31 -0700 (PDT), Raymond Hettinger pyt...@rcn.com wrote: I think it is time to give some visibility to some of the instructive and very cool recipes in ActiveState's python cookbook. My vote for the coolest recipe of all time is:

Re: Coolest Python recipe of all time

2011-05-02 Thread Ian Kelly
On Mon, May 2, 2011 at 2:48 PM, David Monaghan monaghand.da...@gmail.com wrote: On Mon, 2 May 2011 10:33:31 -0700 (PDT), Raymond Hettinger pyt...@rcn.com wrote: I think it is time to give some visibility to some of the instructive and very cool recipes in ActiveState's python cookbook. My vote

Re: Fibonacci series recursion error

2011-05-02 Thread Mark Dickinson
On May 2, 5:24 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: As far as I'm concerned, there are only two definitions of Fibonacci numbers that have widespread agreement in the mathematical community: 0,1,1,2,3 ... (starting from n=0) 1,1,2,3,5 ... (starting from n=1) Any

Re: Coolest Python recipe of all time

2011-05-02 Thread David Monaghan
On Mon, 2 May 2011 14:58:50 -0600, Ian Kelly ian.g.ke...@gmail.com wrote: On Mon, May 2, 2011 at 2:48 PM, David Monaghan monaghand.da...@gmail.com wrote: On Mon, 2 May 2011 10:33:31 -0700 (PDT), Raymond Hettinger pyt...@rcn.com wrote: I think it is time to give some visibility to some of the

Re: Fibonacci series recursion error

2011-05-02 Thread harrismh777
Thomas Rachel wrote: ... because each recursion level 'return' calls fib() twice, and each of those calls fib() twice, and you get the point... yes - but they are called one after the other, so the twice call counts only for execution speed, not for recursion depth. def fib(n): if n ==

Re: Fibonacci series recursion error

2011-05-02 Thread Chris Angelico
On Mon, May 2, 2011 at 11:14 PM, Hans Georg Schaathun h...@schaathun.net wrote: That's the silliest argument I ever heard.  The programmer should write the code the way he and application domain experts think, i.e. very often recursively.  The compiler should generate code the way the CPU

(beginner question) ConfigParser nuances

2011-05-02 Thread Unknown Moss
Hi - Beginner question here. I'm working with ConfigParser. I'd like to take a multiline variable and convert it directly to an array. Seems like a common problem, but I don't see how I can do it without doing a little parsing in my own code. Here's what I'm doing ... import ConfigParser

Re: Fibonacci series recursion error

2011-05-02 Thread Chris Angelico
On Tue, May 3, 2011 at 7:50 AM, harrismh777 harrismh...@charter.net wrote: They *are not* called one after the other in the sense that there is ever only one level of recursion with each call (not at all). Take a closer look. Each call to fib() forces a double head, and each of those forces

Re: (beginner question) ConfigParser nuances

2011-05-02 Thread Chris Rebert
On Mon, May 2, 2011 at 3:04 PM, Unknown Moss unknownm...@gmail.com wrote: Hi - Beginner question here. I'm working with ConfigParser. I'd like to take a multiline variable and convert it directly to an array. Seems like a common  problem, but I don't see how I can do it without doing a little

Re: Fibonacci series recursion error

2011-05-02 Thread Ian Kelly
On Mon, May 2, 2011 at 3:50 PM, harrismh777 harrismh...@charter.net wrote: Thomas Rachel wrote: ... because each recursion level 'return' calls fib() twice, and each of those calls fib() twice, and you get the point... yes - but they are called one after the other, so the twice call counts

Re: Fibonacci series recursion error

2011-05-02 Thread Chris Angelico
On Tue, May 3, 2011 at 8:22 AM, Ian Kelly ian.g.ke...@gmail.com wrote: They *are not* called one after the other in the sense that there is ever only one level of recursion with each call (not at all). Take a closer look. Each call to fib() forces a double head, and each of those forces another

Re: Development software

2011-05-02 Thread Chris Angelico
On Tue, May 3, 2011 at 1:23 AM, Petey efri...@gmail.com wrote: Which programmes should I start using because they might be useful in the future? Which functions of eclipse are useful but unused/unnoticed by beginners. What do you use and why :) ? You're going to get some extremely

Re: Fibonacci series recursion error

2011-05-02 Thread Steven D'Aprano
On Mon, 02 May 2011 21:02:43 +0100, Hans Georg Schaathun wrote: The other arguments are valid. And they make me lean more towards more static, compiled languages without the excessive run-time dynamism of python. If you value runtime efficiency over development time, sure. There are plenty

Py / VNC Automation

2011-05-02 Thread PyNewbie
Hi, I'm looking for a python class or open source code that is tightly integrated with VNC protocols - any ideas? -- http://mail.python.org/mailman/listinfo/python-list

Re: Py / VNC Automation

2011-05-02 Thread Chris Angelico
On Tue, May 3, 2011 at 10:23 AM, PyNewbie ryan.morr...@gmail.com wrote: Hi, I'm looking for a python class or open source code that is tightly integrated with VNC protocols - any ideas? It's not a complex protocol; you could fairly readily work it manually. The protocol itself is called RFB -

Re: Py / VNC Automation

2011-05-02 Thread Dan Stromberg
On Mon, May 2, 2011 at 5:23 PM, PyNewbie ryan.morr...@gmail.com wrote: Hi, I'm looking for a python class or open source code that is tightly integrated with VNC protocols - any ideas? -- http://mail.python.org/mailman/listinfo/python-list I've not updated this in a while, but it's got a

Recursion or iteration (was Fibonacci series recursion error)

2011-05-02 Thread rusi
On May 3, 2:50 am, harrismh777 harrismh...@charter.net wrote: The thing about this problem that puzzles me, is why we might consider recursion for a possible solution in the first place This can be answered directly but a bit lengthily. Instead let me ask a seemingly unrelated (but actually

Re: Development software

2011-05-02 Thread rusi
On May 2, 8:23 pm, Petey efri...@gmail.com wrote: Hi! I'm new to programming. I started with php earlier and I dropped it for Python. I use Eclipse+PyDev for python, html and css. Which programmes should I start using because they might be useful in the future? Which functions of

Re: Recursion or iteration (was Fibonacci series recursion error)

2011-05-02 Thread Chris Angelico
On Tue, May 3, 2011 at 11:48 AM, rusi rustompm...@gmail.com wrote: What are their space/time complexities? Which do you prefer? They're pretty similar actually. If you rework the first one to not use range() but instead have a more classic C style of loop, they'll be almost identical: def

Re: Development software

2011-05-02 Thread Chris Angelico
On Tue, May 3, 2011 at 12:04 PM, rusi rustompm...@gmail.com wrote: Chris talked of a good make tool. Yes this is necessary for more 'in- the-large' programming. But for a beginner its very important to have tight development cycle -- viz. a. Write a function b. Check the function c. Change

complex data structures in python

2011-05-02 Thread Rita
Hello, I was wondering if anyone has any documentation/recipes for implementing complex data structures. For instance, if you had a dictionary with a list inside a list inside a set. -- --- Get your facts first, then you can distort them as you please.-- --

Re: (beginner question) ConfigParser nuances

2011-05-02 Thread Unknown Moss
On May 2, 3:25 pm, Chris Rebert c...@rebertia.com wrote: On Mon, May 2, 2011 at 3:04 PM, Unknown Moss unknownm...@gmail.com wrote: Hi -Beginnerquestionhere. I'm working with ConfigParser. I'd like to take a multiline variable and convert it directly to an array. Seems like a common  

Re: Fibonacci series recursion error

2011-05-02 Thread rusi
On May 3, 5:21 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Mon, 02 May 2011 21:02:43 +0100, Hans Georg Schaathun wrote: The other arguments are valid.  And they make me lean more towards more static, compiled languages without the excessive run-time dynamism of

Re: complex data structures in python

2011-05-02 Thread Chris Rebert
On Mon, May 2, 2011 at 7:46 PM, Rita rmorgan...@gmail.com wrote: Hello, I was wondering if anyone has any documentation/recipes for implementing complex data structures. For instance, if you had a dictionary with a list inside a list inside a set. Er, there's no special magic. The datatypes

Re: Coolest Python recipe of all time

2011-05-02 Thread Stefan Behnel
David Monaghan, 02.05.2011 23:45: On Mon, 2 May 2011 14:58:50 -0600, Ian Kelly wrote: On Mon, May 2, 2011 at 2:48 PM, David Monaghan wrote: On Mon, 2 May 2011 10:33:31 -0700 (PDT), Raymond Hettinger wrote: I think it is time to give some visibility to some of the instructive and very cool

Re: Coolest Python recipe of all time

2011-05-02 Thread Ian Kelly
On Mon, May 2, 2011 at 11:04 PM, Stefan Behnel stefan...@behnel.de wrote: The bad thing about this recipe is that it requires quite a bit of background knowledge in order to infer that the code the developer is looking at is actually correct. At first sight, it looks like an evil hack, and the

Re: Recursion or iteration (was Fibonacci series recursion error)

2011-05-02 Thread Dan Stromberg
On Mon, May 2, 2011 at 7:13 PM, Chris Angelico ros...@gmail.com wrote: On Tue, May 3, 2011 at 11:48 AM, rusi rustompm...@gmail.com wrote: What are their space/time complexities? Which do you prefer? They're pretty similar actually. If you rework the first one to not use range() but

Re: Recursion or iteration (was Fibonacci series recursion error)

2011-05-02 Thread Chris Angelico
On Tue, May 3, 2011 at 3:27 PM, Dan Stromberg drsali...@gmail.com wrote: But the recursive solution has time complexity of O(logn).  The iterative solution has time complexity of O(n).  That's a significant difference for large n - a significant benefit of the recursive version. Are you sure?

Hello Friends

2011-05-02 Thread Ashraf Ali
What are you lookink for. Just visit to see what you want www.bollywoodhotactresswallpapers.blogspot.com www.bollywoodhotwallpaperz.blogspot.com www.bollywoodhotactresspicz.blogspot.com www.hottesthitsbollywood.blogspot.com www.bollywoodhotphotoz.blogspot.com --

Re: Recursion or iteration (was Fibonacci series recursion error)

2011-05-02 Thread Ian Kelly
On Mon, May 2, 2011 at 11:27 PM, Dan Stromberg drsali...@gmail.com wrote: But the recursive solution has time complexity of O(logn).  The iterative solution has time complexity of O(n).  That's a significant difference for large n - a significant benefit of the recursive version. It's linear

Re: Recursion or iteration (was Fibonacci series recursion error)

2011-05-02 Thread Dan Stromberg
On Mon, May 2, 2011 at 10:29 PM, Chris Angelico ros...@gmail.com wrote: On Tue, May 3, 2011 at 3:27 PM, Dan Stromberg drsali...@gmail.com wrote: But the recursive solution has time complexity of O(logn). The iterative solution has time complexity of O(n). That's a significant difference

[issue11975] Fix intersphinx-ing of built-in types (list, int, ...)

2011-05-02 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: See also #4966 and #11976. -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11975 ___

[issue4966] Improving Lib Doc Sequence Types Section

2011-05-02 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: See also #11975 and #11976. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4966 ___ ___

[issue11967] Left shift and Right shift for floats

2011-05-02 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Ok, I'm closing this as won't fix. Mark is our authority on these matters, and having two spellings for this fairly uncommon operation seems enough. -- resolution: - wont fix status: open - closed

[issue11887] unittest fails on comparing str with bytes if python has the -bb option

2011-05-02 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Le lundi 02 mai 2011 07:05:28, vous avez écrit : * the patch introduces code/complexity in _baseAssertEqual and other places, using catch_warnings to change and restore the warning filters at every call; Yes, and what is the

[issue11839] argparse: unexpected behavior of default for FileType('w')

2011-05-02 Thread Stefan Pfeiffer
Stefan Pfeiffer stefan.pfeif...@gmail.com added the comment: Happens in 3.2, too... Would be nice to see that fixed. Stefan -- nosy: +Stefan.Pfeiffer ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11839

[issue11975] Fix referencing of built-in types (list, int, ...)

2011-05-02 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: I changed the title: intersphinx is a Sphinx extension used to links to foreign documentation, not create links inside one doc (as I understand the request is). -- nosy: +eric.araujo stage: - needs patch title: Fix intersphinx-ing of

[issue11935] MMDF/MBOX mailbox need utime

2011-05-02 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: On Sun, 1 May 2011 00:15:11 +0200, R. David Murray rep...@bugs.python.org wrote: The problem with this patch is that it would also show 'new mail' if what had in fact happened was that a message had been *deleted* (see the

[issue11935] MMDF/MBOX mailbox need utime

2011-05-02 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: I'll attach a patch with a clearer comment (entry-gate instead new mail), i.e. the comment now reflects what MUAs really do. -- Added file: http://bugs.python.org/file21850/11935.2.diff

[issue11935] MMDF/MBOX mailbox need utime

2011-05-02 Thread Steffen Daode Nurpmeso
Changes by Steffen Daode Nurpmeso sdao...@googlemail.com: Removed file: http://bugs.python.org/file21795/mailbox.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11935 ___

[issue11975] Fix referencing of built-in types (list, int, ...)

2011-05-02 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: Actually I need to be able to intersphinx (because my documentation work is not the Python docs :-) but I guess it boils down to the same problem of incomplete Sphinx module/class indices. -- ___ Python

[issue10252] Fix resource warnings in distutils

2011-05-02 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset c02c78d93a2e by Éric Araujo in branch '2.7': Fix double use of f.close(). http://hg.python.org/cpython/rev/c02c78d93a2e -- ___ Python tracker rep...@bugs.python.org

[issue8498] Cannot use backlog = 0 for sockets

2011-05-02 Thread Daniel Evers
Daniel Evers derm...@googlemail.com added the comment: To revive this issue, I tried to write a unit test to verify the behaviour. Onfurtunately, the test doesn't work and I don't understand why. I hope, someone here is more enlightend than me... (files: server.py, client.py) -- Added

[issue8498] Cannot use backlog = 0 for sockets

2011-05-02 Thread Daniel Evers
Daniel Evers derm...@googlemail.com added the comment: (client.py) -- Added file: http://bugs.python.org/file21852/client.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8498 ___

  1   2   >