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

Re: Two questions about style and some simple math

2009-01-20 Thread J Kenneth King
Spoofy writes: > .. .. > > 2. > > For maintaining the character attributes I creates a seperate class. I > wonder weather this is an "overuse" of OO (instead of just making the > attributes plain variables of the Char class) and if the way I wrote > this is OK (somehow this looks cool to me but

Re: Pyro deadlock

2009-01-20 Thread J Kenneth King
MatthewS writes: > I'd like to know if the following behavior is expected and can be > avoided: I have a Pyro server object that maintains a queue of work, > and multiple Pyro worker objects that take work off the queue by > calling a method on the server (get_work) and then return the work to >

Re: I'm a python addict !

2009-01-26 Thread J Kenneth King
Linuxguy123 writes: > I just started using python last week and I'm addicted. > > I hate Perl. I never did learn to use it with any competence. I has to > be the most obfuscated, cryptic language I've ever seen. Making it > "object oriented" only makes it worse ! > .. .. I program full-time

Re: I'm a python addict !

2009-01-26 Thread J Kenneth King
J Kenneth King writes: > Linuxguy123 writes: > >> I just started using python last week and I'm addicted. >> >> I hate Perl. I never did learn to use it with any competence. I has to >> be the most obfuscated, cryptic language I've ever seen. Maki

Re: Recommendation for a small web framework like Perl's CGI::Application to run as CGI?

2009-01-29 Thread J Kenneth King
excord80 writes: > I need to make a small, relatively low-traffic site that users can > create accounts on and log into. Scripts must run as cgi (no > mod_python or FastCGI is available). Can anyone recommend a small and > simple web framework for Python, maybe similar to Perl's > CGI::Applicatio

Re: What is wrong in my list comprehension?

2009-02-02 Thread J Kenneth King
Chris Rebert writes: > Python 2.6 (r26:66714, Nov 18 2008, 21:48:52) > [GCC 4.0.1 (Apple Inc. build 5484)] on darwin > Type "help", "copyright", "credits" or "license" for more information. bool(-1) > True > > str.find() returns -1 on failure (i.e. if the substring is not in the > given stri

Re: What is wrong in my list comprehension?

2009-02-02 Thread J Kenneth King
Chris Rebert writes: > Python 2.6 (r26:66714, Nov 18 2008, 21:48:52) > [GCC 4.0.1 (Apple Inc. build 5484)] on darwin > Type "help", "copyright", "credits" or "license" for more information. bool(-1) > True > > str.find() returns -1 on failure (i.e. if the substring is not in the > given stri

Re: What is wrong in my list comprehension?

2009-02-02 Thread J Kenneth King
Stephen Hansen writes: >>> str.find() returns -1 on failure (i.e. if the substring is not in the >>> given string). >>> -1 is considered boolean true by Python. >> >> That's an odd little quirk... never noticed that before. >> >> I just use regular expressions myself. >> >> Wouldn't this be somet

Re: What is wrong in my list comprehension?

2009-02-02 Thread J Kenneth King
Chris Rebert writes: > Python 2.6 (r26:66714, Nov 18 2008, 21:48:52) > [GCC 4.0.1 (Apple Inc. build 5484)] on darwin > Type "help", "copyright", "credits" or "license" for more information. bool(-1) > True > > str.find() returns -1 on failure (i.e. if the substring is not in the > given stri

Re: What is wrong in my list comprehension?

2009-02-02 Thread J Kenneth King
Chris Rebert writes: > Python 2.6 (r26:66714, Nov 18 2008, 21:48:52) > [GCC 4.0.1 (Apple Inc. build 5484)] on darwin > Type "help", "copyright", "credits" or "license" for more information. bool(-1) > True > > str.find() returns -1 on failure (i.e. if the substring is not in the > given stri

Re: Added-value of frameworks?

2009-02-04 Thread J Kenneth King
Matimus writes: > On Feb 4, 8:08 am, Gilles Ganault wrote: >> Hello >> >> If I wanted to build some social web site such as Facebook, what do >> frameworks like Django or TurboGears provide over writing a site from >> scratch using Python? >> >> Thank you for your feedback. > > Why not just look

Re: [Web 2.0] Added-value of frameworks?

2009-02-05 Thread J Kenneth King
Bruno Desthuilliers writes: > Gilles Ganault a écrit : >> Hello >> >> If I wanted to build some social web site such as Facebook, what do >> frameworks like Django or TurboGears provide over writing a site from >> scratch using Python? > > Quite a lot of abstractions and factorisation of the boil

Re: Flattening lists

2009-02-05 Thread J Kenneth King
mk writes: > Hello everybody, > > Any better solution than this? > > def flatten(x): > res = [] > for el in x: > if isinstance(el,list): > res.extend(flatten(el)) > else: > res.append(el) > return res > > a = [1, 2, 3, [4, 5, 6], [[7, 8], [9, 10

[ANN] TracShell 0.1 released

2009-02-12 Thread J Kenneth King
I tend to work a lot with Trac for project management and have always found the browser interface to be a productivity killer. I always wanted a simple command-line interface to Trac, but having never found one I found a little free time and got off my laurels to make one. TracShell 0.1 is an ear

Re: TracShell 0.1 released

2009-02-12 Thread J Kenneth King
Krzysztof Retel writes: > On 12 Feb, 14:06, J Kenneth King wrote: >> I tend to work a lot with Trac for project management and have always >> found the browser interface to be a productivity killer. I always >> wanted a simple command-line interface to Trac, but having

Re: is there a project running (GUI Builder for Python ) ?

2009-02-12 Thread J Kenneth King
azrael writes: > To be honest, in compare to Visual Studio, Gui Builders for wx > widgets are really bad. That's because Visual Studio is a Microsoft product to build interfaces for Microsoft products. wx on the other hand is cross platform and ergo, much more complicated. > Do you know if the

Re: [ANN] TracShell 0.1 released

2009-02-13 Thread J Kenneth King
J Kenneth King writes: > I tend to work a lot with Trac for project management and have always > found the browser interface to be a productivity killer. I always > wanted a simple command-line interface to Trac, but having never found > one I found a little free time and got off m

Re: is there a project running (GUI Builder for Python ) ?

2009-02-13 Thread J Kenneth King
gc_ott...@yahoo.ca writes: > ..I come from Delphi, and compared to Delphi, even Visual Studio >> vanishes ;-) > ...I don't even notice the difference between Delphi (which > I'm still using) >> and wxPython. >> >> I think this story happened to other people to, >> so instead of putting

Musings: Using decorators to reduce duplicate exception handling

2009-02-17 Thread J Kenneth King
I recently started a project called TracShell (http://code.google.com/p/tracshell) where I make heavy use of the xmlrpclib core module. When the number of RPC calls was small, wrapping each call in try/except was acceptable. However, this obviously will duplicate code all over the place. There ar

Re: Musings: Using decorators to reduce duplicate exception handling

2009-02-18 Thread J Kenneth King
"Gabriel Genellina" writes: > En Tue, 17 Feb 2009 21:12:57 -0200, J Kenneth King > escribió: > >> I recently started a project called TracShell >> (http://code.google.com/p/tracshell) where I make heavy use of the >> xmlrpclib core module. >> >>

Re: Musings: Using decorators to reduce duplicate exception handling

2009-02-19 Thread J Kenneth King
Cameron Simpson writes: > On 17Feb2009 15:12, J Kenneth King wrote: > | I recently started a project called TracShell > | (http://code.google.com/p/tracshell) where I make heavy use of the > | xmlrpclib core module. > | > | When the number of RPC calls was small, wrappin

Re: Python equivalent of Common Lisp Macros?

2008-11-26 Thread J Kenneth King
dpapathanasiou <[EMAIL PROTECTED]> writes: > I'm using the feedparser library to extract data from rss feed items. > > After I wrote this function, which returns a list of item titles, I > noticed that most item attributes would be retrieved the same way, > i.e., the function would look exactly th

Re: RELEASED Python 3.0 final

2008-12-04 Thread J Kenneth King
Barry Warsaw <[EMAIL PROTECTED]> writes: > On behalf of the Python development team and the Python community, I > am happy to announce the release of Python 3.0 final. Yay! Thanks for all the great work. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.0 automatic decoding of UTF16

2008-12-05 Thread J Kenneth King
Johannes Bauer <[EMAIL PROTECTED]> writes: > Traceback (most recent call last): > File "./modify.py", line 12, in > a = AddressBook("2008_11_05_Handy_Backup.txt") > File "./modify.py", line 7, in __init__ > line = f.readline() > File "/usr/local/lib/python3.0/io.py", line 1807, in r

Re: pydb 1.24

2008-12-11 Thread J Kenneth King
[EMAIL PROTECTED] (R. Bernstein) writes: > This release is to clear out some old issues. It contains some > bugfixes, document corrections, and enhancements. Tests were > revised for Python 2.6 and Python without readline installed. A bug > involving invoking from ipython was fixed. The "frame" co

Re: Are Django/Turbogears too specific?

2008-12-21 Thread J Kenneth King
Gilles Ganault writes: > Hi > > I'd like to rewrite a Web 2.0 PHP application in Python with AJAX, and > it seems like Django and Turbogears are the frameworks that have the > most momentum. > > I'd like to use this opportunity to lower the load on servers, as the > PHP application wasn't built t

Re: If your were going to program a game...

2009-01-02 Thread J Kenneth King
Tokyo Dan writes: > If your were going to program a game in python what technologies would > you use? > > The game is a board game with some piece animations, but no movement > animation...think of a chess king exploding. The game runs in a > browser in a window of a social site built around the

Re: Is there a better algorithm?

2009-01-02 Thread J Kenneth King
Kottiyath writes: > I have the following list of tuples: > L = [(1, 2), (3, 4, 5), (6, 7)] > > I want to loop through the list and extract the values. > The only algorithm I could think of is: for i in l: > ... u = None > ... try: > ... (k, v) = i > ... except ValueError: > ... (k, u,

Re: Is there a better algorithm?

2009-01-02 Thread J Kenneth King
Paul Rubin writes: > Kottiyath writes: >> I have the following list of tuples: >> L = [(1, 2), (3, 4, 5), (6, 7)] >> I want to loop through the list and extract the values. > > Others have suggested messy ways to code what you're asking. At another > level, that li

Re: Noob question: Is all this typecasting normal?

2009-01-06 Thread J Kenneth King
"Gabriel Genellina" writes: > En Mon, 05 Jan 2009 02:03:26 -0200, Roy Smith escribió: > > >> The other day, I came upon this gem. It's a bit of perl embedded in a >> Makefile; this makes it even more gnarly because all the $'s get >> doubled to >> hide them from make: >> >> define absmondir >>

Re: image recogniton?

2009-01-06 Thread J Kenneth King
Li Han writes: > Hi! I know little about the computer image processing, and now I have > a fancy problem which is how to read the time from the picture of a > clock by programming ? Is there anyone who can give me some > suggestions? > Thank! > Li Han I do work in object recognition, and I

Re: looking for tips on how to implement "ruby-style" Domain Specific Language in Python

2009-01-06 Thread J Kenneth King
Jonathan Gardner writes: > On Jan 6, 8:18 am, sturlamolden wrote: >> On Jan 6, 4:32 pm, mark wrote: >> >> > I want to implement a internal DSL in Python. I would like the syntax >> > as human readable as possible. >> >> Also beware that Python is not Lisp. You cannot define new syntax (yes >> I

Re: looking for tips on how to implement "ruby-style" Domain Specific Language in Python

2009-01-07 Thread J Kenneth King
Jonathan Gardner writes: > On Jan 6, 12:24 pm, J Kenneth King wrote: >> Jonathan Gardner writes: >> > On Jan 6, 8:18 am, sturlamolden wrote: >> >> On Jan 6, 4:32 pm, mark wrote: >> >> >> > I want to implement a internal DSL in Python. I

Re: looking for tips on how to implement "ruby-style" Domain Specific Language in Python

2009-01-07 Thread J Kenneth King
Kay Schluehr writes: > On 7 Jan., 16:50, J Kenneth King wrote: > >> Python expressions are not >> data types either and hence no macros -- I can't write a python function >> that generates python code at compile time. > > Have you ever considered there a

Re: looking for tips on how to implement "ruby-style" Domain Specific Language in Python

2009-01-08 Thread J Kenneth King
Jonathan Gardner writes: > On Jan 7, 9:16 am, "Chris Mellon" wrote: >> >> The OP wants a Ruby-style DSL by which he means "something that lets >> me write words instead of expressions". The ruby syntax is amenable to >> this, python (and lisp, for that matter) syntax is not and you can't >> impl

Re: looking for tips on how to implement "ruby-style" Domain Specific Language in Python

2009-01-08 Thread J Kenneth King
Kay Schluehr writes: > On 8 Jan., 16:25, J Kenneth King wrote: > >> As another poster mentioned, eventually PyPy will be done and then >> you'll get more of an "in-Python" DSL. > > May I ask why you consider it as important that the interpreter is &

Re: PIL problem

2008-10-08 Thread J Kenneth King
bfrederi <[EMAIL PROTECTED]> writes: > I am having a problem using PIL. I am trying to crop and image to a > square, starting from the center of the image, but when I try to crop > the image, it won't crop. Here are the relevant code snippets: > > ### Function I am testing ### > def create_square_

Re: PYTHON WORKING WITH PERL ??

2008-10-16 Thread J Kenneth King
Pat <[EMAIL PROTECTED]> writes: > Sean DiZazzo wrote: >> On Sep 29, 12:44 pm, "Blubaugh, David A." <[EMAIL PROTECTED]> >> wrote: >>> Sir, >>> >>> You are absolutely correct. I was praying to G_d I did not have to >>> slaughter my project's source code in this manner. However, like life >>> itsel

Re: PYTHON WORKING WITH PERL ??

2008-10-16 Thread J Kenneth King
Joshua Kugler <[EMAIL PROTECTED]> writes: > Pat wrote: >>> Rewrite everything in python. Save yourself now...while you still >>> can. >>> >>> ~Sean >> >> Trust me. Sean is absolutely correct. I'm currently in the process of >> converting a large Perl project to Python (and learning Python at th

python extensions: including project local headers

2008-10-23 Thread J Kenneth King
Hey everyone, I'm working on a python extension wrapper around Rob Hess' implementation of a SIFT feature detector. I'm working on a computer-vision based project that requires interfacing with Python at the higher layers, so I figured the best way to handle this would be in C (since my initial i

Re: python extensions: including project local headers

2008-10-23 Thread J Kenneth King
Robert Kern <[EMAIL PROTECTED]> writes: > Philip Semanchuk wrote: >> >> On Oct 23, 2008, at 11:36 AM, J Kenneth King wrote: >> >>> >>> Hey everyone, >>> >>> I'm working on a python extension wrapper around Rob Hess' >

Re: python extensions: including project local headers

2008-10-23 Thread J Kenneth King
Philip Semanchuk <[EMAIL PROTECTED]> writes: > On Oct 23, 2008, at 11:36 AM, J Kenneth King wrote: > >> >> Hey everyone, >> >> I'm working on a python extension wrapper around Rob Hess' >> implementation of a SIFT feature detector. I'm wo

Re: python extensions: including project local headers

2008-10-24 Thread J Kenneth King
Philip Semanchuk <[EMAIL PROTECTED]> writes: > On Oct 23, 2008, at 3:18 PM, J Kenneth King wrote: > >> Philip Semanchuk <[EMAIL PROTECTED]> writes: >> >>> On Oct 23, 2008, at 11:36 AM, J Kenneth King wrote: >>> >>>> >>>> Hey

Re: Python suitable for Midi ?

2008-10-29 Thread J Kenneth King
Derek Martin <[EMAIL PROTECTED]> writes: > On Tue, Oct 28, 2008 at 06:54:57PM +0200, Chuckk Hubbard wrote: >> The problem I've run into is that I can't set the audio to a higher >> priority than the GUI (Tkinter). If I move the mouse over the app, no >> matter what, I get audio dropouts. AFAICT

Re: Daemon and logging - the best approach?

2008-11-07 Thread J Kenneth King
Lech Karol Pawłaszek <[EMAIL PROTECTED]> writes: > Hello. > > I'm trying to make a daemon and I want to log to a file its activity. > I'm using logging module with a configuration file for it (loaded via > fileConfig()). > > And now I want to read logging config file before daemonize the program >

Re: best python unit testing framwork

2008-11-11 Thread J Kenneth King
Brendan Miller <[EMAIL PROTECTED]> writes: > What would heavy python unit testers say is the best framework? > > I've seen a few mentions that maybe the built in unittest framework > isn't that great. I've heard a couple of good things about py.test and > nose. Are there other options? Is there an

Re: duck-type-checking?

2008-11-12 Thread J Kenneth King
Joe Strout <[EMAIL PROTECTED]> writes: > Let me preface this by saying that I think I "get" the concept of > duck- > typing. > > However, I still want to sprinkle my code with assertions that, for > example, my parameters are what they're supposed to be -- too often I > mistakenly pass in somethi

Re: Multiprocessing vs. [Pyro, RPyC]

2008-11-15 Thread J Kenneth King
Jeffrey Barish <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: > >> >> Jeffrey> With the release of multiprocessing in Python 2.6, is there >> any Jeffrey> reason to use Pyro or RPyC? >> >> As far as I know the multiprocessing module only works on one machine >> (multi-cpu or mult

function parameter scope python 2.5.2

2008-11-20 Thread J Kenneth King
I recently encountered some interesting behaviour that looks like a bug to me, but I can't find the appropriate reference to any specifications to clarify whether it is a bug. Here's the example code to demonstrate the issue: class SomeObject(object): def __init__(self): self.words

Re: function parameter scope python 2.5.2

2008-11-20 Thread J Kenneth King
J Kenneth King <[EMAIL PROTECTED]> writes: > I recently encountered some interesting behaviour that looks like a bug > to me, but I can't find the appropriate reference to any specifications > to clarify whether it is a bug. > > Here's the example code to d

Re: function parameter scope python 2.5.2

2008-11-21 Thread J Kenneth King
alex23 <[EMAIL PROTECTED]> writes: > On Nov 21, 9:40 am, J Kenneth King <[EMAIL PROTECTED]> wrote: >> Of course, providing a shallow (or deep as necessary) copy makes it >> work, I'm curious as to why the value passed as a parameter to a >> function outside

Re: function parameter scope python 2.5.2

2008-11-21 Thread J Kenneth King
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Thu, 20 Nov 2008 18:31:12 -0500, J Kenneth King wrote: > >> Of course I expected that recursive_func() would receive a copy of >> weird_obj.words but it appears to happily modify the object. > > I am curious

Re: function parameter scope python 2.5.2

2008-11-21 Thread J Kenneth King
Peter Pearson <[EMAIL PROTECTED]> writes: > On Fri, 21 Nov 2008 10:12:08 -0500, J Kenneth King wrote: >> Steven D'Aprano <[EMAIL PROTECTED]> writes: >>> >>> I am curious why you thought that. What made you think Python should/did >>> make a c

ANN: tracshell 0.1r23

2009-03-04 Thread J Kenneth King
ho've already helped a lot by submitting patches. Bug reports, feature requests, comments and critiques are encouraged! All the best, J Kenneth King -- http://mail.python.org/mailman/listinfo/python-list

Re: While loop

2009-03-05 Thread J Kenneth King
Fab86 writes: > On Mar 5, 5:23 pm, Marco Mariani wrote: >> Fab86 wrote: >> > Is it possible to get the program to catch the exception, wait 10 >> > seconds, then carry of from where it was rather than starting again? >> >> something like this? probably works in PASCAL as well :) >> >> > i=0 >> >

Re: Roundup Issue Tracker release 1.4.7

2009-03-17 Thread J Kenneth King
Richard Jones writes: > I'm proud to release version 1.4.7 of Roundup. > - Allow CGI frontend to serve XMLRPC requests. > - Added XMLRPC actions, as well as bridging CGI actions to XMLRPC actions. Sweet. I'm working on a small project called TracShell which is a command-line front-end to the T

mocking xmlrpclib

2009-03-23 Thread J Kenneth King
At the risk of sounding like I don't know what I'm doing, I must say that I am finding it rather difficult/tedious to mock the xmlrpclib interface using minimock. I refuse to believe that I'm the only developer to have tried this before, but google isn't being my friend and I can't seem to get it

Re: HTML Generation

2009-04-03 Thread J Kenneth King
Tino Wildenhain writes: > Hi Mike, > > > Mike wrote: >> Hello all, >> >> I'm writing a web app and wanted to do some html generation (I >> really do not like to maintain or write html). >> >> I'm thinking of writing a dsl based on the following: >> >> def html(): >> return >> >> def a(): >>

Re: HTML Generation

2009-04-03 Thread J Kenneth King
Stefan Behnel writes: > J Kenneth King wrote: >> from tags import html, head, meta, title, body, div, p, a >> >> mypage = html( >> head( >> meta(attrs={'http-equiv': "Content-Type",

Re: decorators don't play nice with nose?

2009-04-06 Thread J Kenneth King
hyperboreean writes: > From: hyperboreean > Subject: decorators don't play nice with nose? > Newsgroups: comp.lang.python > To: python-list@python.org > Date: Mon, 06 Apr 2009 11:01:04 +0300 > > Hi, I am trying to test the business part of a web service. For this I > am using unittest & nose. >

unpythonic use of property()?

2009-04-17 Thread J Kenneth King
Consider: code: class MyInterface(object): def __get_id(self): return self.__id id = property(fget=__get_id) def __init__(self, id, foo): self.__id = id self.foo = foo class MyInterf

Re: unpythonic use of property()?

2009-04-20 Thread J Kenneth King
Carl Banks writes: > On Apr 17, 4:00 pm, Scott David Daniels wrote: >> Carl Banks wrote: >> > On Apr 17, 10:21 am, J Kenneth King wrote: >> >> Consider: >> >> >> code: >> >> --

Re: unpythonic use of property()?

2009-04-22 Thread J Kenneth King
Luis Zarrabeitia writes: > On Monday 20 April 2009 11:29:19 am J Kenneth King wrote: >> Changing the ID value would break things on the server, so I >> wanted to write the interface class to respect those conventions. > > Then, take this opportunity fix the server and pre

Re: unpythonic use of property()?

2009-04-22 Thread J Kenneth King
Luis Zarrabeitia writes: > On Wednesday 22 April 2009 01:44:38 pm J Kenneth King wrote: >> > Then, take this opportunity fix the server and prevent it from breaking >> > once you change the ID, because: >> >> Unfortunately it's not my server to fix. I

Re: python list handling and Lisp list handling

2009-04-26 Thread J Kenneth King
Steven D'Aprano writes: > On Sat, 25 Apr 2009 23:51:18 -0700, namekuseijin wrote: > >> On Apr 26, 1:31 am, Steven D'Aprano > cybersource.com.au> wrote: >>> On Fri, 24 Apr 2009 21:01:10 -0700, Carl Banks wrote: >>> > That's because Python lists aren't lists. >>> >>> Surely you meant to say that Li

Re: list comprehension question

2009-05-01 Thread J Kenneth King
Chris Rebert writes: > On Thu, Apr 30, 2009 at 5:56 PM, Ross wrote: >> If I have a list of tuples a = [(1,2), (3,4), (5,6)], and I want to >> return a new list of each individual element in these tuples, I can do >> it with a nested for loop but when I try to do it using the list >> comprehensio

Re: list comprehension question

2009-05-05 Thread J Kenneth King
Emile van Sebille writes: > On 5/1/2009 7:31 AM J Kenneth King said... >> Chris Rebert writes: >>> b = [] >>> for pair in a: >>> for item in pair: >>> b.append(item) >> >> This is much more clear than a nested comprehension.

Re: Any idea to emulate tail -f

2009-05-05 Thread J Kenneth King
Iain King writes: > On May 5, 7:00 am, Joel Juvenal Rivera Rivera > wrote: >> I want to make something very similar to  the command tail -f (follow a >> file), i have been trying  with some while True and some microsleeps >> (about .1 s); did someone has already done something like this? >> >> A

Re: list comprehension question

2009-05-06 Thread J Kenneth King
Emile van Sebille writes: > On 5/5/2009 9:15 AM J Kenneth King said... > >> List comprehensions can make a reader of your code apprehensive >> because it can read like a run-on sentence and thus be difficult to >> parse. The Python documentation discourages their use a

Re: list comprehension question

2009-05-07 Thread J Kenneth King
Steven D'Aprano writes: > On Wed, 06 May 2009 09:48:51 -0400, J Kenneth King wrote: > >> Emile van Sebille writes: >> >>> On 5/5/2009 9:15 AM J Kenneth King said... >>> >>>> List comprehensions can make a reader of your code apprehensive >

Re: Best practice for operations on streams of text

2009-05-07 Thread J Kenneth King
James writes: > Hello all, > I'm working on some NLP code - what I'm doing is passing a large > number of tokens through a number of filtering / processing steps. > > The filters take a token as input, and may or may not yield a token as > a result. For example, I might have filters which lowerca

Re: list comprehension question

2009-05-08 Thread J Kenneth King
Terry Reedy writes: > J Kenneth King wrote: >> >> Keep in mind that nested comprehensions are still available because >> they do have a use case that justifies their existence. > > Nested comprehensions are available because because the syntax makes > them ava

Re: list comprehension question

2009-05-11 Thread J Kenneth King
Steven D'Aprano writes: > On Thu, 07 May 2009 13:28:10 -0400, J Kenneth King wrote: > >> Steven D'Aprano writes: >> >>> On Wed, 06 May 2009 09:48:51 -0400, J Kenneth King wrote: >>> >>>> Emile van Sebille writes: >>>&g

Re: Annoying feedparser issues

2009-05-19 Thread J Kenneth King
John Nagle writes: > This really isn't the fault of the "feedparser" module, but it's > worth mentioning. > > I have an application which needs to read each new item from a feed > as it shows up, as efficiently as possible, because it's monitoring multiple > feeds. I want exactly one cop

Re: what I would like python.el to do (and maybe it does)

2009-05-25 Thread J Kenneth King
Giovanni Gherdovich writes: > Hello everybody, > > basically I'm writing here since I cannot > make my python.el work (a major mode for writing > python with emacs), but I would also like to share > my user experience and tell you what I think > an emacs mode should do, why do I like them > and h

Re: What text editor is everyone using for Python

2009-05-25 Thread J Kenneth King
LittleGrasshopper writes: > With so many choices, I was wondering what editor is the one you > prefer when coding Python, and why. I normally use vi, and just got > into Python, so I am looking for suitable syntax files for it, and > extra utilities. I dabbled with emacs at some point, but couldn

Re: What text editor is everyone using for Python

2009-05-26 Thread J Kenneth King
Lacrima writes: > I am new to python. > And now I am using trial version of Wing IDE. > But nobody mentioned it as a favourite editor. > So should I buy it when trial is expired or there are better choices? That is a slightly better question. Try some of the free alternatives. I do happen to u

Re: which database is suitable for small applications

2009-05-26 Thread J Kenneth King
Jean-Michel Pichavant writes: > Kalyan Chakravarthy wrote: >> Hi All, >> can any one suggest me which database I can use for my >> small application(to store user names ,passwords, very few other >> data.. ) >> I am using Python, Google Apps and guide me how to connect to >> database, I

Re: what I would like python.el to do (and maybe it does)

2009-05-29 Thread J Kenneth King
Piet van Oostrum writes: >>>>>> J Kenneth King (JKK) wrote: > >>JKK> I find that it does work, but unlike SLIME for lisp, it just imports the >>statement. > >>JKK> It confused me at first, but basically the interpreter doesn't provide >&g

Re: what I would like python.el to do (and maybe it does)

2009-06-01 Thread J Kenneth King
Piet van Oostrum writes: >>>>>> J Kenneth King (JKK) wrote: > >>JKK> Well, that's the thing -- type a statement into a python interpreter and >>JKK> you just get a new prompt. > >>JKK> LISP has a REPL, so you get some sort of feedback

Re: Python Programming Challenges for beginners?

2009-11-27 Thread J Kenneth King
astral orange <457r0...@gmail.com> writes: > Hi- > > I am reading the online tutorial along with a book I bought on Python. > I would like to test out what I know so far by solving programming > challenges. Similar to what O'Reilly Learning Perl has. I really > enjoyed the challenges at the end of

Re: Go versus Brand X

2009-11-30 Thread J Kenneth King
a...@pythoncraft.com (Aahz) writes: > Comparing Go to another computer language -- do you recognize it? > > http://www.cowlark.com/2009-11-15-go/ If you skip to the conclusion, you'll be better off. The author has an interesting point. Go (the language) is not really ground-breaking. I don't u

Re: How decoupled are the Python frameworks?

2009-12-07 Thread J Kenneth King
shocks writes: > Hi > > I'm getting back into Python after a long break. I've been developing > large enterprise apps solely with Adobe Flex (ActionScript) for the > past couple years. During that time I've used a number of 'MVC' > frameworks to glue the bits together - among them Cairngorm, a

Re: Question about 'remote objects'

2009-12-09 Thread J Kenneth King
"Frank Millman" writes: > Hi all > > I am writing a multi-user business/accounting application. It is getting > rather complex and I am looking at how to, not exactly simplify it, but find > a way to manage the complexity. > > I have realised that it is logically made up of a number of services

Re: Perl to Python conversion

2009-12-10 Thread J Kenneth King
martin.sch...@gmail.com (Martin Schöön) writes: > First off: I am new here and this is my first post after > lurking for quite some time. Hi. > Second off: I don't know much Python---yet. It's not a very big language. If you have experience programming in other languages, you can probably pick

Re: Object Relational Mappers are evil (a meditation)

2009-12-16 Thread J Kenneth King
Steven D'Aprano writes: > On Fri, 11 Dec 2009 19:20:21 -0500, Steve Holden wrote: > >> Simon Forman wrote: >> [...] >>> As far as the OP rant goes, my $0.02: bad programmers will write bad >>> code in any language, with any tool or system or environment they're >>> given. If you want to avoid b

Re: Object Relational Mappers are evil (a meditation)

2009-12-16 Thread J Kenneth King
r0g writes: > J Kenneth King wrote: >> Steven D'Aprano writes: >> >>> On Fri, 11 Dec 2009 19:20:21 -0500, Steve Holden wrote: >>> > > >>>> Hear, hear! >>> That's all very well, but some languages and techniques encourage th

Re: Object Relational Mappers are evil (a meditation)

2009-12-16 Thread J Kenneth King
Neil Cerutti writes: > On 2009-12-16, J Kenneth King wrote: >> The language doesn't encourage anything. It's just a medium >> like oil paints and canvas. A painting can be good or bad >> despite the medium it is constructed on. The skill of the >> pai

Re: Object Relational Mappers are evil (a meditation)

2009-12-21 Thread J Kenneth King
Lie Ryan writes: > On 12/17/2009 3:17 PM, J Kenneth King wrote: >> A language is a thing. It may have syntax and semantics that bias it >> towards the conventions and philosophies of its designers. But in the >> end, a language by itself would have a hard time convincin

Re: Object Relational Mappers are evil (a meditation)

2009-12-23 Thread J Kenneth King
Steven D'Aprano writes: > On Mon, 21 Dec 2009 11:44:29 -0500, J Kenneth King wrote: > >> A programmer that >> lacks critical thinking is a bad programmer. The language they use has >> no bearing on such human facilities. > > That's nonsense, and I can

Re: Object Relational Mappers are evil (a meditation)

2009-12-29 Thread J Kenneth King
Steven D'Aprano writes: > On Wed, 23 Dec 2009 10:55:19 -0500, J Kenneth King wrote: > >> Steven D'Aprano writes: >> >>> On Mon, 21 Dec 2009 11:44:29 -0500, J Kenneth King wrote: >>> >>>> A programmer that >>>> lacks cri

Re: nested structure with "internal references"

2009-09-28 Thread J Kenneth King
Hendrik van Rooyen writes: > On Friday, 25 September 2009 19:11:06 Torsten Mohr wrote: > >> I'd like to use a nested structure in memory that consists >> of dict()s and list()s, list entries can be dict()s, other list()s, >> dict entries can be list()s or other dict()s. >> >> The lists and dicts

Re: Object Relational Mappers are evil (a meditation)

2009-10-22 Thread J Kenneth King
Aaron Watters writes: > On Oct 16, 10:35 am, mario ruggier wrote: >> On Oct 5, 4:25 pm, Aaron Watters wrote: >> >> > Occasionally I fantasize about making a non-trivial change >> > to one of these programs, but I strongly resist going further >> > than that because the ORM meatgrinder makes it

Re: What IDE has good git and python support?

2009-10-28 Thread J Kenneth King
Aweks writes: > what do you use? emacs. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python + twisted = Raindrop (in part)

2009-10-28 Thread J Kenneth King
Terry Reedy writes: > Rrom: > First look: inside Mozilla's Raindrop messaging platform > > http://arstechnica.com/open-source/news/2009/10/first-look-inside-mozillas-raindrop-messaging-platform.ars > > "The backend components that are responsible for retrieving and > processing messages are coded

Re: substituting list comprehensions for map()

2009-11-02 Thread J Kenneth King
Steven D'Aprano writes: > On Sun, 01 Nov 2009 23:54:16 -0800, Jon P. wrote: > >> I'd like to do: >> >> resultlist = operandlist1 + operandlist2 >> >> where for example >> >> operandlist1=[1,2,3,4,5] >> operandlist2=[5,4,3,2,1] >> >> and resultlist will become [6,6,6,6,6]. Using map(), I can

Re: substituting list comprehensions for map()

2009-11-03 Thread J Kenneth King
Ben Finney writes: > J Kenneth King writes: > >> Steven D'Aprano writes: >> >> > from operator import add >> > map(add, operandlist1, operandlist2) >> >> This is the best solution so far. > > Strange to say it's a solution, wh

Re: substituting list comprehensions for map()

2009-11-04 Thread J Kenneth King
Steven D'Aprano writes: > On Tue, 03 Nov 2009 10:22:28 -0500, J Kenneth King wrote: > >> However in this case the procedure by which we derive the value is not >> important or even interesting. It is much more succinct to think of the >> operation as a value and exp

  1   2   >