Re: Refactor/Rewrite Perl code in Python

2011-07-25 Thread J Kenneth King
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: On Sun, Jul 24, 2011 at 7:29 PM, Shashwat Anand anand.shash...@gmail.com 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

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 anthony.hw.k...@gmail.com 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

Re: python interview quuestions

2010-08-10 Thread J Kenneth King
James Mills prolo...@shortcircuit.net.au writes: On Sat, Aug 7, 2010 at 4:32 AM, Tim Chase python.l...@tim.thechases.com wrote: I would like to aquint myself with Python Interview questions This came up a while ago: http://www.mail-archive.com/python-list@python.org/msg168961.html Most

Re: List of lists surprising behaviour

2010-06-17 Thread J Kenneth King
candide cand...@free.invalid writes: Let's the following code : t=[[0]*2]*3 t [[0, 0], [0, 0], [0, 0]] t[0][0]=1 t [[1, 0], [1, 0], [1, 0]] Rather surprising, isn't it ? Not at all, actually. I'd be surprised if the multiplication operator was aware of object constructors. Even

Re: Can someone please make it more pythonic or better?

2010-04-19 Thread J Kenneth King
Oltmans rolf.oltm...@gmail.com writes: Greetings Python superstars, I've a directory structure like following tests / __init__.py testfile.py testfile.py contains following code import unittest class Calculator(unittest.TestCase): def test_add(self): print

Re: Overcoming python performance penalty for multicore CPU

2010-02-08 Thread J Kenneth King
Paul Rubin no.em...@nospam.invalid writes: Stefan Behnel stefan...@behnel.de writes: Well, if multi-core performance is so important here, then there's a pretty simple thing the OP can do: switch to lxml. http://blog.ianbicking.org/2008/03/30/python-html-parser-performance/ Well, lxml is

Re: Object Relational Mappers are evil (a meditation)

2009-12-29 Thread J Kenneth King
Steven D'Aprano st...@remove-this-cybersource.com.au writes: On Wed, 23 Dec 2009 10:55:19 -0500, J Kenneth King wrote: Steven D'Aprano st...@remove-this-cybersource.com.au writes: On Mon, 21 Dec 2009 11:44:29 -0500, J Kenneth King wrote: A programmer that lacks critical thinking is a bad

Re: Object Relational Mappers are evil (a meditation)

2009-12-23 Thread J Kenneth King
Steven D'Aprano st...@remove-this-cybersource.com.au 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 demonstrate

Re: Object Relational Mappers are evil (a meditation)

2009-12-21 Thread J Kenneth King
Lie Ryan lie.1...@gmail.com 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 convincing a human

Re: Object Relational Mappers are evil (a meditation)

2009-12-16 Thread J Kenneth King
Steven D'Aprano st...@remove-this-cybersource.com.au 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.

Re: Object Relational Mappers are evil (a meditation)

2009-12-16 Thread J Kenneth King
r0g aioe@technicalbloke.com writes: J Kenneth King wrote: Steven D'Aprano st...@remove-this-cybersource.com.au writes: On Fri, 11 Dec 2009 19:20:21 -0500, Steve Holden wrote: snip Hear, hear! That's all very well, but some languages and techniques encourage the programmer to write

Re: Object Relational Mappers are evil (a meditation)

2009-12-16 Thread J Kenneth King
Neil Cerutti ne...@norwich.edu writes: On 2009-12-16, J Kenneth King ja...@agentultra.com 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 painter is what

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 it

Re: Question about 'remote objects'

2009-12-09 Thread J Kenneth King
Frank Millman fr...@chagford.com 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

Re: How decoupled are the Python frameworks?

2009-12-07 Thread J Kenneth King
shocks benmari...@googlemail.com 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 -

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

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 the

Re: Python/HTML integration: phileas v0.3 released

2009-11-23 Thread J Kenneth King
papa hippo hippost...@gmail.com writes: On 20 nov, 09:02, Stefan Behnel stefan...@behnel.de wrote: papa hippo, 19.11.2009 19:53: The prime goal of 'phileas' is to enable html code to be seamlessly included in python code in a natural looking syntax, without resorting to templatng

Re: Perl conversion to python...

2009-11-23 Thread J Kenneth King
Benjamin Schollnick bscholln...@gmail.com writes: Folks, I'm having some issues here with pyserial trying to translate a perl script to python... It's probably my inexperience with PySerial perl that is troubling me... Can anyone assist? I'm concerned, since I can't seem to receive

Re: python simply not scaleable enough for google?

2009-11-17 Thread J Kenneth King
David Cournapeau courn...@gmail.com writes: On Tue, Nov 17, 2009 at 10:48 PM, Aaron Watters aaron.watt...@gmail.com wrote: I don't think Python and Go address the same set of programmer desires.  For example, Go has a static type system.  Some programmers find static type systems to be

Re: object serialization as python scripts

2009-11-16 Thread J Kenneth King
King animator...@gmail.com writes: Why is it easier than the above mentioned - they are *there* (except the custom xml), and just can be used. What don't they do you want to do? Other than that, and even security issues put aside, I don't see much difference between pickle and python code,

Re: python simply not scaleable enough for google?

2009-11-12 Thread J Kenneth King
mcherm mch...@gmail.com writes: On Nov 11, 7:38 pm, Vincent Manis vma...@telus.net wrote: 1. The statement `Python is slow' doesn't make any sense to me. Python is a programming language; it is implementations that have speed or lack thereof. [...] 2. A skilled programmer could build an

Re: substituting list comprehensions for map()

2009-11-04 Thread J Kenneth King
Steven D'Aprano ste...@remove.this.cybersource.com.au 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

Re: substituting list comprehensions for map()

2009-11-02 Thread J Kenneth King
Steven D'Aprano ste...@remove.this.cybersource.com.au 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].

Re: What IDE has good git and python support?

2009-10-28 Thread J Kenneth King
Aweks a...@ewadev.com 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 tjre...@udel.edu 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

Re: Object Relational Mappers are evil (a meditation)

2009-10-22 Thread J Kenneth King
Aaron Watters aaron.watt...@gmail.com writes: On Oct 16, 10:35 am, mario ruggier mario.rugg...@gmail.com wrote: On Oct 5, 4:25 pm, Aaron Watters aaron.watt...@gmail.com wrote: Occasionally I fantasize about making a non-trivial change to one of these programs, but I strongly resist going

Re: nested structure with internal references

2009-09-28 Thread J Kenneth King
Hendrik van Rooyen hend...@microcorp.co.za 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

Re: SQLite or files?

2009-09-17 Thread J Kenneth King
ici iltch...@gmail.com writes: I like shelve for saving small amounts of data, user preferences, recent files etc. http://docs.python.org/library/shelve.html I like it too, but I hear the great powers that be are going to deprecate it. For Qt use

escaping characters in filenames

2009-07-29 Thread J Kenneth King
I wrote a script to process some files using another program. One thing I noticed was that both os.listdir() and os.path.walk() will return unescaped file names (ie: My File With Spaces Stuff instead of My\ File\ With\ Spaces\ \\ Stuff). I haven't had much success finding a module or recipe

Re: escaping characters in filenames

2009-07-29 Thread J Kenneth King
Nobody nob...@nowhere.com writes: On Wed, 29 Jul 2009 09:29:55 -0400, J Kenneth King wrote: I wrote a script to process some files using another program. One thing I noticed was that both os.listdir() and os.path.walk() will return unescaped file names (ie: My File With Spaces Stuff

Re: Script runs manually, but cron fails

2009-07-27 Thread J Kenneth King
Bryan bryanv...@gmail.com writes: I have a backup script that runs fine when I run it manually from the command line. When I run it with cron, the script stops running at random points in the source code. The script calls rsync with the subprocess module, which in turn uses ssh to backup

Re: Ann: Google releases Python-based open-source NX server

2009-07-16 Thread J Kenneth King
Robert Kern robert.k...@gmail.com writes: On 2009-07-16 09:51, J Kenneth King wrote: jknjkn...@nicorp.f9.co.uk writes: Google quietly releases open-source NX server ...written in Python, apparently http://www.computerworld.com/s/article/9135504

Re: [0, 0, 0, 1, 1, 1, 0] ... remove all 0 values

2009-07-08 Thread J Kenneth King
Friðrik Már Jónsson frid...@pyth.net writes: ma wrote: filter(lambda x: x, your_list) Good call! Equivalent but more efficient: filter(None, your_list) Regards, Friðrik Már I was wondering when someone would mention filter() -- http://mail.python.org/mailman/listinfo/python-list

Re: Python/pyobjC Apps on iPhone now a possibility?

2009-07-07 Thread J Kenneth King
Dr Mephesto dnh...@googlemail.com writes: I have been following the discussion about python and pyobjc on the iphone, and it seemed to me that the app-store rules prohibited embedded interpreters; so, python apps are a no-no. But now it seems that the Rubyists have the option that we don't.

Re: Python/pyobjC Apps on iPhone now a possibility?

2009-07-07 Thread J Kenneth King
Dr Mephesto dnh...@googlemail.com writes: Sure, I am learning Objective C already, but the syntax is really unfriendly after python. I think it really depends on the type of app you want to write. Anything held back by network delays or that sits around waiting for user input are perfectly

Re: Python/pyobjC Apps on iPhone now a possibility?

2009-07-07 Thread J Kenneth King
Stef Mientki stef.mien...@gmail.com writes: So, the question is, can the same thing be done for Python apps? I love Python and all, but it'd be apt to ask, what's the point? The iPhone is running on what? A 400Mhz ARM processor? Resources on the device are already limited; running

Re: Code that ought to run fast, but can't due to Python limitations.

2009-07-06 Thread J Kenneth King
a...@pythoncraft.com (Aahz) writes: In article mailman.2639.1246802753.8015.python-l...@python.org, Hendrik van Rooyen m...@microcorp.co.za wrote: But wait - maybe if he passes an iterator around - the equivalent of for char in input_stream... Still no good though, unless the next call to the

Re: multiprocessing: pool with blocking queue

2009-07-02 Thread J Kenneth King
masher vertesp...@gmail.com writes: My questions, then, is: Is there a more elegant/pythonic way of doing what I am trying to do with the current Pool class? Forgive me, I may not fully understand what you are trying to do here (I've never really used multiprocessing all that much)... But

Re: multiprocessing: pool with blocking queue

2009-07-02 Thread J Kenneth King
masher vertesp...@gmail.com writes: On Jul 2, 12:06 pm, J Kenneth King ja...@agentultra.com wrote: masher vertesp...@gmail.com writes: My questions, then, is: Is there a more elegant/pythonic way of doing what I am trying to do with the current Pool class? Forgive me, I may not fully

Re: fastest native python database?

2009-06-18 Thread J Kenneth King
per perfr...@gmail.com writes: hi all, i'm looking for a native python package to run a very simple data base. i was originally using cpickle with dictionaries for my problem, but i was making dictionaries out of very large text files (around 1000MB in size) and pickling was simply too

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

2009-05-29 Thread J Kenneth King
Piet van Oostrum p...@cs.uu.nl writes: J Kenneth King ja...@agentultra.com (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 JKK any feedback to emacs. JKK Try

Re: What text editor is everyone using for Python

2009-05-26 Thread J Kenneth King
Lacrima lacrima.ma...@gmail.com 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

Re: which database is suitable for small applications

2009-05-26 Thread J Kenneth King
Jean-Michel Pichavant jeanmic...@sequans.com 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

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

2009-05-25 Thread J Kenneth King
Giovanni Gherdovich giovanni.gherdov...@sophia.inria.fr 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

Re: What text editor is everyone using for Python

2009-05-25 Thread J Kenneth King
LittleGrasshopper seattleha...@yahoo.com 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

Re: Annoying feedparser issues

2009-05-19 Thread J Kenneth King
John Nagle na...@animats.com 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

Re: list comprehension question

2009-05-11 Thread J Kenneth King
Steven D'Aprano st...@remove-this-cybersource.com.au writes: On Thu, 07 May 2009 13:28:10 -0400, J Kenneth King wrote: Steven D'Aprano ste...@remove.this.cybersource.com.au writes: On Wed, 06 May 2009 09:48:51 -0400, J Kenneth King wrote: Emile van Sebille em...@fenx.com writes: On 5/5

Re: list comprehension question

2009-05-08 Thread J Kenneth King
Terry Reedy tjre...@udel.edu 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 available by default and making

Re: list comprehension question

2009-05-07 Thread J Kenneth King
Steven D'Aprano ste...@remove.this.cybersource.com.au writes: On Wed, 06 May 2009 09:48:51 -0400, J Kenneth King wrote: Emile van Sebille em...@fenx.com 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

Re: Best practice for operations on streams of text

2009-05-07 Thread J Kenneth King
James rent.lupin.r...@gmail.com 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

Re: list comprehension question

2009-05-06 Thread J Kenneth King
Emile van Sebille em...@fenx.com 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 and I believe

Re: list comprehension question

2009-05-05 Thread J Kenneth King
Emile van Sebille em...@fenx.com writes: On 5/1/2009 7:31 AM J Kenneth King said... Chris Rebert c...@rebertia.com writes: b = [] for pair in a: for item in pair: b.append(item) This is much more clear than a nested comprehension. I love comprehensions, but abusing them can

Re: Any idea to emulate tail -f

2009-05-05 Thread J Kenneth King
Iain King iaink...@gmail.com writes: On May 5, 7:00 am, Joel Juvenal Rivera Rivera joel...@gmail.com 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

Re: list comprehension question

2009-05-01 Thread J Kenneth King
Chris Rebert c...@rebertia.com writes: On Thu, Apr 30, 2009 at 5:56 PM, Ross ross.j...@gmail.com 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

Re: python list handling and Lisp list handling

2009-04-26 Thread J Kenneth King
Steven D'Aprano st...@remove-this-cybersource.com.au writes: On Sat, 25 Apr 2009 23:51:18 -0700, namekuseijin wrote: On Apr 26, 1:31 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Fri, 24 Apr 2009 21:01:10 -0700, Carl Banks wrote: That's because Python lists aren't

Re: unpythonic use of property()?

2009-04-22 Thread J Kenneth King
Luis Zarrabeitia ky...@uh.cu 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 prevent it from

Re: unpythonic use of property()?

2009-04-22 Thread J Kenneth King
Luis Zarrabeitia ky...@uh.cu 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 can suggest a patch, but that's it. Yes

Re: unpythonic use of property()?

2009-04-20 Thread J Kenneth King
Carl Banks pavlovevide...@gmail.com writes: On Apr 17, 4:00 pm, Scott David Daniels scott.dani...@acm.org wrote: Carl Banks wrote: On Apr 17, 10:21 am, J Kenneth King ja...@agentultra.com wrote: Consider: code

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

Re: decorators don't play nice with nose?

2009-04-06 Thread J Kenneth King
hyperboreean hyperbore...@nerdshack.com writes: From: hyperboreean hyperbore...@nerdshack.com 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

Re: HTML Generation

2009-04-03 Thread J Kenneth King
Tino Wildenhain t...@living-examples.com 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 stefan...@behnel.de 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, 'content': text/html

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

Re: Roundup Issue Tracker release 1.4.7

2009-03-17 Thread J Kenneth King
Richard Jones richardjo...@optushome.com.au 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

Re: While loop

2009-03-05 Thread J Kenneth King
Fab86 fabien.h...@gmail.com writes: On Mar 5, 5:23 pm, Marco Mariani ma...@sferacarta.com 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

ANN: tracshell 0.1r23

2009-03-04 Thread J Kenneth King
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: Musings: Using decorators to reduce duplicate exception handling

2009-02-19 Thread J Kenneth King
Cameron Simpson c...@zip.com.au writes: On 17Feb2009 15:12, J Kenneth King ja...@agentultra.com 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

Re: Musings: Using decorators to reduce duplicate exception handling

2009-02-18 Thread J Kenneth King
Gabriel Genellina gagsl-...@yahoo.com.ar writes: En Tue, 17 Feb 2009 21:12:57 -0200, J Kenneth King ja...@agentultra.com escribió: 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

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

Re: [ANN] TracShell 0.1 released

2009-02-13 Thread J Kenneth King
J Kenneth King ja...@agentultra.com 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

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 a lot of

[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

Re: TracShell 0.1 released

2009-02-12 Thread J Kenneth King
Krzysztof Retel krzysztof.re...@googlemail.com writes: On 12 Feb, 14:06, J Kenneth King ja...@agentultra.com 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

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

2009-02-12 Thread J Kenneth King
azrael jura.gro...@gmail.com 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.

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

2009-02-05 Thread J Kenneth King
Bruno Desthuilliers bdesth.quelquech...@free.quelquepart.fr 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

Re: Flattening lists

2009-02-05 Thread J Kenneth King
mk mrk...@gmail.com 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,

Re: Added-value of frameworks?

2009-02-04 Thread J Kenneth King
Matimus mccre...@gmail.com writes: On Feb 4, 8:08 am, Gilles Ganault nos...@nospam.com 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.

Re: What is wrong in my list comprehension?

2009-02-02 Thread J Kenneth King
Chris Rebert c...@rebertia.com 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

Re: What is wrong in my list comprehension?

2009-02-02 Thread J Kenneth King
Chris Rebert c...@rebertia.com 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

Re: What is wrong in my list comprehension?

2009-02-02 Thread J Kenneth King
Stephen Hansen apt.shan...@gmail.com 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

Re: What is wrong in my list comprehension?

2009-02-02 Thread J Kenneth King
Chris Rebert c...@rebertia.com 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

Re: What is wrong in my list comprehension?

2009-02-02 Thread J Kenneth King
Chris Rebert c...@rebertia.com 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

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

2009-01-29 Thread J Kenneth King
excord80 excor...@gmail.com 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

Re: I'm a python addict !

2009-01-26 Thread J Kenneth King
Linuxguy123 linuxguy...@gmail.com 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 ! .. snip .. I

Re: I'm a python addict !

2009-01-26 Thread J Kenneth King
J Kenneth King ja...@agentultra.com writes: Linuxguy123 linuxguy...@gmail.com 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

Re: Two questions about style and some simple math

2009-01-20 Thread J Kenneth King
Spoofy spoo...@gmx.net writes: .. snip .. 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

Re: Pyro deadlock

2009-01-20 Thread J Kenneth King
MatthewS schaefer...@gmail.com 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

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

2009-01-08 Thread J Kenneth King
Jonathan Gardner jgard...@jonathangardner.net writes: On Jan 7, 9:16 am, Chris Mellon arka...@gmail.com 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)

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

2009-01-08 Thread J Kenneth King
Kay Schluehr kay.schlu...@gmx.net writes: On 8 Jan., 16:25, J Kenneth King ja...@agentultra.com 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 written

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

2009-01-07 Thread J Kenneth King
Jonathan Gardner jgard...@jonathangardner.net writes: On Jan 6, 12:24 pm, J Kenneth King ja...@agentultra.com wrote: Jonathan Gardner jgard...@jonathangardner.net writes: On Jan 6, 8:18 am, sturlamolden sturlamol...@yahoo.no wrote: On Jan 6, 4:32 pm, mark mark.fi...@googlemail.com wrote

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

2009-01-07 Thread J Kenneth King
Kay Schluehr kay.schlu...@gmx.net writes: On 7 Jan., 16:50, J Kenneth King ja...@agentultra.com 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

Re: Noob question: Is all this typecasting normal?

2009-01-06 Thread J Kenneth King
Gabriel Genellina gagsl-...@yahoo.com.ar writes: En Mon, 05 Jan 2009 02:03:26 -0200, Roy Smith r...@panix.com 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:

Re: image recogniton?

2009-01-06 Thread J Kenneth King
Li Han lihang9...@gmail.com 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

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

2009-01-06 Thread J Kenneth King
Jonathan Gardner jgard...@jonathangardner.net writes: On Jan 6, 8:18 am, sturlamolden sturlamol...@yahoo.no wrote: On Jan 6, 4:32 pm, mark mark.fi...@googlemail.com wrote: I want to implement a internal DSL in Python. I would like the syntax as human readable as possible. Also beware

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

2009-01-02 Thread J Kenneth King
Tokyo Dan huff...@tokyo.email.ne.jp 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

Re: Is there a better algorithm?

2009-01-02 Thread J Kenneth King
Kottiyath n.kottiy...@gmail.com 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: ...

Re: Is there a better algorithm?

2009-01-02 Thread J Kenneth King
Paul Rubin http://phr...@nospam.invalid writes: Kottiyath n.kottiy...@gmail.com 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

Re: Are Django/Turbogears too specific?

2008-12-21 Thread J Kenneth King
Gilles Ganault nos...@nospam.com 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

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 command

  1   2   >