Re: Free software and video codecs (was: ANN: Chandler 1.0)

2008-08-10 Thread Kay Schluehr
On 11 Aug., 07:24, Ben Finney <[EMAIL PROTECTED]> wrote: > Kay Schluehr <[EMAIL PROTECTED]> writes: > > On 11 Aug., 04:43, "SPE - Stani's Python Editor" > > <[EMAIL PROTECTED]> wrote: > > > As an open source project please be kind to Linux users and provide > > > also your screencasts in open sourc

Re: for x,y in word1, word2 ?

2008-08-10 Thread ssecorp
On Aug 11, 6:40 am, Mensanator <[EMAIL PROTECTED]> wrote: > On Aug 10, 11:18 pm, ssecorp <[EMAIL PROTECTED]> wrote: > > > Is there a syntax for looping through 2 iterables at the same time? > > > for x in y: > > for a in b: > > > is not what I want. > > > I want: > > for x in y and for a in b: > >

Free software and video codecs (was: ANN: Chandler 1.0)

2008-08-10 Thread Ben Finney
Kay Schluehr <[EMAIL PROTECTED]> writes: > On 11 Aug., 04:43, "SPE - Stani's Python Editor" > <[EMAIL PROTECTED]> wrote: > > As an open source project please be kind to Linux users and provide > > also your screencasts in open source video standards such (as ogg > > video) instead of only mov and

Re: ANN: Chandler 1.0

2008-08-10 Thread Kay Schluehr
On 11 Aug., 04:43, "SPE - Stani's Python Editor" <[EMAIL PROTECTED]> wrote: > On 10 aug, 04:54, Heikki Toivonen <[EMAIL PROTECTED]> wrote: > > The Chandler Project is pleased to announce the release of Chandler > > Desktop 1.0! > Congratulations! > > > The Chandler Project is an open source, standa

Re: Wildcards for regexps?

2008-08-10 Thread Paul McGuire
On Aug 10, 11:10 pm, ssecorp <[EMAIL PROTECTED]> wrote: > If I have an expression like "bob marley" and I want to match > everything with one letter wrong, how would I do? > so "bob narely" and "vob marley" should match etc. At first, I was going to suggest the brute force solution: ".ob marley|b

Python for Blackberry mobile phones

2008-08-10 Thread python
I'm looking for a version of Python for Blackberry mobile phones - has anyone heard of such a thing? I've been googling this topic without success. Thanks, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: for x,y in word1, word2 ?

2008-08-10 Thread Mensanator
On Aug 10, 11:18�pm, ssecorp <[EMAIL PROTECTED]> wrote: > Is there a syntax for looping through 2 iterables at the same time? > > for x in y: > � � for a in b: > > is not what I want. > > I want: > for x in y and for a in b: Something like this? >>> a = ['a','b','c'] >>> b = [1,2,3] >>> zip(a,b)

SSH utility

2008-08-10 Thread James Brady
Hi all, I'm looking for a python library that lets me execute shell commands on remote machines. I've tried a few SSH utilities so far: paramiko, PySSH and pssh; unfortunately all been unreliable, and repeated questions on their respective mailing lists haven't been answered... It seems like the

for x,y in word1, word2 ?

2008-08-10 Thread ssecorp
Is there a syntax for looping through 2 iterables at the same time? for x in y: for a in b: is not what I want. I want: for x in y and for a in b: -- http://mail.python.org/mailman/listinfo/python-list

Wildcards for regexps?

2008-08-10 Thread ssecorp
If I have an expression like "bob marley" and I want to match everything with one letter wrong, how would I do? so "bob narely" and "vob marley" should match etc. -- http://mail.python.org/mailman/listinfo/python-list

adding python libraries (for shared hosting)

2008-08-10 Thread Joseph
Hi all, My shared host provides python 2.3. Since it is a shared hosting, he is not willing to upgrade to a newer version. I am looking for option to upload 2.5 on my own. Is this possible and if so, can anyone please provide a pointer to how this can be achieved? Thank you, Joseph http://www.jju

Re: ANN: Chandler 1.0

2008-08-10 Thread Carl Banks
On Aug 9, 10:54 pm, Heikki Toivonen wrote: > The Chandler Project is pleased to announce the release of Chandler > Desktop 1.0! > > The Chandler Project is an open source, standards-based information > manager designed for personal use and small group collaboration. > > For more information on the

Re: Missing exceptions in PEP 3107

2008-08-10 Thread Carl Banks
On Aug 10, 6:42 pm, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: > Duncan Booth schrieb: > > > There is no currently recommended way to make such annotations, so how > > could the PEP mention it? > > Then it could mention the fact that there is currently no recommended > way (and maybe make some

Re: ANN: Chandler 1.0

2008-08-10 Thread SPE - Stani's Python Editor
On 10 aug, 04:54, Heikki Toivonen wrote: > The Chandler Project is pleased to announce the release of Chandler > Desktop 1.0! Congratulations! > > The Chandler Project is an open source, standards-based information > manager designed for personal use and small group collaboration. As an open sourc

Re: Eclipse, Python, wxPython and code completion

2008-08-10 Thread SPE - Stani's Python Editor
On 10 aug, 20:42, [EMAIL PROTECTED] wrote: > Hello, > > I've installed Eclipse, Python 2.5 and wxPython on Ubuntu 8.04. The > problem is that I can't get code completion for wx module. I don't > know if it occurs the same with other libraries outside the python > "core". > > If I compile/run my cod

Re: regular expression extracting groups

2008-08-10 Thread clawsicus
Thanks all for your responses, especially Paul McGuire for the excellent example usage of pyparsing. I'm off to check out pyparsing. Thanks, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Eclipse, Python, wxPython and code completion

2008-08-10 Thread Benjamin Kaplan
One of the problems with Ubuntu's repositories is that they are not always kept up to date. The version of eclipse is 2 years old, and PyDev is 24 updates behind. The newer versions handle code completion better. Download eclipse from www.eclipse.org (its already compiled, just unzip and run) and

Re: ANN: Chandler 1.0

2008-08-10 Thread Aahz
In article <[EMAIL PROTECTED]>, Heikki Toivonen <[EMAIL PROTECTED]> wrote: > >The Chandler Project is pleased to announce the release of Chandler >Desktop 1.0! Congrats! It's been a long, strange road -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ Adopt A Pro

Re: Constructing MIME message without loading message stream

2008-08-10 Thread Kris Kennaway
Diez B. Roggisch wrote: Kris Kennaway schrieb: I would like to MIME encode a message from a large file without first loading the file into memory. Assume the file has been pre-encoded on disk (actually I am using encode_7or8bit, so the encoding should be null). Is there a way to construct th

Re: Missing exceptions in PEP 3107

2008-08-10 Thread Christoph Zwerschke
Duncan Booth schrieb: There is no currently recommended way to make such annotations, so how could the PEP mention it? Then it could mention the fact that there is currently no recommended way (and maybe make some suggestions, like those given by you). -- http://mail.python.org/mailman/listin

Re: Constructing MIME message without loading message stream

2008-08-10 Thread Diez B. Roggisch
Kris Kennaway schrieb: I would like to MIME encode a message from a large file without first loading the file into memory. Assume the file has been pre-encoded on disk (actually I am using encode_7or8bit, so the encoding should be null). Is there a way to construct the flattened MIME message

Re: Missing exceptions in PEP 3107

2008-08-10 Thread Duncan Booth
Christoph Zwerschke <[EMAIL PROTECTED]> wrote: > But maybe the PEP should then at least mention what's the currently > recommended way to make annotations about thrown exceptions. > There is no currently recommended way to make such annotations, so how could the PEP mention it? I think the pro

New python module to simulate arbitrary fixed and infinite precision binary floating point

2008-08-10 Thread Rob Clewley
Dear Pythonistas, How many times have we seen posts recently along the lines of "why is it that 0.1 appears as 0.10001 in python?" that lead to posters being sent to the definition of the IEEE 754 standard and the decimal.py module? I am teaching an introductory numerical analysis clas

Re: parsing XSD

2008-08-10 Thread Spitfire
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Stefan, Stefan Behnel wrote: | BTW, if you want to write XML handling code that lets you understand what you | are doing, try ElementTree or lxml. lxml also has support for XML Schema, in | case you want to do more than parsing with it. | | Stefan

Re: Wouldn't it be nice if this worked?

2008-08-10 Thread Jean-Paul Calderone
On Mon, 11 Aug 2008 00:47:14 +0530, "Suresh V." <[EMAIL PROTECTED]> wrote: class A: def add(self, x, y): return x+y class B: pass B.add = A.add print B().add(1, 2) <- gives TypeError: unbound method add() must be called with A instance as first ar

Re: Wouldn't it be nice if this worked?

2008-08-10 Thread Christian Heimes
Calvin Spealman wrote: dont quote me but i do think this check is being removed. No, the check hasn't been removed - technically speaking. In Python 3.0 the behavior of the method descriptor has been changed. aclass.somemethod doesn't give you an instancemethod wrapper any more. It's a plain

Re: Wouldn't it be nice if this worked?

2008-08-10 Thread Stefan Behnel
Suresh V. wrote: > class A: > def add(self, x, y): > return x+y > > class B: > pass > > B.add = A.add > > print B().add(1, 2) <- gives TypeError: unbound method add() must >be called with A instance as first argument Works for me: Python 3.0b2

Re: Second python program: classes, sorting

2008-08-10 Thread Peter Otten
WP wrote: > I solved it, I rewrote __cmp__ to: > def __cmp__(self, other): >     if self.score == other.score: >        return cmp(self.name, other.name) >     else: >        return cmp(other.score, self.score) You can simplify that to def __cmp__(self, other): return cmp(other.score, self.s

Re: Wouldn't it be nice if this worked?

2008-08-10 Thread Calvin Spealman
dont quote me but i do think this check is being removed. On Sun, Aug 10, 2008 at 3:42 PM, Patrick Mullen <[EMAIL PROTECTED]> wrote: > How about: > > class A: >def add(self,x,y): >return x+y > > class B(A): >pass > > print B().add(1, 2) > > > > This also works: > > class A: > def

Re: Wouldn't it be nice if this worked?

2008-08-10 Thread Patrick Mullen
How about: class A: def add(self,x,y): return x+y class B(A): pass print B().add(1, 2) This also works: class A: def add(self, x, y): return x+y class B: pass B.add = A.add.im_func print B().add(1, 2) -- http://mail.python.org/mailman/listinfo/python-list

Wouldn't it be nice if this worked?

2008-08-10 Thread Suresh V.
class A: def add(self, x, y): return x+y class B: pass B.add = A.add print B().add(1, 2) <- gives TypeError: unbound method add() must be called with A instance as first argument -- http://mail.python.org/mailman/listinfo/python-list

Re: Second python program: classes, sorting

2008-08-10 Thread Wojtek Walczak
Dnia Sun, 10 Aug 2008 20:26:51 +0200, WP napisa�(a): Hi, > Hello, here are some new things I've problems with. I've made a program ... > def __cmp__(self, other): > print "in __cmp__" > return self.score >= other.score Check this out: http://docs.python.org/ref/customiza

Re: Second python program: classes, sorting

2008-08-10 Thread B
WP wrote: Hello, here are some new things I've problems with. I've made a program that opens and reads a text file. Each line in the file contains a name and a score. I'm assuming the file has the correct format. Each name-score pair is used to instantiate a class Score I've written. This work

Re: Second python program: classes, sorting

2008-08-10 Thread WP
WP wrote: Solved the problem, see below... Hello, here are some new things I've problems with. I've made a program that opens and reads a text file. Each line in the file contains a name and a score. I'm assuming the file has the correct format. Each name-score pair is used to instantiate a cl

Re: download limit

2008-08-10 Thread Diez B. Roggisch
Mathieu Prevot schrieb: Hi, I have a multithreaded script that mainly creates several wget processes to download files. I would like to check/see and eventually limit the bandwidth of the pool of processes. One way to do this is to change the number of wget instances, but it's a workaround. Wh

Eclipse, Python, wxPython and code completion

2008-08-10 Thread leon . domingo
Hello, I've installed Eclipse, Python 2.5 and wxPython on Ubuntu 8.04. The problem is that I can't get code completion for wx module. I don't know if it occurs the same with other libraries outside the python "core". If I compile/run my code containing the wx library, I get an application running

Re: Validation of parameters

2008-08-10 Thread Terry Reedy
Kless wrote: On 10 ago, 15:03, Paddy <[EMAIL PROTECTED]> wrote: If you just want the absense of _foo to raise an exception then why to just reference self._foo and leave the hard work to ptyhon? Something like: self._foo If it is present then fine, if it is not then an exception is raised.

Second python program: classes, sorting

2008-08-10 Thread WP
Hello, here are some new things I've problems with. I've made a program that opens and reads a text file. Each line in the file contains a name and a score. I'm assuming the file has the correct format. Each name-score pair is used to instantiate a class Score I've written. This works fine, but

Re: My very first python program, need help

2008-08-10 Thread WP
Wojtek Walczak wrote: [snip] Thanks for all your help. I've incorporated your suggestions and moved on to my next program. See new thread. :) - Eric (WP) -- http://mail.python.org/mailman/listinfo/python-list

Re: some kind of trace facility ?

2008-08-10 Thread Michele Simionato
On Aug 10, 1:14 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > I want to investigate on a regular base the flow of my Python (most of > them using wxPython) programs. > So I want to have some log facilty, that logs things like > - every time a function / method is called > - the time spen

Re: Fastest way to store ints and floats on disk

2008-08-10 Thread Aahz
In article <[EMAIL PROTECTED]>, Paul Rudin <[EMAIL PROTECTED]> wrote: >Laszlo Nagy <[EMAIL PROTECTED]> writes: >> >> Permature optimalization is the root of all evil. (Who said that?) > >Knuth I think. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare (often misatt

Re: benchmark

2008-08-10 Thread Kris Kennaway
jlist wrote: I think what makes more sense is to compare the code one most typically writes. In my case, I always use range() and never use psyco. But I guess for most of my work with Python performance hasn't been a issue. I haven't got to write any large systems with Python yet, where performan

Re: benchmark

2008-08-10 Thread Kris Kennaway
Angel Gutierrez wrote: Steven D'Aprano wrote: On Thu, 07 Aug 2008 00:44:14 -0700, alex23 wrote: Steven D'Aprano wrote: In other words, about 20% of the time he measures is the time taken to print junk to the screen. Which makes his claim that "all the console outputs have been removed so th

Re: Replace value of node using getElementsByTagName

2008-08-10 Thread Stefan Behnel
Ouray Viney wrote: > In your example you show: > > ib.text = calculate_new_value(ib.text) > > I don't know what calculate_new_value() represents. It's meant as pseudo-code. Just take the function name literally and replace it by something that gives you the value you want to assign (as you alrea

Re: Replace value of node using getElementsByTagName

2008-08-10 Thread Ouray Viney
On Aug 10, 9:01 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Ouray Viney wrote: > > Is there an easy way to replace the node value of ?  Perhaps I am > > trying to use the wrong python XML library? > > Looks like it. Try ElementTree. > >     from xml.etree import ElementTree >     tree = ElementT

Re: Validation of parameters

2008-08-10 Thread Kless
On 10 ago, 15:03, Paddy <[EMAIL PROTECTED]> wrote: > If you just want the absense of _foo to raise an exception then why to > just reference self._foo and leave the hard work to ptyhon? Something > like: > >   self._foo > > If it is present then fine, if it is not then an exception is raised. It on

Re: regular expression extracting groups

2008-08-10 Thread Paul McGuire
On Aug 10, 7:56 am, Paul Hankin <[EMAIL PROTECTED]> wrote: > On Aug 10, 2:30 pm, [EMAIL PROTECTED] wrote: > > > I'm trying to use regular expressions to help me quickly extract the > > contents of messages that my application will receive. > > Don't use regexps for parsing complex data; they're lim

How to convert DocBook "sect1" to html by Python?

2008-08-10 Thread Younger Wang
Hi, Is there any way to convert from DocBook to html in Python? Thanks! BR Younger Wang -- http://mail.python.org/mailman/listinfo/python-list

Re: My very first python program, need help

2008-08-10 Thread Wojtek Walczak
Dnia Sun, 10 Aug 2008 15:52:37 +0200, WP napisa�(a): Hi, > import re > > def calculate_sum_1(str): ^^^ this word is reserved, better use some other name > for c in str: > if c.isdigit() == False and c != ' ': > # That we assign to t

RE: regular expression extracting groups

2008-08-10 Thread Edwin . Madari
if its *NOT* an exercise in re, and if input is a bunch of lines within '{' and '}' and each line is key="value" pairs, I would not go near re. instead simply parse keys and array of values into a dictionary, and process them from the dictionary as below, and the key option correctly has 2 entr

Re: download limit

2008-08-10 Thread Martin v. Löwis
> I have a multithreaded script that mainly creates several wget > processes to download files. I would like to check/see and eventually > limit the bandwidth of the pool of processes. One way to do this is to > change the number of wget instances, but it's a workaround. > > What do you recommend

Re: Validation of parameters

2008-08-10 Thread Paddy
On Aug 10, 9:13 am, Kless <[EMAIL PROTECTED]> wrote: > Which is the best mode for validation of parameters? I'm using the > next way but it is not well testable. > > - > if not self._foo: >     try: >         raise ValueError('ValueError: foo not found') >     except Val

My very first python program, need help

2008-08-10 Thread WP
Hello, below is my very first python program. I have some questions regarding it and would like comments in general. I won't be able to get my hands on a good python book until tomorrow at the earliest. The program takes a string and sums all numbers inside it. I'm testing with the following st

Re: parsing XSD

2008-08-10 Thread Stefan Behnel
Hi, quite a lengthy mail for four lines of content. I guess there was no space left to say "hi"? Spitfire wrote: > I'm trying to use xml.dom.minidom parser to parse a XML schema file. > And, when I invoke 'childNodes' on the root element (schema) I get all > the nodes defined under it, instead of

Re: Replace value of node using getElementsByTagName

2008-08-10 Thread Stefan Behnel
Ouray Viney wrote: > Is there an easy way to replace the node value of ? Perhaps I am > trying to use the wrong python XML library? Looks like it. Try ElementTree. from xml.etree import ElementTree tree = ElementTree.parse("yourfile.xml") for ib in tree.findall("//ib"): ib.te

Re: regular expression extracting groups

2008-08-10 Thread Paul Hankin
On Aug 10, 2:30 pm, [EMAIL PROTECTED] wrote: > I'm trying to use regular expressions to help me quickly extract the > contents of messages that my application will receive. Don't use regexps for parsing complex data; they're limited, completely unreadable, and hugely difficult to debug. Your code

download limit

2008-08-10 Thread Mathieu Prevot
Hi, I have a multithreaded script that mainly creates several wget processes to download files. I would like to check/see and eventually limit the bandwidth of the pool of processes. One way to do this is to change the number of wget instances, but it's a workaround. What do you recommend to do

regular expression extracting groups

2008-08-10 Thread clawsicus
Hi list, I'm trying to use regular expressions to help me quickly extract the contents of messages that my application will receive. I have worked out most of the regex but the last section of the message has me stumped. This is mostly because I want to pull the content out into regex groups that

Re: Missing exceptions in PEP 3107

2008-08-10 Thread Christoph Zwerschke
Duncan Booth wrote: If you really want this then you can use a decorator to insert a 'raise' key into the annotations: Well, yes, but wasn't the whole point of PEP 3107 to get rid of such decorators and provide a single standard way of specifying this kind of info instead? I don't know how

Re: Missing exceptions in PEP 3107

2008-08-10 Thread Duncan Booth
Christoph Zwerschke <[EMAIL PROTECTED]> wrote: > That would be possible. But I still think it makes sense to separate > them, like so: > > def foo(a: "a info", b: "b info") -> "ret info" raise "exc info": > return "hello world" > > And then the annotation dictionary would contain another k

Re: Replace value of node using getElementsByTagName

2008-08-10 Thread Ken Starks
Ouray Viney wrote: Xml 8.4.27.5 python from xml.dom import minidom xmldoc = minidom.parse('C:\TestProfile.xml') xmldoc ibNodeList = xmldoc.getElementsByTagName("ib") firstChild = xmldoc.firstChild for node in xmldoc.getElementsByTagName('ib'): # visit every node print node.toxml()

Re: some kind of trace facility ?

2008-08-10 Thread Diez B. Roggisch
Stef Mientki schrieb: hello, I want to investigate on a regular base the flow of my Python (most of them using wxPython) programs. So I want to have some log facilty, that logs things like - every time a function / method is called - the time spent in that function / method (or even better sta

Re: Missing exceptions in PEP 3107

2008-08-10 Thread Christoph Zwerschke
Matimus schrieb: The expr in that "raises" clause should be a list of Exceptions. You are clearly confusing the annotation feature with a possible application of the annotation feature. Annotation could be used for many different applications besides type safety. Sorry, I wanted to say "*coul

'Bad Signature' error with M2Crypto

2008-08-10 Thread Usman Ajmal
I think it is a right place to ask my query... I wrote the following code for signing and verifying some message using Public-Private Key Encyption but it has a problem. It is giving me a 'Bad Signature' error at line 27. I don't know what wrong am i doing as to me the signature is looking fine. I

Re: internet searching program

2008-08-10 Thread BAnderton
I was doing something very similar on my windows XP machine a year ago (with python 2.4) and used Mayukh Bose's Internet Explorer controller (see http://www.mayukhbose.com/python/IEC/index.php for details/ download). It worked very nicely for my needs and was rather intuitive (generally much easie

Validation of parameters

2008-08-10 Thread Kless
Which is the best mode for validation of parameters? I'm using the next way but it is not well testable. - if not self._foo: try: raise ValueError('ValueError: foo not found') except ValueError, err: print (err.message) print("Valid value

Segmentation fault with Py_Finalize()

2008-08-10 Thread Gal Aviel
Hello All, I Need some tips/help/ideas debugging segmentation fault ... I'm trying to debug Python running embedded inside a Verilog Simulator (as a SystemVerilog DPI application). (on SUSE LINUX Enterprise Server 9 (i586)) The Embedded python loads two SWIG wrapped modules (written in C and C

Replace value of node using getElementsByTagName

2008-08-10 Thread Ouray Viney
Xml 8.4.27.5 python from xml.dom import minidom xmldoc = minidom.parse('C:\TestProfile.xml') xmldoc ibNodeList = xmldoc.getElementsByTagName("ib") firstChild = xmldoc.firstChild for node in xmldoc.getElementsByTagName('ib'): # visit every node print node.toxml() node.replaceChild("8.

Re: internet searching program

2008-08-10 Thread KillSwitch
Thanks a lot for all of everyones help, I am really looking forward to learning the ins and ous of python or my first programming language. -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython IDE question

2008-08-10 Thread gooli
The best thing I've found until now is XRCed. It has it's quirks and pitfalls, but it fits the bill. Personally I prefer the previous version (the one that comes with wxPython 2.8.6) and don't really like what's been done with it lately, but that's a matter of taste really. It seems like a really