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 application

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 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 use for easy thi

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

Re: Development tools and practices for Pythonistas

2011-05-02 Thread rusi
On May 2, 12:08 pm, Algis Kabaila 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 hidden? Otherwise rc

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" fo

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 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

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 man

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 ('1'

Re: build the "sql where cause" dynamic

2011-05-02 Thread Chris Angelico
On Mon, May 2, 2011 at 5:48 PM, christian 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 input?). > >

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 ass

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 ]…] ] ][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 (t)=((

Re: Fibonacci series recursion error

2011-05-02 Thread rusi
On Apr 30, 12:18 pm, Steven D'Aprano 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) = R(1) = 1 Changing your definitio

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 se

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

2011-05-02 Thread Duncan Booth
Dennis Lee Bieber 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 I learned) also

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 +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 cal

Re: Development tools and practices for Pythonistas

2011-05-02 Thread jacek2v
On May 2, 9:48 am, Algis Kabaila wrote: > On Monday 02 May 2011 17:19:57 rusi wrote: > > > On May 2, 12:08 pm, Algis Kabaila > 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 th

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 al

Re: Deditor

2011-05-02 Thread Alec Taylor
Yes On Mon, May 2, 2011 at 2:12 AM, Kruptein wrote: > On 1 mei, 17:50, Alec Taylor wrote: >> Traceback (most recent call last): >>  File "O:\deditor\deditor\deditor.py", line 7, in > e> >>    import wx, os, datetime, sys, ConfigParser, wx.aui, wx.lib.scrolledpanel >>  File "C:\Python27\lib\site-

Re: codec for UTF-8 with BOM

2011-05-02 Thread Chris Rebert
On Mon, May 2, 2011 at 1:34 AM, Ulrich Eckhardt 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 find the correct name. Als

Re: Fibonacci series recursion error

2011-05-02 Thread Hans Georg Schaathun
On 02 May 2011 01:09:21 GMT, Steven D'Aprano 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 being a beginner's error. I don't th

Re: Fibonacci series recursion error

2011-05-02 Thread Hans Georg Schaathun
On 02 May 2011 08:56:57 GMT, Steven D'Aprano 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, primefree, Pell, Padovan and : Perrin numb

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 > wrote: > The correct name, as you found below and as is corroborated by the > webpage, seems to be "utf_8_sig": > >>> u"FOøbar".encode('utf_8_sig') > '\xef\xbb\xbfFO\xc3\xb8bar' To com

Re: build the "sql where cause" dynamic

2011-05-02 Thread christian
On 2 Mai, 10:13, Chris Angelico wrote: > On Mon, May 2, 2011 at 5:48 PM, christian 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 sp

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 wrote: > > On Monday 02 May 2011 17:19:57 rusi wrote: > > > On May 2, 12:08 pm, Algis Kabaila > > > > wrote: > > > > Actually, Bazaar is more convenient than rcs for a > > > > single user, as the repository can be t

Re: Fibonacci series recursion error

2011-05-02 Thread rusi
On May 2, 2:53 pm, Hans Georg Schaathun wrote: > On 02 May 2011 08:56:57 GMT, Steven D'Aprano  > 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

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"

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 d

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 Schaathun wrote: On Mon, 2 May 2011 06:49:41 +1000, Chris Angelico wrote: : Sure. Serialize this Python object in a way that can be given to, say, PHP: : foo=asdf":"qwer","zxcv":"1234"}; foo["self"

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 (t)

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

2011-05-02 Thread Grant Edwards
On 2011-05-02, Jorgen Grahn 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 Python >> as a

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 bas

Re: Fibonacci series recursion error

2011-05-02 Thread Hans Georg Schaathun
On Sun, 01 May 2011 18:24:30 -0400, Terry Reedy 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 : version. So called

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 yo

Re: Python competitions and learnings

2011-05-02 Thread Alexander Lyabah
On May 1, 7:22 pm, Alexander Lyabah wrote: > On May 1, 3:26 am, harrismh777 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 interesting. I spent s

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 >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 differ

Re: Python competitions and learnings

2011-05-02 Thread Alexander Lyabah
On May 2, 1:33 am, Terry Reedy 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 how it > act

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 >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 un

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 welcome

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 twit

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 (and

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

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 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 former has a single

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 developm

Re: Fibonacci series recursion error

2011-05-02 Thread Hans Georg Schaathun
On 02 May 2011 16:41:37 GMT, Steven D'Aprano 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 :-) : The problem is, once you include side-e

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 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: > > > http://code.activestate.com/recipes/365013-

Re: Coolest Python recipe of all time

2011-05-02 Thread Ian Kelly
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 recipes in ActiveState's python cookbook. >> >>My vote for the coolest recipe of al

Re: Fibonacci series recursion error

2011-05-02 Thread Mark Dickinson
On May 2, 5:24 pm, Steven D'Aprano 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 other definition is rather, sh

Re: Coolest Python recipe of all time

2011-05-02 Thread David Monaghan
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 recipes in ActiveState

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): >>> i

Re: Fibonacci series recursion error

2011-05-02 Thread Chris Angelico
On Mon, May 2, 2011 at 11:14 PM, Hans Georg Schaathun 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 > thinks (most optim

(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 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 > double head (n

Re: (beginner question) ConfigParser nuances

2011-05-02 Thread Chris Rebert
On Mon, May 2, 2011 at 3:04 PM, Unknown Moss 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 parsing in my own

Re: Fibonacci series recursion error

2011-05-02 Thread Ian Kelly
On Mon, May 2, 2011 at 3:50 PM, harrismh777 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 only f

Re: Fibonacci series recursion error

2011-05-02 Thread Chris Angelico
On Tue, May 3, 2011 at 8:22 AM, Ian Kelly 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 >> double head

Re: Development software

2011-05-02 Thread Chris Angelico
On Tue, May 3, 2011 at 1:23 AM, Petey 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 disparate responses t

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 plent

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 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 - see http://en.wikip

Re: Py / VNC Automation

2011-05-02 Thread Dan Stromberg
On Mon, May 2, 2011 at 5:23 PM, PyNewbie 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 python vnc viewer

Recursion or iteration (was Fibonacci series recursion error)

2011-05-02 Thread rusi
On May 3, 2:50 am, harrismh777 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 much the same) questi

Re: Development software

2011-05-02 Thread rusi
On May 2, 8:23 pm, Petey 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 eclipse are use

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 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 powI(x,n): result = 1

Re: Development software

2011-05-02 Thread Chris Angelico
On Tue, May 3, 2011 at 12:04 PM, rusi 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 the definition

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.-- -- http://mail.python.org/mailman/listin

Re: (beginner question) ConfigParser nuances

2011-05-02 Thread Unknown Moss
On May 2, 3:25 pm, Chris Rebert wrote: > On Mon, May 2, 2011 at 3:04 PM, Unknown Moss 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  problem, but I don't see how I can do i

Re: Fibonacci series recursion error

2011-05-02 Thread rusi
On May 3, 5:21 am, Steven D'Aprano 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 > > python. > > If you value runtime eff

Re: complex data structures in python

2011-05-02 Thread Chris Rebert
On Mon, May 2, 2011 at 7:46 PM, Rita 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 just nest normally

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

Re: Coolest Python recipe of all time

2011-05-02 Thread Ian Kelly
On Mon, May 2, 2011 at 11:04 PM, Stefan Behnel 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 lack of documen

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 wrote: > On Tue, May 3, 2011 at 11:48 AM, rusi 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

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 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? It will produce

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 -- http://mail.python.org/mailman/

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 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 as written. I th

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 wrote: > On Tue, May 3, 2011 at 3:27 PM, Dan Stromberg 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 signifi

Re: ctypes and twain_32.dll

2011-05-02 Thread Patrick Vrijlandt
On 2 mei, 20:56, "Michel Claveau - MVP" wrote: > Hi! > > On my system, thera are not "twain32.dll" or "twain_32.dll", but "twain.dll" > > @+ > -- > Michel Claveau Hi, I have both. They are correctly installed and working. ctypes gives a different response if it cannot find the requested DLL. Pat

Re: Coolest Python recipe of all time

2011-05-02 Thread Terry Reedy
On 5/3/2011 1:04 AM, Stefan Behnel 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. The main math knowledge needed is the trivial fact that if a*x + b = 0, then x = -

Re: Fibonacci series recursion error

2011-05-02 Thread Hans Georg Schaathun
On 03 May 2011 00:21:45 GMT, Steven D'Aprano wrote: : Python aims at acceptable performance (between 10 and 100 times slower : than C) and much easier development (between 10 and 100 times faster than : C *wink*). If that tradeoff doesn't suit you, perhaps Python is not the : language for

Re: Coolest Python recipe of all time

2011-05-02 Thread Stefan Behnel
Terry Reedy, 03.05.2011 08:00: On 5/3/2011 1:04 AM, Stefan Behnel 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. The main math knowledge needed is the trivial fact

Re: Coolest Python recipe of all time

2011-05-02 Thread Gregory Ewing
Terry Reedy wrote: The trick is that replacing x with j and evaluating therefore causes (in Python) all the coefficients of x (now j) to be added together separately from all the constant terms to reduce the linear equation to a*x+b (= 0 implied). Hmmm... so if we used quaternions, could we s