Re: Setting up a class

2012-09-06 Thread Colin J. Williams
On 06/09/2012 8:20 AM, MRAB wrote: On 06/09/2012 13:00, shaun wrote: Hi all, So I'm trying to to OO a script which is currently in place on work. It connects to the database and makes multiple strings and sends them to a server. But I'm having major problems since I am new to python I keep try

Standard Asynchronous Python

2012-09-09 Thread Dustin J. Mitchell
After seeing David Mertz's talk at PyCon 2012, "Coroutines, event loops, and the history of Python generators" [1], I got thinking again about Python's expressive power for asynchronous programming. Generators, particularly with the addition of 'yield from' and 'return' in PEP 380 [2], allow us to

Re: Standard Asynchronous Python

2012-09-10 Thread Dustin J. Mitchell
The responses have certainly highlighted some errors in emphasis in my approach. * My idea is to propose a design PEP. (Steven, Dennis) I'm not at *all* suggesting including uthreads in the standard library. It's a toy implementation I used to develop my ideas. I think of this as a much smaller

Re: Standard Asynchronous Python

2012-09-11 Thread Dustin J. Mitchell
Thanks for the second round of responses. I think this gives me some focus - concentrate on the API, talk to the framework developers, and start redrafting the PEP sooner rather than later. Thanks! Dustin -- http://mail.python.org/mailman/listinfo/python-list

generators as decorators simple issue

2012-09-11 Thread j . m . dagenhart
I'm trying to call SetName on an object to prevent me from ever having to call it explictly again on that object. Best explained by example. def setname(cls): '''this is the proposed generator to call SetName on the object''' try: cls.SetName(cls.__name__) finally: yi

Re: odt2sphinx 0.2.3 released

2012-09-12 Thread Dustin J. Mitchell
On Wed, Sep 12, 2012 at 10:06 AM, wrote: > ߒߤߒߡߜߦߡ ß ß§ And that's why you shouldn't let your kids play with your iPad :) Dustin -- http://mail.python.org/mailman/listinfo/python-list

Re: which a is used?

2012-09-25 Thread Colin J. Williams
On 24/09/2012 10:14 PM, alex23 wrote: On Sep 25, 11:13 am, Dwight Hutto wrote: bitch I honestly could not care less what you think about me, but don't use that term. This isn't a boys' club and we don't need your hurt ego driving people away from here. +1 -- http://mail.python.org/mailman/l

Re: what is the difference between st_ctime and st_mtime one is the time of last change and the other is the time of last modification, but i can not understand what is the difference between 'change'

2012-09-28 Thread Kristen J. Webb
ermission changes, link/unlink of hard links etc. Whoops, my bad! Sorry. I was remembering some other APIs with similar terminology. Lesson: Check the docs, they're more reliable. ChrisA -- This message is NOT encrypted ---- Mr. Kristen J. Webb Chief Technolog

Re: How to get progress in python script.

2012-09-29 Thread Colin J. Williams
On 28/09/2012 12:26 PM, Rolando Cañer Roblejo wrote: Hi all, Please, I need you suggest me a way to get statistics about a progress of my python script. My python script could take a lot of time processing a file, so I need a way that an external program check the progress of the script. My firs

Re: Aggressive language on python-list

2012-10-16 Thread Kristen J. Webb
y to respond to bad behaviour that will work all the time, against all people. [2] Nearly everybody thinks they're middle-class, except the filthy rich and the filthy poor. [3] I don't give a damn what mind-altering chemicals Dwight wishes to indulge in, so long as he does it i

Re: Numpy module

2012-11-08 Thread Colin J. Williams
On 08/11/2012 8:09 AM, Anssi Saari wrote: farrellpolym...@gmail.com writes: [snip] Does Numpy 1.6.2 not run with Python 3.2.3? It does on the Raspberry Pi, which uses a variant of Debian. Colin W. -- http://mail.python.org/mailman/listinfo/python-list

Error messages from format()

2012-11-13 Thread Colin J. Williams
Is there some way to get more informative error messages from the builtin format? Most messages are such as: Traceback (most recent call last): File "", line 1, in ValueError: Invalid conversion specification This example doesn't point to the first invalid case. [Dbg]>>> format((25, 31),'{0

Re: Error messages from format()

2012-11-13 Thread Colin J. Williams
On 13/11/2012 1:38 PM, Steven D'Aprano wrote: On Tue, 13 Nov 2012 10:08:59 -0500, Colin J. Williams wrote: Is there some way to get more informative error messages from the builtin format? Yes -- post a feature request on the Python bug tracker, then wait until Python 3.4 comes out in

Re: Error messages from format()

2012-11-13 Thread Colin J. Williams
On 13/11/2012 4:18 PM, Dave Angel wrote: On 11/13/2012 03:24 PM, Colin J. Williams wrote: I am working on the assumption that the first argument of the format builtin function and be a sequence of values, which can be selected with {1:}, {2

Re: Yet another Python textbook

2012-11-21 Thread Colin J. Williams
On 20/11/2012 4:00 PM, Chris Angelico wrote: On Wed, Nov 21, 2012 at 1:57 AM, wrote: Le mardi 20 novembre 2012 09:09:50 UTC+1, Chris Angelico a écrit : On Tue, Nov 20, 2012 at 7:02 PM, Pavel Solin wrote: Perhaps you are right. Is there any statistics of how many Python programmers are u

Re: Yet another Python textbook

2012-11-22 Thread Colin J. Williams
From Yet another Python textbook On 21/11/2012 5:17 PM, Chris Angelico wrote: On Thu, Nov 22, 2012 at 4:03 AM, Colin J. Williams wrote: On 20/11/2012 4:00 PM, Chris Angelico wrote: To the OP: jmf has an unnatural hatred of Python 3.3 and PEP 393 strings. Take no notice; the rest of the world

Re: Yet another Python textbook

2012-11-22 Thread Colin J. Williams
On 22/11/2012 1:27 PM, Ian Kelly wrote: On Thu, Nov 22, 2012 at 5:24 AM, Colin J. Williams wrote: From my reading of the docs, it seems to me that the three following should be equivalent: (a) formattingStr.format(values) with (b) format(values, formattingStr) or (c) tupleOfValues

Re: py2exe is on Sourceforge list of top growth projects

2012-12-18 Thread Colin J. Williams
On 18/12/2012 1:52 AM, Frank Millman wrote: This is from Sourceforge's monthly update - Top Growth Projects We're always on the lookout for projects that might be doing interesting things, and a surge in downloads is one of many metrics that we look at to identify them. Here's the projects th

Re: Pigeon Computer 0.1 Initial (BETA) release

2012-12-22 Thread Colin J. Williams
On 21/12/2012 7:07 PM, Amirouche Boubekki wrote: Héllo, 2012/12/22 Simon Forman mailto:forman.si...@gmail.com>> Pigeon Computer 0.1 Initial (BETA) release Summary The Pigeon Computer is a simple but sophisticated system for learning and exploring the fundamen

Re: Good Python IDE

2013-01-06 Thread Colin J. Williams
On 06/01/2013 7:48 AM, Tetsuya wrote: On 01/06/2013 05:45 AM, Sourabh Mhaisekar wrote: Hello All, I am recently started couple of projects in Python, one in Python GTK > and one in Python Qt. I want a good IDE (For Windows ) for Python which > gives support for Python as well as PyGtk and PyQ

Common LISP-style closures with Python

2012-02-03 Thread Antti J Ylikoski
In Python textbooks that I have read, it is usually not mentioned that we can very easily program Common LISP-style closures with Python. It is done as follows: - # Make a Common LISP-like closure with Python. # # Antti J Ylikoski 02-03-2012. def f1

Re: Common LISP-style closures with Python

2012-02-04 Thread Antti J Ylikoski
On 4.2.2012 4:47, Chris Rebert wrote: On Fri, Feb 3, 2012 at 4:27 PM, Antti J Ylikoski wrote: In Python textbooks that I have read, it is usually not mentioned that we can very easily program Common LISP-style closures with Python. It is done as follows

Re: Common LISP-style closures with Python

2012-02-04 Thread Antti J Ylikoski
On 4.2.2012 12:14, Antti J Ylikoski wrote: On 4.2.2012 4:47, Chris Rebert wrote: On Fri, Feb 3, 2012 at 4:27 PM, Antti J Ylikoski wrote: In Python textbooks that I have read, it is usually not mentioned that we can very easily program Common LISP-style closures with Python. It is done as

Re: Common LISP-style closures with Python

2012-02-04 Thread Antti J Ylikoski
On 4.2.2012 12:58, Arnaud Delobelle wrote: On 4 February 2012 10:14, Antti J Ylikoski wrote: On 4.2.2012 4:47, Chris Rebert wrote: Out of curiosity, what would be non-Common-Lisp-style closures? Cheers, Chris I understand that a "closure" is something which is typical of

Re: Common LISP-style closures with Python

2012-02-04 Thread Antti J Ylikoski
On 5.2.2012 3:31, John O'Hagan wrote: On Sat, 04 Feb 2012 02:27:56 +0200 Antti J Ylikoski wrote: [...] # Make a Common LISP-like closure with Python. # # Antti J Ylikoski 02-03-2012. def f1(): n = 0 def f2(): nonlocal n n += 1 ret

Re: Common LISP-style closures with Python

2012-02-05 Thread Antti J Ylikoski
On 5.2.2012 22:58, Ian Kelly wrote: On Sat, Feb 4, 2012 at 9:19 PM, Antti J Ylikoski wrote: I'm not sure how naughty this is, but the same thing can be done without using nonlocal by storing the local state as an attribute of the enclosed function object: ... Yes, I do know that, but

Re: how to read serial stream of data [newbie]

2012-02-07 Thread Antti J Ylikoski
On 7.2.2012 14:13, Jean Dupont wrote: ser2 = serial.Serial(voltport, 2400, 8, serial.PARITY_NONE, 1, rtscts=0, dsrdtr=0, timeout=15) In Python, if you want to continue the source line into the next text line, you must end the line to be continued with a backslash '\'. So you should write: s

Re: how to read serial stream of data [newbie]

2012-02-07 Thread Antti J Ylikoski
On 7.2.2012 16:02, Peter Otten wrote: Antti J Ylikoski wrote: On 7.2.2012 14:13, Jean Dupont wrote: ser2 = serial.Serial(voltport, 2400, 8, serial.PARITY_NONE, 1, rtscts=0, dsrdtr=0, timeout=15) In Python, if you want to continue the source line into the next text line, you must end the

Re: newb __init__ inheritance

2012-03-10 Thread Colin J. Williams
On 08/03/2012 10:25 AM, hyperboogie wrote: Hello everyone. This is my first post in this group. I started learning python a week ago from the "dive into python" e- book and thus far all was clear. However today while reading chapter 5 about objects and object orientation I ran into something tha

Re: newb __init__ inheritance

2012-03-10 Thread Colin J. Williams
On 10/03/2012 12:58 PM, Colin J. Williams wrote: On 08/03/2012 10:25 AM, hyperboogie wrote: Hello everyone. [snip] main() I'm not sure that the class initialization is required. Good luck, Colin W. When I wrote earlier, I wondered about the need for initialization. With Version 2,

Re: Why not use juxtaposition to indicate function application

2012-03-16 Thread Colin J. Williams
On 16/03/2012 8:45 AM, Ray Song wrote: I confess i've indulged in Haskell and found f a more readable than f(a) And why aren't functions curried (partially applied function is another function which takes the rest arguments) by default? Thanks in advance for any suggestions. -- Ray

Programming D. E. Knuth in Python with the Deterministic Finite Automaton construct

2012-03-17 Thread Antti J Ylikoski
ist(range(0, n+1)) # [0, 1, 2, 3, 4, ..., n] -- see Knuth while continueLoop: if nextStat == "L1": app = listofPerm.append(a[1:n+1]) nextStat = "L2" continueLoop = 1 elif nextStat == "L2":

Re: Programming D. E. Knuth in Python with the Deterministic Finite Automaton construct

2012-03-17 Thread Antti J Ylikoski
On 17.3.2012 17:47, Roy Smith wrote: In article, Antti J Ylikoski wrote: I came across the problem, which would be the clearest way to program such algorithms with a programming language such as Python, which has no GOTO statement. It struck me that the above construction actually is a

Re: New learner of Python--any suggestion on studying it?

2012-03-19 Thread Antti J Ylikoski
On 19.3.2012 8:30, yan xianming wrote: Hello all, I'm a new learning of Python. Can someone give me some suggestion about it? thanks xianming The best textbooks on Python that I have come across are: Learning Python by Mark Lutz, O'Reilly, http://oreilly.com, ISBN 978-0-596-15806-4 Progr

List comprehension/genexp inconsistency.

2012-03-20 Thread J. Cliff Dyer
One of my coworkers just stumbled across an interesting issue. I'm hoping someone here can explain why it's happening. When trying to create a class with a dual-loop generator expression in a class definition, there is a strange scoping issue where the inner variable is not found, (but the outer

Re: Fabric Engine v1.0 released under AGPL

2012-03-20 Thread Colin J. Williams
On 20/03/2012 12:51 PM, Fabric Paul wrote: Hi everyone - just letting you know that we released v1.0 of Fabric Engine today. We've open-sourced the core under AGPL, so I hope that gives you an incentive to get started with high-performance for Python :) http://fabricengine.com/technology/benchma

Re: List comprehension/genexp inconsistency.

2012-03-21 Thread J. Cliff Dyer
Binding" http://www.python.org/dev/peps/pep-0289/#early-binding-versus-late-binding Cheers, Cliff On Tue, 2012-03-20 at 16:50 -0600, Ian Kelly wrote: > On Tue, Mar 20, 2012 at 3:16 PM, Dennis Lee Bieber > wrote: > > On Tue, 20 Mar 2012 16:23:22 -0400,

Re: Best way to disconnect from ldap?

2012-03-21 Thread J. Cliff Dyer
Write a context manager. Then you just do with MyLDAPWrapper() as ldap ldap.this() ldap.that() and when you leave the scope of the with statement, your ldap __exit__ method will get called regardless of how you left. Cheers, Cliff On Wed, 2012-03-21 at 19:30 +, John Gordon wrote:

Re: Python classes: Simplify?

2012-03-22 Thread J. Cliff Dyer
The issue of explicitly naming a "self" parameter has been discussed in depth on a number of occasions. I recommend a google search for "python implicit self" for some of the reasons why it exists. Here's what Guido has to say about it: http://neopythonic.blogspot.com/2008/10/why-explicit-self-h

Re: Is there any difference between print 3 and print '3' in Python ?

2012-03-26 Thread J. Cliff Dyer
As others have pointed out, the output is the same, because the result of converting an integer to a string is the string of that integer. However, other numeric literals might not do what you want, due to the fact that they are converted to an internal numeric representation, then converted back t

Re: Your Regex Brain

2012-03-27 Thread Peter J. Holzer
s* ([\'"]) \s* (?.*?) \s* \g{-2} ) > | (?> (?!\s*[\'"]) \s* (?[^\s>]*) (?=\s|>) ) > ) > ) > (?= (?:[^>"\']|"[^"]*"|\'[^\']*\')*? (?<=\s) alt \s*= > (?: (?> \s* ([\'"]) \s* (?.*?) \s* \g{-2} ) >

Re: help needed to understand an error message.

2012-03-30 Thread J. Cliff Dyer
So the problem is that python doesn't know what you're trying to do. It doesn't know that you meant to say "print." When the parser is looking at the word Print, it assumes you are referencing an object named Print, which is completely legal. It's only once you've created the next token, a strin

Re: I look for a package to make some simple console "form"

2012-04-02 Thread J. Cliff Dyer
You might look into formencode. It basically takes the philosophy that a form is nothing more and nothing less than an interface between user input and python data. It doesn't make assumptions about how you present the form to the user. It just handles validation and conversion of that data into

Re: Is Programing Art or Science?

2012-04-02 Thread Pascal J. Bourguignon
ccc31807 writes: > Programming is neither an art nor a science, but a trade. > > It's not an art in the sense of painting, music, dance, poetry, etc., > because the objective isn't to make a beautiful something, but to give > instructions to a machine to accomplish some useful task. > > It's not

Re: Python-URL! - weekly Python news and links (Mar 31)

2012-04-03 Thread Colin J. Williams
On 31/03/2012 11:38 AM, Cameron Laird wrote: I pine for the fjords. And it's time to bring "Python-URL!" to a close. "Python-URL!", which Jean-Claude Wippler and I appear to have launched in 1998, has reached the end of its utility. We still have many loyal and enthusiastic readers--one subscr

Re: Is Programing Art or Science?

2012-04-03 Thread Pascal J. Bourguignon
ccc31807 writes: > On Apr 2, 5:48 pm, "Pascal J. Bourguignon" >> This is a narrow-minded definition of programming. > > Well, that's the point. > > If we make a list and include things like: > computer science > software engineering > computer

Re: f python?

2012-04-08 Thread Peter J. Holzer
chronous orbit. So we have another contender for the Most Expensive One-byte Mistake? Poul-Henning Kamp nominated the C/Unix guys: http://queue.acm.org/detail.cfm?id=2010365 hp -- _ | Peter J. Holzer| Deprecating human carelessness and |_|_) | Sysadmin WSR | ignorance has

Donald E. Knuth in Python, cont'd

2012-04-11 Thread Antti J Ylikoski
uite a ballet between integers and floats, but I wanted to do this as meticulously as possible. # Date of Easter from D. E. Knuth. Antti J Ylikoski 04-11-2012. # # See Donald E. Knuth: The Art of Computer Programming, V

Re: Donald E. Knuth in Python, cont'd

2012-04-11 Thread Antti J Ylikoski
On 11.4.2012 16:23, Grant Edwards wrote: On 2012-04-11, Antti J Ylikoski wrote: I wrote about a straightforward way to program D. E. Knuth in Python, Yikes. I think if you're going to try to write AI in Pyton, you might want to start out programming something a bit si

Re: functions which take functions

2012-04-11 Thread Antti J Ylikoski
nvx,1.0,2.0,.1)) print("Exact value ln(2): ", math.log(2.0)) print("Value of epsilon : ", .1) ---- kind regards, Antti J Ylikoski Helsinki, Finland, the EU http://www.tkk.fi/~ajy/ http://www.tkk.fi/~

Re: f python?

2012-04-11 Thread Pascal J. Bourguignon
Shmuel (Seymour J.) Metz writes: > In <87wr5nl54w@sapphire.mobileactivedefense.com>, on 04/10/2012 >at 09:10 PM, Rainer Weikusat said: > >>'car' and 'cdr' refer to cons cells in Lisp, not to strings. How the >>first/rest terminology can

Re: Donald E. Knuth in Python, cont'd

2012-04-11 Thread Antti J Ylikoski
On 11.4.2012 23:20, John Nagle wrote: On 4/11/2012 6:03 AM, Antti J Ylikoski wrote: I wrote about a straightforward way to program D. E. Knuth in Python, and received an excellent communcation about programming Deterministic Finite Automata (Finite State Machines) in Python. The following

Re: Some posts do not show up in Google Groups

2012-04-30 Thread Colin J. Williams
On 30/04/2012 2:20 AM, Frank Millman wrote: Hi all For a while now I have been using Google Groups to read this group, but on the odd occasion when I want to post a message, I use Outlook Express, as I know that some people reject all messages from Google Groups due to the high spam ratio (wh

Re: numpy (matrix solver) - python vs. matlab

2012-05-01 Thread Colin J. Williams
On 01/05/2012 2:43 PM, someone wrote: [snip] a = [1 2 3]; b = [11 12 13]; c = [21 22 23]. Then notice that c = 2*b - a. So c is linearly dependent on a and b. Geometrically this means the three vectors are in the same plane, so the matrix doesn't have an inverse. Does it not mean that there

Re: John Carmack glorifying functional programing in 3k words

2012-05-03 Thread Pascal J. Bourguignon
Tim Bradshaw writes: > On 2012-05-02 14:44:36 +, jaialai.technol...@gmail.com said: > >> He may be nuts > > But he's right: programmers are pretty much fuckwits[*]: if you think > that's not true you are not old enough. > > [*] including me, especially. You need to watch: http://blog.ted.co

Algorithms in Python, cont'd

2012-05-03 Thread Antti J Ylikoski
have been straightforward but too time-consuming. yours, and V/R, Antti J Ylikoski Helsinki, Finland, the EU -- http://mail.python.org/mailman/listinfo/python-list

.py to .pyc

2012-05-13 Thread Colin J. Williams
Is there some way to ensure that a .pyc file is produced when executing a .py file? It seems that for small files the .pyc file is not produced. Colin W. -- http://mail.python.org/mailman/listinfo/python-list

.py to .pyc

2012-05-13 Thread Colin J. Williams
Is there some way to ensure that a .pyc file is produced when executing a .py file? It seems that for small files the .pyc file is not produced. Colin W. PLEASE IGNORE - I was in the wrong directory. Colin W. -- http://mail.python.org/mailman/listinfo/python-list

Algorithms in Python, #n+1

2012-05-16 Thread Antti J Ylikoski
chi_squared_test(random.random, 1000, 100, "Mersenne") chi2_Linear = chi_squared_test(rand_x.rand, 1000, 100, "Linear") chi2_Mersenne.run_test() chi2_Linear.run_test() chi2_Mersenne.chi2test() chi2_Linear.chi2test() --- yours and V/R, Antti J Ylikoski Helsinki, Finland, the E.U. -- http://mail.python.org/mailman/listinfo/python-list

Re: .py to .pyc

2012-05-19 Thread Colin J. Williams
On 18/05/2012 7:20 PM, Tony the Tiger wrote: On Sun, 13 May 2012 23:36:02 +0200, Irmen de Jong wrote: Why do you care anyway? Wanna hide his code...? /Grrr Curiosity. Perhaps there are stack-based processors out there which could use the .pyc code more directly. Colin W. -- http://mail

Re: Dynamic comparison operators

2012-05-24 Thread Colin J. Williams
On 24/05/2012 10:14 AM, mlangenho...@gmail.com wrote: I would like to pass something like this into a function test(val1,val2,'>=') and it should come back with True or False. Is there a way to dynamically compare 2 values like this or will I have to code each operator individually? Would so

Re: Smallest/cheapest possible Python platform?

2012-05-27 Thread Colin J. Williams
On 26/05/2012 12:25 PM, Paul Rubin wrote: Roy Smith writes: The Rasberry Pi certainly looks attractive, but isn't quite available today. Can you run Python on an Arduino? No. YOu want a 32-bit platform with an OS and perhaps 1 meg of memory. And by the time you port Python to it unless it's

Re: Interprocess comunication

2012-06-07 Thread J. Cliff Dyer
On Thu, 2012-06-07 at 16:04 +, Julio Sergio wrote: > Up to this point it worked as expected. However, when I tryied with the > methods > that write and read several lines, apparently the process got stalled: > > ->>> fi.writelines(["uno\n","dos\n","tres\n"]) > ->>> fi.flush() > ->>> s = fo.

Re: Interprocess comunication

2012-06-07 Thread J. Cliff Dyer
It is for reading all the lines from a complete file. If the file is still being written to, it doesn't have an end yet. File objects do many things besides RPC. Also, there are instances where all you want to do is block until the file is done, and then get all the content. readlines will do th

Re: Nexus Programming Language

2012-06-10 Thread Colin J. Williams
On 10/06/2012 1:45 AM, rusi wrote: On Jun 10, 7:46 am, Adam Campbell wrote: The Nexus programming language version 0.5.0 has been released. It is an "object-oriented, dynamically-typed, reflective programming language", drawing from Lua and Ruby.www.nexuslang.org What does nexus have that pyt

Re: Academic citation of Python

2012-06-16 Thread J. Cliff Dyer
That's a rather vague question. What do you want to cite about python? If you're just mentioning python, that shouldn't warrant a citation, though a parenthetical note linking to python.org might be useful. The standard documentation should be acceptable, or possibly a link to the source code at

[ANN] RuPy 11 Conference : Call for Proposals

2011-06-08 Thread J. P. Nowak
:: Call for Proposals 2011 RuPy 11 :: Strongly Dynamic Conference http://rupy.eu/ Poznan, Poland October 14th-16th, 2011 RuPy is a conference about dynamically typed programming languages. Held for the first time in April 2007 it gathered enthusiasts from Poland and other countries. The idea

Re: Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-13 Thread Pascal J. Bourguignon
Steven D'Aprano writes: > The actual physical cost of typing is a small part of coding. > Productivity-wise, optimizing the distance your hands move is worthwhile > for typists who do nothing but type, e.g. if you spend their day > mechanically copying text or doing data entry, then increasing

Re: reg: playing with the list

2011-06-24 Thread Colin J. Williams
On 24-Jun-11 03:01 AM, kaustubh joshi wrote: Hey all, I am new here and new to python too. In general new to programming . I was working on aproblem. and need some help. I have a list of numbers say [2,3,5,6,10,15] which all divide number 30. Now i have to reduce this list to the numbers which ar

Re: Function docstring as a local variable

2011-07-10 Thread Colin J. Williams
On 10-Jul-11 13:44 PM, rantingrick wrote: On Jul 10, 12:41 pm, Tim Johnson wrote: It possible for a function to print it's own docstring? def f(): """docstring""" print "docstring" any questions? Try: def f(): ds= """docstring""" print ds > Colin W. -- http://mail.pyth

Re: Lisp refactoring puzzle

2011-07-12 Thread Pascal J. Bourguignon
Neil Cerutti writes: > What's the rationale for providing them? Are the definitions > obvious for collections that a not sets? The rational is to prove that Xah is dumb. -- __Pascal Bourguignon__ http://www.informatimago.com/ A bad day in () is better than a good day in {}.

Re: Functional style programming in python: what will you talk about if you have an hour on this topic?

2011-07-13 Thread J Kenneth King
Anthony Kong writes: > (My post did not appear in the mailing list, so this is my second try. > Apology if it ends up posted twice) > > Hi, all, > > If you have read my previous posts to the group, you probably have some idea > why I asked this question. > > I am giving a few presentations on p

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-17 Thread Anders J. Munch
Steven D'Aprano wrote: > I can't fathom why 8 position tabs were *ever* the default, let alone why > they are still the default. That's because they were not invented as a means for programmers to vary indentation. Originally, tabs were a navigation device: When you press the tab key, you skip

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-18 Thread Anders J. Munch
Thomas 'PointedEars' Lahn wrote: > I am getting the idea here that you mean the right thing, but that you > explain it wrong. Feel free to write the much longer essay that explains it all unambiguously, I'm not going to. regards, Anders -- http://mail.python.org/mailman/listinfo/python-list

Re: python.org is down?

2011-07-24 Thread Colin J. Williams
On 24-Jul-11 03:43 AM, Laszlo Nagy wrote: Can it be a problem on my side? I have tried from several different computers. I cannot even ping it. The same for me at Noon EST Holland where are you? Colin W. -- http://mail.python.org/mailman/listinfo/python-list

Re: Refactor/Rewrite Perl code in Python

2011-07-25 Thread J Kenneth King
Steven D'Aprano writes: > On Sun, Jul 24, 2011 at 7:29 PM, Shashwat Anand > wrote: > >> How do I start ? >> The idea is to rewrite module by module. >> But how to make sure code doesn't break ? > > By testing it. > > Read up on "test driven development". > > At this point, you have this: > > Per

Multiple process output

2011-08-12 Thread Paulo J. Matos
Hi all, I am have a function which executes a command in the shell. The stdout and stderr of the command should be multipled to two strings for stdout and stderr respectively and stdout and stderr of the current process respectively. I have done like this: from subprocess import Popen, PIPE,

Re: Announcing a new podcast: Radio Free Python

2011-08-24 Thread Colin J. Williams
On 24-Aug-11 00:15 AM, Larry Hastings wrote: Radio Free Python is a new monthly podcast focused on Python and its community. Episode 1 has just been released! It features a panel discussion with the PythonLabs team: * Barry Warsaw, * Fred Drake, * Guido van Rossum, * Roger Masse, *

Re: how to format long if conditions

2011-08-27 Thread Colin J. Williams
On 27-Aug-11 03:50 AM, Hans Mulder wrote: On 27/08/11 09:08:20, Arnaud Delobelle wrote: I'm wondering what advice you have about formatting if statements with long conditions (I always format my code to<80 colums) Here's an example taken from something I'm writing at the moment and how I've for

Re: how to format long if conditions

2011-08-27 Thread Colin J. Williams
On 27-Aug-11 11:53 AM, Hans Mulder wrote: On 27/08/11 17:16:51, Colin J. Williams wrote: What about: cond= isinstance(left, PyCompare) and isinstance(right, PyCompare) and left.complist[-1] is right.complist[0] py_and= PyCompare(left.complist + right.complist[1:])if cond else: py_and

Re: [Python-ideas] allow line break at operators

2011-09-02 Thread Stephen J. Turnbull
Gabriel AHTUNE writes: > So can be done with this syntax: > > > x = firstpart * secondpart + #line breaks here > > anotherpart + #continue > > stillanother #continue on. > > after a "+" operator the line is clearly not finished yet. Sure, but IIRC one design principle of Python is that

Re: [Python-ideas] allow line break at operators

2011-09-02 Thread Stephen J. Turnbull
Guido van Rossum writes: > On Fri, Sep 2, 2011 at 12:28 AM, Stephen J. Turnbull > wrote: > > Sure, but IIRC one design principle of Python is that the keyword that > > denotes the syntax should be the first thing on the line, [...] > That's true for *statement

Re: [Python-ideas] allow line break at operators

2011-09-02 Thread Stephen J. Turnbull
Yingjie Lan writes: > Have you considered line continuation by indentation? It seems to > meet the design principle. I think it is the most natural way to > allow free line breaking in Python. Briefly, yes, and I think it would need a lot of tuning and probably complex rules. Unlike statement

Re: [OT] Anyone here familiar with installing Open Watcom F77?

2011-09-05 Thread Colin J. Williams
On 05-Sep-11 12:22 PM, Dan Nagle wrote: Hello, On 2011-09-05 16:15:20 +, W. eWatson said: On 9/5/2011 8:24 AM, Chris Angelico wrote: On Tue, Sep 6, 2011 at 1:15 AM, W. eWatson wrote: See Subject. To what extent "familiar"? I have it installed on several computers, but only because

Re: Running Python Demo on the Web?

2011-09-06 Thread Colin J. Williams
On 05-Sep-11 18:00 PM, Python Fiddle Admin wrote: Python has been ported to the web browser at pythonfiddle.com. Python Fiddle can import snippets of code that you are reading on a web page and run them in the browser. It supports a few popular libraries. Another common usage is to post code on

Re: lxml

2011-02-24 Thread Colin J. Williams
On 24-Feb-11 03:20 AM, Stefan Behnel wrote: MRAB, 24.02.2011 01:25: On 24/02/2011 00:10, Colin J. Williams wrote: Could someone please let me know whether lxml is available for Windows XP?. If so, is it available for Python 2.7? The latest stable release is here: http://pypi.python.org/pypi

Re: lxml

2011-02-25 Thread Colin J. Williams
On 24-Feb-11 19:39 PM, alex23 wrote: On Feb 24, 6:20 pm, Stefan Behnel wrote: MRAB, 24.02.2011 01:25: The latest stable release is here: http://pypi.python.org/pypi/lxml/2.2.8 Not quite the latest "stable release" (that would be 2.3), but at least one that's pre-built for Windows. Chris

Re: Python getting stuck

2011-02-27 Thread Colin J. Williams
On 26-Feb-11 18:55 PM, Shanush Premathasarathan wrote: Hi All, When I use cut, copy, paste, and any keyboard shortcuts, Python freezes and I am unable to use Python. Please Help as quick as possible!!! Thanks a lot. Kind Regards Big Python fan! Shanush What operating system are you using?

Re: Could I joined in this Happy family

2011-03-20 Thread Colin J. Williams
On 18-Mar-11 15:47 PM, Nick Stinemates wrote: > Welcome aboard ! > > On Mar 18, 2011 11:34 AM, "duxiu xiang" > wrote: > > Dear friends: > > I am in China.For some rearon,I cannot visit your Google Group.May > > I joint this mail list for help in learning Python?

Re: "in house" pypi?

2011-03-25 Thread Colin J. Williams
On 24-Mar-11 03:13 AM, John Nagle wrote: On 3/23/2011 8:19 PM, Miki Tebeka wrote: Greetings, My company want to distribute Python packages internally. We would like something like an internal PyPi where people can upload and easy_install from packages. Is there such a ready made solution? I'd

Python Tutorial

2011-03-27 Thread Colin J. Williams
I have come across: http://www.java2s.com/Tutorial/Python/CatalogPython.htm On a quick skim, the above seems to cover more ground than the standard: http://docs.python.org/tutorial/ I spotted one bug in the former, but one of the Network examples was helpful. Colin W. -- http://mail.python.org

Python-related Animation Packages?

2011-03-29 Thread Benjamin J. Racine
Hello all, Does anyone know of software that might be of use in an attempt to animate an object undergoing 6-DOF rigid body motions: surge, sway, heave, roll, pitch and yaw? Thanks so much, Ben Racine -- http://mail.python.org/mailman/listinfo/python-list

Re: Python benefits over Cobra

2011-04-05 Thread Colin J. Williams
On 05-Apr-11 06:22 AM, Brendan Simon (eTRIX) wrote: I just came across the Cobra language, which appears to be heavily influenced by Python (and other languages). The pitch sounds great. It's supposed to have: 1. Quick, expressive coding 2. Fast execution 3. Static and dynamic binding

Re: Argument of the bool function

2011-04-10 Thread Colin J. Williams
On 10-Apr-11 12:21 PM, Mel wrote: Chris Angelico wrote: Who would use keyword arguments with a function that takes only one arg anyway? It's hard to imagine. Maybe somebody trying to generalize function calls (trying to interpret some other language using a python program?) # e.g. input win

Re: Feature suggestion -- return if true

2011-04-12 Thread Colin J. Williams
On 12-Apr-11 06:55 AM, scattered wrote: On Apr 12, 2:21 am, James Mills wrote: On Tue, Apr 12, 2011 at 4:08 PM, Nobody wrote: It should be abundantly clear that this only returns if the expression is considered true, otherwise it continues on to the following statements. Uggh come on guys.

Re: Python IDE/text-editor

2011-04-16 Thread Colin J. Williams
On 15-Apr-11 23:20 PM, Alec Taylor wrote: Good Afternoon, I'm looking for an IDE which offers syntax-highlighting, code-completion, tabs, an embedded interpreter and which is portable (for running from USB on Windows). Here's a mockup of the app I'm looking for: http://i52.tinypic.com/2uojswz.p

Python IDE/text-editor

2011-04-16 Thread Colin J. Williams
On 15-Apr-11 23:20 PM, Alec Taylor wrote: > Good Afternoon, > > I'm looking for an IDE which offers syntax-highlighting, > code-completion, tabs, an embedded interpreter and which is portable > (for running from USB on Windows). > > Here's a mockup of the app I'm looking for: http://i52.tinypic.co

Re: A question about Python Classes

2011-04-21 Thread Pascal J. Bourguignon
chad writes: > Let's say I have the following > > class BaseHandler: > def foo(self): > print "Hello" > > class HomeHandler(BaseHandler): > pass > > > Then I do the following... > > test = HomeHandler() > test.foo() > > How can HomeHandler call foo() when I never created an in

Re: Function __defaults__

2011-04-25 Thread Colin J. Williams
On 24-Apr-11 13:07 PM, Ken Seehart wrote: On 4/24/2011 2:58 AM, Steven D'Aprano wrote: Consider this in Python 3.1: def f(a=42): ... return a ... f() 42 f.__defaults__ = (23,) f() 23 Is this an accident of implementation, or can I trust that changing function defaults in this fashion i

Re: Function __defaults__

2011-04-25 Thread Colin J. Williams
On 25-Apr-11 08:30 AM, Ken Seehart wrote: On 4/25/2011 4:59 AM, Colin J. Williams wrote: On 24-Apr-11 13:07 PM, Ken Seehart wrote: On 4/24/2011 2:58 AM, Steven D'Aprano wrote: Consider this in Python 3.1: def f(a=42): ... return a ... f() 42 f.__defaults__ = (23,) f() 23 Is th

<    1   2   3   4   5   6   7   8   9   10   >