[ANNOUNCE] PyGtkSourceView 2.7.0 - unstable

2009-08-18 Thread Gian Mario Tagliaretti
I am pleased to announce version 2.7.0 of the Gtksourceview Python bindings. Once the mirrors have sync correctly it will be available at: http://ftp.gnome.org/pub/GNOME/sources/pygtksourceview/2.7/ The bindings are updated with the new Gtksourceview API News in 2.7.0 = o Add

Re: define class over 2 files

2009-08-18 Thread Steven D'Aprano
On Mon, 17 Aug 2009 21:45:57 -0700, naveen wrote: Is it possible to split up a class definition over multiple files? Not exactly, but you can do variations of this: In file A.py, create: class Parent: def method(self): return Method In file B.py, do this: import A class

Re: XML parsing with python

2009-08-18 Thread Stefan Behnel
inder wrote: On Aug 17, 8:31 pm, John Posner jjpos...@optimum.net wrote: Use the iterparse() function of the xml.etree.ElementTree package. http://effbot.org/zone/element-iterparse.htm http://codespeak.net/lxml/parsing.html#iterparse-and-iterwalk Stefan iterparse() is too big a hammer for

Re: XML parsing with python

2009-08-18 Thread Stefan Behnel
John Posner wrote: Use the iterparse() function of the xml.etree.ElementTree package. iterparse() is too big a hammer for this purpose, IMO. How about this: from xml.etree.ElementTree import ElementTree tree = ElementTree(None, myfile.xml) for elem in tree.findall('//book/title'):

Changing Python Opcodes

2009-08-18 Thread Sreejith K
Hi, I know this is not the best way to do it. But I have to do it at least to make it *hard* to decompile the python bytecode. I want to distribute a software written in Python without the source. So I compiled Python from source changing some opcode values (Taking care of HAVE_ARGUMENT value)

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-18 Thread Gilles Ganault
Thanks everyone for the help. This script is just a one-shot thingie on my work host, not as a web script or anything professional. On Mon, 17 Aug 2009 17:05:28 -0700 (PDT), Jonathan Gardner jgard...@jonathangardner.net wrote: Unfortunately, there isn't any string to date parsers in the built-

Re: define class over 2 files

2009-08-18 Thread naveen
Is it possible to split up a class definition over multiple files? Not exactly, but you can do variations of this: ... [subclass a class] Steven Thanks Steven. I guess I will just preprocess the script: class.sh cat partA.py class.py cat partB class.py python class.py /class.sh --

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-18 Thread Ben Finney
Gilles Ganault nos...@nospam.com writes: Thanks everyone for the help. This script is just a one-shot thingie on my work host, not as a web script or anything professional. On Mon, 17 Aug 2009 17:05:28 -0700 (PDT), Jonathan Gardner jgard...@jonathangardner.net wrote:

Re: define class over 2 files

2009-08-18 Thread Ben Finney
naveen naveen.g...@gmail.com writes: I guess I will just preprocess the script: class.sh cat partA.py class.py cat partB class.py python class.py /class.sh This, to me, is a programming smell; not necessarily bad, but an indicator of bad practice. What is the problem you're trying to

Re: Changing Python Opcodes

2009-08-18 Thread Diez B. Roggisch
Sreejith K schrieb: Hi, I know this is not the best way to do it. But I have to do it at least to make it *hard* to decompile the python bytecode. I want to distribute a software written in Python without the source. So I compiled Python from source changing some opcode values (Taking care of

Re: Changing Python Opcodes

2009-08-18 Thread Sreejith K
On Aug 18, 12:19 pm, Diez B. Roggisch de...@nospam.web.de wrote: Did you try installing the egg *without* pyc-files in there? Because naturally those shouldn't work. They shouldn't crash the interpreter either, but then again - you *did* modify it. Hi Diez, thanks for the immediate reply :)

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-18 Thread Gilles Ganault
On Tue, 18 Aug 2009 17:10:50 +1000, Ben Finney ben+pyt...@benfinney.id.au wrote: Luckily, you have access to the documentation to find out. I never used groups before. Thanks for showing me. At this point, the script is almost done, but the regex fails if the month contains accented characters

Re: Data visualization in Python

2009-08-18 Thread Weinhandl Herbert
Am 2009-08-17 21:10, schrieb kj: I'm looking for a good Python package for visualizing scientific/statistical data. (FWIW, the OS I'm interested in is Mac OS X). The users of this package will be experimental biologists with little programming experience (but currently learning Python).

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-18 Thread Rami Chowdhury
Could you let me know which platform this is on (Windows, *nix)? It may be a locale encoding issue -- the locale.setlocale() function allows the second argument to be a tuple of (locale_code, encoding), as below: locale.setlocale(locale.LC_ALL, ('FR', 'UTF-8')) Since this is for a one-shot

Mercurial migration: help needed

2009-08-18 Thread Martin v. Löwis
This is a repost from two weeks ago. It didn't get much feedback last time. I still keep trying, reposting to python-list also this time. In this thread, I'd like to collect things that ought to be done but where Dirkjan has indicated that he would prefer if somebody else did it. Item 1 --

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-18 Thread Gilles Ganault
On Tue, 18 Aug 2009 01:11:20 -0700, Rami Chowdhury rami.chowdh...@gmail.com wrote: Could you let me know which platform this is on (Windows, *nix)? It may be a locale encoding issue -- the locale.setlocale() function allows the second argument to be a tuple of (locale_code, encoding), as below:

Re: [Python-Dev] Mercurial migration: help needed

2009-08-18 Thread Dirkjan Ochtman
On Tue, Aug 18, 2009 at 10:12, Martin v. Löwismar...@v.loewis.de wrote: In this thread, I'd like to collect things that ought to be done but where Dirkjan has indicated that he would prefer if somebody else did it. I think the most important item here is currently the win32text stuff. Mark

conversion of Python object to perl object

2009-08-18 Thread srinivasan srinivas
Hi, I have to call a perl method which takes a hash as its argument from a python module. Is there a way to convert python dictionary to perl hash ( not hash ref)? Thanks, Srini See the Web#39;s breaking stories, chosen by people like you. Check out Yahoo! Buzz.

sub-list extraction, logical indexation

2009-08-18 Thread Pierre
Hello Everyone, I would like to know if it is possible to extract a sub-list from a list ? typically if : L =[[1, 2, 3],[4, 5, 6],[3] ] How to extract easily the elements 0 and 2 of L in order to get : L2 =[[1, 2, 3],[3] ] Moreover, I would like to know if it is possible to use logical

Re: zip codes

2009-08-18 Thread Grant Edwards
On 2009-08-17, Sjoerd Mullender sjo...@acm.org wrote: Also in The Netherlands, ZIP codes are much more fine-grained than in some other countries: ZIP code plus house number together are sufficient to uniquely identify an address. I.e. you don't need the street name. E.g., my work address has

Re: Strongly typed list

2009-08-18 Thread Diez B. Roggisch
هاني الموصلي schrieb: Please could you lead me to a way or a good IDE that makes developing huge projects in python more easier than what i found.Now i am using eclips. Actually it is very hard to remember all my classes methods and attributes or copy and paste them each time. Thanks very much

Re: Xah's Edu Corner: The importance of syntax notations.

2009-08-18 Thread Xah Lee
http://www.stephenwolfram.com/publications/recent/mathml/index.html i was trying to find the publication date and context, but didn't find it last time after a couple min. Yesterday, on rereading, i did. The article in question is: « Mathematical Notation: Past and Future (2000) Stephen

Re: conversion of Python object to perl object

2009-08-18 Thread Chris Rebert
On Mon, Aug 17, 2009 at 3:47 AM, srinivasan srinivassri_anna...@yahoo.co.in wrote: Hi, I have to call a perl method which takes a hash as its argument from a python module. Is there a way to convert python dictionary to perl hash ( not hash ref)? How are you calling the Perl method from

Re: Social problems of Python doc [was Re: Python docs disappointing]

2009-08-18 Thread Paul Boddie
On 18 Aug, 05:19, ru...@yahoo.com wrote: Yes, I agree.  I should have mentioned this as an exception in my wikis suck diatribe.  Although it far better than most wiki's I've seen, it is still pretty easy to find signs of typical wiki-ness.  On the Documentation page my first click was on

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-18 Thread Rami Chowdhury
Python doesn't like the above: #locale.Error: unsupported locale setting locale.setlocale(locale.LC_ALL, ('FR', 'UTF-8')) Maybe it was introduced in more recent versions of Python? Hmm, that's odd. According to the docs (http://docs.python.org/library/locale.html#locale.setlocale) it's been

Re: XML parsing with python

2009-08-18 Thread inder
On Aug 18, 11:24 am, Stefan Behnel stefan...@behnel.de wrote: inder wrote: On Aug 17, 8:31 pm, John Posner jjpos...@optimum.net wrote: Use the iterparse() function of the xml.etree.ElementTree package. http://effbot.org/zone/element-iterparse.htm

Re: Changing Python Opcodes

2009-08-18 Thread Diez B. Roggisch
Sreejith K wrote: On Aug 18, 12:19 pm, Diez B. Roggisch de...@nospam.web.de wrote: Did you try installing the egg *without* pyc-files in there? Because naturally those shouldn't work. They shouldn't crash the interpreter either, but then again - you *did* modify it. Hi Diez, thanks for

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-18 Thread Gilles Ganault
On Tue, 18 Aug 2009 10:52:41 +0200, Gilles Ganault nos...@nospam.com wrote: I find it odd that the regex library can't handle European characters :-/ Ha, found it! :-) http://www.regular-expressions.info/python.html = # -*- coding: latin-1 -*- import locale import re

Re: Social problems of Python doc [was Re: Python docs disappointing]

2009-08-18 Thread Paul Rubin
ru...@yahoo.com writes: I took a look at the PHP docs last night which seem pretty well done. The User Comments looked rather as I expected, there was useful info but most did not contain documentation quality writing. So if they are used as a source for improving the docs, there clearly

Re: XML parsing with python

2009-08-18 Thread Stefan Behnel
inder wrote: Is lxml part of standard python package ? I am having python 2.5 . No, that's why I suggested ElementTree first. I might not be able to use any additional package other than the standard python . Could you please suggest something part of standard python package ? No, there

Re: Need cleanup advice for multiline string

2009-08-18 Thread Hendrik van Rooyen
On Monday 17 August 2009 23:06:04 Carl Banks wrote: On Aug 17, 10:03 am, Jean-Michel Pichavant jeanmic...@sequans.com wrote: I'm no English native, but I already heard women/men referring to a group as guys, no matter that group gender configuration. It's even used for group composed

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-18 Thread Ben Finney
Gilles Ganault nos...@nospam.com writes: dateinscription = 11 Août 2008 For any text string that's not ASCII, you should specify it as Unicode. (Actually, you should specify text as Unicode anyway.) For a literal text string: dateinscription = u11 Août 2008 If you're using exclusively

Re: Diversity in Python (was Re: Need cleanup advice for multiline string)

2009-08-18 Thread Hendrik van Rooyen
On Tuesday 18 August 2009 06:45:39 Aahz wrote: In article pan.2009.08.18.04.34...@remove.this.cybersource.com.au, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: The comments were made a week ago -- why the sudden flurry of attention? Mainly an opportunity to flog the new

urlopen errors in script

2009-08-18 Thread Sleepy Cabbage
I'm scripting a superkaramba theme using python and have intgrated output from amarok. I have also would like to show the artist and song title from a radio stream i've added to my playlist. If I open a python console and add the following: import urllib2 from urllib2 import urlopen nowplaying

urlopen errors in script

2009-08-18 Thread Sleepy Cabbage
I'm scripting a superkaramba theme using python and have intgrated output from amarok. I have also would like to show the artist and song title from a radio stream i've added to my playlist. If I open a python console and add the following: import urllib2 from urllib2 import urlopen nowplaying

Re: Using a Callback Function - ftplib

2009-08-18 Thread Nitebirdz
On Mon, Aug 17, 2009 at 11:10:25AM -0700, seldan24 wrote: I didn't even notice the higher level methods. I changed the retrieval line to: ftp.nlst(testfile*.txt) This works great. The result is even captured in an array. I really have no idea what the difference between a LIST and

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-18 Thread Gilles Ganault
On Tue, 18 Aug 2009 20:03:47 +1000, Ben Finney ben+pyt...@benfinney.id.au wrote: The principles of handling text in Python: Get it to internal Unicode objects as soon as possible, handle it as Unicode for as long as possible, and only encode it to some byte stream for output as late as possible.

Re: Strongly typed list

2009-08-18 Thread Albert Hopkins
On Tue, 2009-08-18 at 08:46 +0200, Diez B. Roggisch wrote: هاني الموصلي schrieb: Please could you lead me to a way or a good IDE that makes developing huge projects in python more easier than what i found.Now i am using eclips. Actually it is very hard to remember all my classes methods

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-18 Thread Ben Finney
Gilles Ganault nos...@nospam.com writes: On Tue, 18 Aug 2009 20:03:47 +1000, Ben Finney ben+pyt...@benfinney.id.au wrote: The principles of handling text in Python: Get it to internal Unicode objects as soon as possible, handle it as Unicode for as long as possible, and only encode it to

Re: Diversity in Python

2009-08-18 Thread Ben Finney
Hendrik van Rooyen hend...@microcorp.co.za writes: On Tuesday 18 August 2009 06:45:39 Aahz wrote: Mainly an opportunity to flog the new diversity list. Here my English fails me - flog as in whip, or flog as in sell? Yes :-) -- \ “The most common of all follies is to believe

Re: A Exhibition Of Tech Geekers Incompetence: Emacs whitespace-mode

2009-08-18 Thread Rui Maciel
Xah Lee wrote: This feature is important in practical ways. For example, when you work with “tab separated line” files (CSV) that's a common format for importing/exporting address books or spreadsheets. CSV stands for comma separated values and the import facilities of any spreadsheet

Re: urlopen errors in script

2009-08-18 Thread Peter Otten
Sleepy Cabbage wrote: I'm scripting a superkaramba theme using python and have intgrated output from amarok. I have also would like to show the artist and song title from a radio stream i've added to my playlist. If I open a python console and add the following: import urllib2 from

Re: Need cleanup advice for multiline string

2009-08-18 Thread Jean-Michel Pichavant
MRAB wrote: Carl Banks wrote: On Aug 17, 10:03 am, Jean-Michel Pichavant jeanmic...@sequans.com wrote: I'm no English native, but I already heard women/men referring to a group as guys, no matter that group gender configuration. It's even used for group composed exclusively of women. Moreover

Re: [Python-Dev] Mercurial migration: help needed

2009-08-18 Thread Mark Hammond
On 18/08/2009 6:20 PM, Dirkjan Ochtman wrote: On Tue, Aug 18, 2009 at 10:12, Martin v. Löwismar...@v.loewis.de wrote: In this thread, I'd like to collect things that ought to be done but where Dirkjan has indicated that he would prefer if somebody else did it. I think the most important item

Re: Strongly typed list

2009-08-18 Thread هاني الموصلي
I think i found a good managable solution. Actually it is trivial but may help (I used it now). When i wnat to access the list then i assign the object which i want to access to a variable ex: 1)x=AutomataBranch() 2)x=self.cfgAutomata[i] The first line is used only to make the IDE knows that x is

Re: Python 'for' loop is memory inefficient

2009-08-18 Thread exarkun
On 03:56 am, tjre...@udel.edu wrote: exar...@twistedmatrix.com wrote: There's a lot of things in Python that I don't strictly *need*. That doesn't mean that they wouldn't be welcome if I could have them. Getting rid of the range/xrange dichotomy would improve things. The developers agreed a

Re: [Python-Dev] Mercurial migration: help needed

2009-08-18 Thread Dirkjan Ochtman
On Tue, Aug 18, 2009 at 13:32, Mark Hammondmhamm...@skippinet.com.au wrote: I can make time, somewhat spasmodically, starting fairly soon.  Might I suggest that as a first task I can resurrect my old stale patch, and you can arrange to install win32text locally and start experimenting with how

Re: urlopen errors in script

2009-08-18 Thread Sleepy Cabbage
On Tue, 18 Aug 2009 13:21:59 +0200, Peter Otten wrote: Sleepy Cabbage wrote: I'm scripting a superkaramba theme using python and have intgrated output from amarok. I have also would like to show the artist and song title from a radio stream i've added to my playlist. If I open a python

Re: Converting DD MM YYYY into YYYY-MM-DD?

2009-08-18 Thread Stefan Behnel
Ben Finney wrote: The principles of handling text in Python: Get it to internal Unicode objects as soon as possible, handle it as Unicode for as long as possible, and only encode it to some byte stream for output as late as possible. Again, note that these recommendations hold for *any* text

Re: urlopen errors in script

2009-08-18 Thread Peter Otten
Sleepy Cabbage wrote: This is the script up to where the error seems to fall: #!/usr/bin/env superkaramba # -*- coding: iso-8859-1 -*- import karamba import subprocess from subprocess import Popen, PIPE, STDOUT, call import urllib from urllib import urlopen #this is called when

Re: Need cleanup advice for multiline string

2009-08-18 Thread Steven D'Aprano
On Tue, 18 Aug 2009 13:36:49 +0200, Jean-Michel Pichavant wrote: MRAB wrote: Carl Banks wrote: On Aug 17, 10:03 am, Jean-Michel Pichavant jeanmic...@sequans.com wrote: I'm no English native, but I already heard women/men referring to a group as guys, no matter that group gender

Re: Diversity in Python (was Re: Need cleanup advice for multiline string)

2009-08-18 Thread Steven D'Aprano
On Tue, 18 Aug 2009 12:12:14 +0200, Hendrik van Rooyen wrote: On Tuesday 18 August 2009 06:45:39 Aahz wrote: In article pan.2009.08.18.04.34...@remove.this.cybersource.com.au, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: The comments were made a week ago -- why the sudden

Re: urlopen errors in script

2009-08-18 Thread Sleepy Cabbage
Thanks for the time you've spent anyway Peter. I have superkaramba installed and the rest of the script is running fine, it's only when I put the urlopen part in that it comes back with errors. The quotes are just to make it readable on here as my first attempt at posting muted the text. --

Re: Strongly typed list

2009-08-18 Thread Diez B. Roggisch
هاني الموصلي wrote: I think i found a good managable solution. Actually it is trivial but may help (I used it now). When i wnat to access the list then i assign the object which i want to access to a variable ex: 1)x=AutomataBranch() 2)x=self.cfgAutomata[i] The first line is used only to

Compare content of two XML files

2009-08-18 Thread David Brochu
I need to compare a REST XML response with a 'gold standard' response (one that we have already verified is correct). The problem is, sometimes the REST response comes back and it is logically correct, but the order of attributes and elements is different than what is in the 'gold standard' file.

Re: define class over 2 files

2009-08-18 Thread naveen
indicator of bad practice. What is the problem you're trying to solve? Ben Finney No major problem. I was just trying to make some experimental changes to autokey. My repo: http://github.com/tinku99/autokey.git/ Didn't want to subclass or reorganize a class just yet. --

Code formatting question: conditional expression

2009-08-18 Thread John Posner
While refactoring some code, I ran across an opportunity to use a conditional expression. Original: if total P.BASE: excessblk = Block(total - P.BASE, srccol, carry_button_suppress=True) else: excessblk = None Is there any consensus on how to format a conditional expression that

ANNOUNCEMENT: Tinybooker accounting released

2009-08-18 Thread Tuomas Vesterinen
Tinybooker 0.2.2 released at http://tinybooker.org/ Tinybooker is an accounting program offering the dual accounting core functionality for moderate size accountings: * Assisted establishing new accountings * Localized scheme templates * Easy entering and saving new entries *

ANN: PySide has been released

2009-08-18 Thread Lauro Moura
Hi, The PySide team is pleased to announce the first public release of PySide: Python for Qt! PySide, its documentation, and developer resources are available at the project website, http://www.pyside.org . What is it? --- PySide is a project providing an LGPL'd set of Python bindings

Re: Code formatting question: conditional expression

2009-08-18 Thread Diez B. Roggisch
John Posner wrote: While refactoring some code, I ran across an opportunity to use a conditional expression. Original: if total P.BASE: excessblk = Block(total - P.BASE, srccol, carry_button_suppress=True) else: excessblk = None Is there any consensus on how to

Re: Code formatting question: conditional expression

2009-08-18 Thread Jean-Michel Pichavant
Diez B. Roggisch wrote: John Posner wrote: While refactoring some code, I ran across an opportunity to use a conditional expression. Original: if total P.BASE: excessblk = Block(total - P.BASE, srccol, carry_button_suppress=True) else: excessblk = None Is there any

Re: Need cleanup advice for multiline string

2009-08-18 Thread Grant Edwards
On 2009-08-17, Carl Banks pavlovevide...@gmail.com wrote: On Aug 17, 10:03?am, Jean-Michel Pichavant jeanmic...@sequans.com wrote: I'm no English native, but I already heard women/men referring to a group as guys, no matter that group gender configuration. It's even used for group composed

Re: GUI interface builder for python

2009-08-18 Thread sturlamolden
On 17 Aug, 17:19, Che M cmpyt...@gmail.com wrote: Boa (Boa Constructor) is really nice for wxPython GUI work, but it has some bugs when using Linux that might be dealbreakers for the user.  At least I have had problems on Ubuntu 8.10 64 bit (but none or very few I prefer wxFormBuilder over

Re: Code formatting question: conditional expression

2009-08-18 Thread Steven D'Aprano
On Tue, 18 Aug 2009 10:04:36 -0400, John Posner wrote: While refactoring some code, I ran across an opportunity to use a conditional expression. Original: if total P.BASE: excessblk = Block(total - P.BASE, srccol, carry_button_suppress=True) else: excessblk = None

Re: Code formatting question: conditional expression

2009-08-18 Thread John Posner
My choice would be excessblk = None if total P.BASE: excessblk = ... Diez and Jean-Michel, Ha! Your suggestion above was my *original* coding. It looks like I'm evolving backwards! But doesn't it violate the DRY principle? The token excessblk appears twice instead of once. Thanks

simplest way to visit 3 subdirectories with a command?

2009-08-18 Thread dmitrey
hi all, could you inform how to compose a py-file (for soft installation), that will visit 3 subdirectories (eg subdir1, subdir2, subdir3) and invoke a command python setup.py install in each subdirectory? I know there should be a simple solution available in Python documentation, but I have an

Re: Code formatting question: conditional expression

2009-08-18 Thread Richard Brodie
John Posner jjpos...@optimum.net wrote in message news:mailman.26.1250604346.2854.python-l...@python.org... if total P.BASE: excessblk = Block(total - P.BASE, srccol, carry_button_suppress=True) else: excessblk = None I wonder if it is appropriate to replace the None sentinel

Start-up program

2009-08-18 Thread Virgil Stokes
How difficult is to create a program that will be executed when Windows Vista is started? As Windows Calendar does, for example. I am actually more interested in the Python tools that might be used for this task. I hope that this question is not inappropriate for the list. :-\ --V --

Re: Code formatting question: conditional expression

2009-08-18 Thread Jean-Michel Pichavant
John Posner wrote: My choice would be excessblk = None if total P.BASE: excessblk = ... Diez and Jean-Michel, Ha! Your suggestion above was my *original* coding. It looks like I'm evolving backwards! But doesn't it violate the DRY principle? The token excessblk appears twice

Re: Need cleanup advice for multiline string

2009-08-18 Thread Steve Holden
Robert Dailey: [...] It's a figure of speech. And besides, why would I want programming advice from a woman? lol. Thanks for the help. Sorry, Robert, simply not acceptable. Whether designed to be funny or not it's the kind of inane remark I would be really happy never to see again. The

Re: Start-up program

2009-08-18 Thread Diez B. Roggisch
Virgil Stokes wrote: How difficult is to create a program that will be executed when Windows Vista is started? As Windows Calendar does, for example. I am actually more interested in the Python tools that might be used for this task. I hope that this question is not inappropriate for the

Re: Start-up program

2009-08-18 Thread Jean-Michel Pichavant
Virgil Stokes wrote: How difficult is to create a program that will be executed when Windows Vista is started? As Windows Calendar does, for example. I am actually more interested in the Python tools that might be used for this task. I hope that this question is not inappropriate for the

Mac OS 9.2

2009-08-18 Thread madzientist
hi, i have to work with mac OS 9.2 for legacy reasons...is there a compiled version of python for this os ? i need to get input about variable values from the user and then print out some text files that make use of this input. a gui would be nice, but keyboard based input would be ok too...

Re: Start-up program

2009-08-18 Thread MRAB
Virgil Stokes wrote: How difficult is to create a program that will be executed when Windows Vista is started? As Windows Calendar does, for example. I am actually more interested in the Python tools that might be used for this task. I hope that this question is not inappropriate for the

Re: problem with interface of operator.itemgetter

2009-08-18 Thread dou dou
2009/8/17 Simon Forman sajmik...@gmail.com You can use a little helper function to create your itemgetter like this: def makeItemGetter(indexes): I = itemgetter(*indexes) if len(indexes) 1: return I return lambda thing: (I(thing),) If indexes contains only one index the

Re: Need cleanup advice for multiline string

2009-08-18 Thread Jean-Michel Pichavant
Steve Holden wrote: Robert Dailey: [...] It's a figure of speech. And besides, why would I want programming advice from a woman? lol. Thanks for the help. Sorry, Robert, simply not acceptable. Whether designed to be funny or not it's the kind of inane remark I would be really

Identifying a class type - bad practice?

2009-08-18 Thread James Harris
I am writing some code to form a tree of nodes of different types. The idea is to define one class per node type such as class node_type_1(node): specific properties by name including other node types class node_type_2(node): specific properties by name including other node types etc (Class

Re: simplest way to visit 3 subdirectories with a command?

2009-08-18 Thread Tim Chase
could you inform how to compose a py-file (for soft installation), that will visit 3 subdirectories (eg subdir1, subdir2, subdir3) and invoke a command python setup.py install in each subdirectory? I know there should be a simple solution available in Python If you're executing python setup.py

Re: Mac OS 9.2

2009-08-18 Thread madzientist
ok, i found macpython 2.3 at this site: http://homepages.cwi.nl/~jack/macpython/macpython-older.html is this the best option for me in terms of using python on os 9.2 ? thanks much !! suresh On Aug 18, 6:04 pm, madzientist madzient...@gmail.com wrote: hi, i have to work with mac OS 9.2

Re: Code formatting question: conditional expression

2009-08-18 Thread John Posner
I wonder if it is appropriate to replace the None sentinel with one that is an instance of Block() e.g. size = total - P.BASE excessblk = Block(size, srccol, carry_button_suppress=True, empty_block=(size = 0) ) In this particular case, Richard, I don't think so. The Block class is an

xlutils 1.4.0 released!

2009-08-18 Thread Chris Withers
Hi All, I'm pleased to announce a new release of xlutils. This is a small collection of utilities that make use of both xlrd and xlwt to process Microsoft Excel files. The changes for this release are as follows: - Add sheet density information and onesheet option to xlutils.margins. -

Parallelization in Python 2.6

2009-08-18 Thread Robert Dailey
I'm looking for a way to parallelize my python script without using typical threading primitives. For example, C++ has pthreads and TBB to break things into tasks. I would like to see something like this for python. So, if I have a very linear script: doStuff1() doStuff2() I can parallelize it

Re: Code formatting question: conditional expression

2009-08-18 Thread Ethan Furman
John Posner wrote: BTW, from the (admittedly few) responses to my original post, it seems there's some sentiment that conditional expressions are a non-Pythonic misfeature. Interesting ... -John I didn't read it that way. One of the (to me) core points of Pythonic is readability. A

Re: Parallelization in Python 2.6

2009-08-18 Thread Stefan Behnel
Robert Dailey wrote: I'm looking for a way to parallelize my python script without using typical threading primitives. For example, C++ has pthreads and TBB to break things into tasks. I would like to see something like this for python. So, if I have a very linear script: doStuff1()

Re: Identifying a class type - bad practice?

2009-08-18 Thread Ethan Furman
James Harris wrote: I am writing some code to form a tree of nodes of different types. The idea is to define one class per node type such as class node_type_1(node): specific properties by name including other node types class node_type_2(node): specific properties by name including other

Re: Identifying a class type - bad practice?

2009-08-18 Thread André
On Aug 18, 2:09 pm, James Harris james.harri...@googlemail.com wrote: I am writing some code to form a tree of nodes of different types. The idea is to define one class per node type such as class node_type_1(node):   specific properties by name including other node types class

Re: comparing XML files to eachother

2009-08-18 Thread Simon Forman
On Mon, Aug 17, 2009 at 3:51 PM, David Brochubrochu...@gmail.com wrote: I need to compare one xml document to another to see if the content matches. Unfortunately, the formatting (spacing) and order of elements may change between files from run to run. I have looked into xml dom minidom but

Inheriting dictionary

2009-08-18 Thread Pavel Panchekha
I want a dictionary that will transparently inherit from a parent dictionary. So, for example: a = InheritDict({1: one, 2: two, 4: four}) b = InheritDict({3: three, 4: foobar}, inherit_from=a) a[1] # one a[4] # four b[1] # one b[3] # three b[4] # foobar I've written something like this in

Re: Code formatting question: conditional expression

2009-08-18 Thread Jan Kaliszewski
18-08-2009 Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Tue, 18 Aug 2009 10:04:36 -0400, John Posner wrote: [snip] How about this: excessblk = (Block(total - P.BASE, srccol, carry_button_suppress=True) if total P.BASE else None) If you

Re: Inheriting dictionary

2009-08-18 Thread Jan Kaliszewski
18-08-2009 o 21:44:55 Pavel Panchekha pavpanche...@gmail.com wrote: I want a dictionary that will transparently inherit from a parent dictionary. So, for example: a = InheritDict({1: one, 2: two, 4: four}) b = InheritDict({3: three, 4: foobar}, inherit_from=a) a[1] # one a[4] # four b[1] #

Re: Inheriting dictionary

2009-08-18 Thread Nat Williams
On Tue, Aug 18, 2009 at 2:44 PM, Pavel Panchekha pavpanche...@gmail.comwrote: I want a dictionary that will transparently inherit from a parent dictionary. So, for example: a = InheritDict({1: one, 2: two, 4: four}) b = InheritDict({3: three, 4: foobar}, inherit_from=a) a[1] # one a[4]

How to create functors?

2009-08-18 Thread Robert Dailey
Hello, I want to simply wrap a function up into an object so it can be called with no parameters. The parameters that it would otherwise have taken are already filled in. Like so: print1 = lambda: print( Foobar ) print1() However, the above code fails with: File

Re: How to create functors?

2009-08-18 Thread Duncan Booth
Robert Dailey rcdai...@gmail.com wrote: Hello, I want to simply wrap a function up into an object so it can be called with no parameters. The parameters that it would otherwise have taken are already filled in. Like so: print1 = lambda: print( Foobar ) print1() However,

Re: How to create functors?

2009-08-18 Thread Robert Dailey
On Aug 18, 3:31 pm, Duncan Booth duncan.bo...@invalid.invalid wrote: Robert Dailey rcdai...@gmail.com wrote: Hello, I want to simply wrap a function up into an object so it can be called with no parameters. The parameters that it would otherwise have taken are already filled in. Like so:

Re: Inheriting dictionary

2009-08-18 Thread Pavel Panchekha
On Aug 18, 4:23 pm, Jan Kaliszewski z...@chopin.edu.pl wrote: 18-08-2009 o 21:44:55 Pavel Panchekha pavpanche...@gmail.com wrote: I want a dictionary that will transparently inherit from a parent dictionary. So, for example: a = InheritDict({1: one, 2: two, 4: four}) b =

Re: define class over 2 files

2009-08-18 Thread Simon Forman
On Tue, Aug 18, 2009 at 1:57 AM, Steven D'Apranoste...@remove.this.cybersource.com.au wrote: On Mon, 17 Aug 2009 21:45:57 -0700, naveen wrote: Is it possible to split up a class definition over multiple files? Not exactly, but you can do variations of this: In file A.py, create: class

Re: How to create functors?

2009-08-18 Thread Robert Dailey
On Aug 18, 3:31 pm, Duncan Booth duncan.bo...@invalid.invalid wrote: Robert Dailey rcdai...@gmail.com wrote: Hello, I want to simply wrap a function up into an object so it can be called with no parameters. The parameters that it would otherwise have taken are already filled in. Like so:

Re: How to create functors?

2009-08-18 Thread Chris Rebert
On Tue, Aug 18, 2009 at 1:32 PM, Robert Daileyrcdai...@gmail.com wrote: On Aug 18, 3:31 pm, Duncan Booth duncan.bo...@invalid.invalid wrote: Robert Dailey rcdai...@gmail.com wrote: Hello, I want to simply wrap a function up into an object so it can be called with no parameters. The

Re: define class over 2 files

2009-08-18 Thread Jan Kaliszewski
18-08-2009 o 06:58:58 Xavier Ho cont...@xavierho.com wrote: On Tue, Aug 18, 2009 at 2:45 PM, naveen naveen.g...@gmail.com wrote: Is it possible to split up a class definition over multiple files? - Answer in short, I don't think so. Why not? - File a.py: class MyClass: def

Re: Parallelization in Python 2.6

2009-08-18 Thread Jonathan Gardner
On Aug 18, 11:19 am, Robert Dailey rcdai...@gmail.com wrote: I'm looking for a way to parallelize my python script without using typical threading primitives. For example, C++ has pthreads and TBB to break things into tasks. I would like to see something like this for python. So, if I have a

  1   2   3   >