[Tutor] How to print the installed web browser

2010-08-31 Thread Ranjith Kumar
Hi all, I`m using ubuntu how to find and print the installed web browsers using python scripting. -- Cheers Ranjith, Software Engineer, Sedin Technologies, Chennai http://ranjith10z.wordpress.com http://ranjithtenz.wordpress.com ___ Tutor maillist

[Tutor] Installation problem: Python 2.6.6 (32-Bit) on Windows 7 (32-Bit)

2010-08-31 Thread Tony Cappellini
Has anyone else had problems running the msi for Python 2.6.6 on Windows 7? If I don't check "Compile .py to byte code", the installer completes without error. Checking "Compile .py to byte code" causes the following to be displayed "There is a problem with the windows installer package. A progra

[Tutor] polymorphism for file-like objects

2010-08-31 Thread Gregory, Matthew
Hi all, In the 2nd edition of Python Cookbook, Mark Lutz writes the intro to Chapter 2 (Files) and gives the following example of polymorphism for file like objects (adapted for brevity): def firstword(line): print line.split()[0] def scanner(fileobject, linehandler): for line in fileo

Re: [Tutor] Help with Object Oriented Programming

2010-08-31 Thread Albert-Jan Roskam
I read Head First Design Patterns (http://oreilly.com/catalog/9780596007126). It focuses on Java and it's not only good because of the nice woman on the cover. ;-) Cheers!! Albert-Jan ~~ All right, but apart from the sanitat

Re: [Tutor] Understanding Custom Exception

2010-08-31 Thread Alessandro Martin
> The point of specific exception types is to be more specific rather than > less, so yes. If you want to be less specific, you should stick to > built-in exceptions. Thanks Steven. It's all clear now. As soon as I finished the module I'll post it here for a code review. Alex

Re: [Tutor] Plural words to Singular

2010-08-31 Thread member thudfoo
On Tue, Aug 31, 2010 at 1:44 AM, Dinesh B Vadhia wrote: > > Has anyone come across a quality program to turn plural words to singular > words?  We don't want to use a stemmer.  Thanks. All I know about this one is what it says on PyPI: Correctly generate plurals, singular nouns, ordinals, indef

Re: [Tutor] Newbie - regex question

2010-08-31 Thread Sam M
Thanks everyone for prompt response and explanation. Cheers! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Conditional attribute access / key access

2010-08-31 Thread Knacktus
The sizes given are in bytes. So 200,000 instances of this class, plus the list to hold them, would take approximately 34 megabytes. An entry level PC these days has 1000 megabytes of memory. "Huge"? Not even close. The items hold a lot of metadata, which I didn't provide in my example. Depen

Re: [Tutor] Help with Object Oriented Programming

2010-08-31 Thread Tino Dai
On Mon, Aug 30, 2010 at 2:59 PM, Knacktus wrote: > You could google for > > 1) Alex Martelli, Design Patterns > He's a Pyton guru and there're some online talks (at Google and some > conferences) about DP; a bit difficult to understand, well, he's guru ;-) > > 2) http://www.suttoncourtenay.org.u

Re: [Tutor] Plural words to Singular

2010-08-31 Thread Shashwat Anand
On Tue, Aug 31, 2010 at 2:14 PM, Dinesh B Vadhia wrote: > Has anyone come across a quality program to turn plural words to singular > words? We don't want to use a stemmer. Thanks. > > Dinesh > Create 'rule' for each cases and code it up. > > ___ >

Re: [Tutor] Help with Object Oriented Programming

2010-08-31 Thread Tino Dai
On Mon, Aug 30, 2010 at 3:21 PM, Alan Gauld wrote: > > "Tino Dai" wrote > >>      I'm beefing up my Object-Oriented Analysis and Design - getting >> the gaps in my >> knowledge filled in through the Head First OOAD book > > I don't know it although I've seen a couple of others in the series. > >

Re: [Tutor] Help with Object Oriented Programming

2010-08-31 Thread Tino Dai
On Mon, Aug 30, 2010 at 2:26 PM, Serdar Tumgoren wrote: > I haven't read it yet myself, but the below book just came out: > > http://www.amazon.com/Python-3-Object-Oriented-Programming/dp/1849511268/ref=cm_cr_pr_sims_t > > I'm not aware of any other book that focuses exclusively on OO in Python, >

Re: [Tutor] Understanding Custom Exception

2010-08-31 Thread Steven D'Aprano
On Tue, 31 Aug 2010 09:40:54 pm Alex wrote: > 1. Does it make sense to create a couple of custom exceptions like: > >class CrontabDoesNotExist(Exception): pass >class CrontabSyntaxError(Exception): pass > > Or I should use builtin exception? Yes, it makes sense, although I'd consider ma

[Tutor] Understanding Custom Exception

2010-08-31 Thread Alex
Hi all. I'm working on a thin wrapper around the unix crontab command (just the command, non the cron service). The module will do some simple operation like: - Read the crontab file - Adding a job to crontab identified by an id - Deleting a job - Deleting all jobs added Now I have two questions

Re: [Tutor] Conditional attribute access / key access

2010-08-31 Thread Steven D'Aprano
On Tue, 31 Aug 2010 12:44:08 am Knacktus wrote: > Hey everyone, > > I have a huge number of data items coming from a database. Huge? Later in this thread, you mentioned 200,000 items overall. That might be "huge" to you, but it isn't to Python. Here's an example: class K(object): def __ini

[Tutor] Plural words to Singular

2010-08-31 Thread Dinesh B Vadhia
Has anyone come across a quality program to turn plural words to singular words? We don't want to use a stemmer. Thanks. Dinesh___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listin