Re: Logic operators with "in" statement

2009-11-17 Thread Richard Brodie
"Mr.SpOOn" wrote in message news:[email protected]... > In [13]: ('b3' and '5') in l or ('3' and 'b3') in l > Out[13]: True For anything more than the simplest cases, you might want use sets. That might be the correct data type from the start, depending on whe

Re: parallel class structures for AST-based objects

2009-11-21 Thread Richard Thomas
On 22 Nov, 00:07, MRAB wrote: > Steve Howell wrote: > > I have been writing some code that parses a mini-language, and I am > > running into what I know is a pretty common design pattern problem, > > but I am wondering the most Pythonic way to solve it. > > > Basically, I have a bunch of really si

Re: Any elegant way to construct the complete $k$-partite graph in Python?

2009-11-23 Thread Richard Thomas
On Nov 24, 2:45 am, geremy condra wrote: > On Mon, Nov 23, 2009 at 9:10 PM, geremy condra wrote: > > On Mon, Nov 23, 2009 at 9:03 PM, geremy condra wrote: > >> On Mon, Nov 23, 2009 at 7:05 PM, Paul Miller > >> wrote: > >>> I was wondering if there were any neat tools (like for instance, > >>> s

Re: IDE+hg

2009-11-24 Thread Richard Riley
Gerhard Häring writes: > Rhodri James wrote: >> On Mon, 23 Nov 2009 19:20:27 -, NiklasRTZ wrote: >> >>> Dear experts, >>> Since no py IDE I found has easy hg access. IDEs PIDA and Eric claim >>> Mercurial support not found i.e. buttons to clone, commit and push to >>> repositories to define

Re: Can't get sys.stdin.readlines() to work

2010-01-31 Thread Richard Thomas
On Jan 31, 6:15 pm, [email protected] wrote: > I'm trying to read some data from standard input, what I'm actually > trying to do is process some date pasted in using the mouse cut and > paste on a Linux box (xubuntu 9.10) in a terminal window. > > First attempts failed so I'm now trying the trivi

Re: When will Python go mainstream like Java?

2010-02-23 Thread Richard Lamboj
Am Tuesday 23 February 2010 09:07:43 schrieb Krister Svanlund: > On Tue, Feb 23, 2010 at 1:01 AM, Edward A. Falk wrote: > > You mean it's not? > > > > -- > >        -Ed Falk, [email protected] > >        http://thespamdiaries.blogspot.com/ > > Javas popularity was very much a product of its

Re: why (1, 2, 3) > [1, 2, 3] is true?

2010-02-25 Thread Richard Thomas
On Feb 25, 2:03 pm, fat bold cyclop wrote: > > Both are not equal, so the comparison returns an arbitrary result in Py2. > > Thanks, Stefan. If I understand you correctly the comparison is not > valid. > But I wonder if there is any logic behind this (in 2.x). > Is it possible to predict result of

Re: Docstrings considered too complicated

2010-02-26 Thread Richard Brodie
"Andreas Waldenburger" wrote in message news:[email protected]... >> Reminiscent of: >> >> mov AX,BX ; Move the contents of BX into AX >> > Well, there might be some confusion there as to what gets moved where, > wouldn't you say? Depends on what assembler

Re: Is there a better way to do this?

2010-03-01 Thread Richard Brodie
"Matt Mitchell" wrote in message news:[email protected]... > My initial idea was to make a list of all the different > ways "project" has been capitalized in my repo and try each one. The > code looks like this: I would use pysvn.Client.list to get a list of fi

RICHARD MOORE wants to stay in touch on LinkedIn

2010-03-03 Thread RICHARD MOORE
LinkedIn I'd like to add you to my professional network on LinkedIn. - RICHARD MOORE Confirm that you know RICHARD MOORE https://www.linkedin.com/e/isd/1117171902/jlHq1JKw/EML-invg_56/ -- (c) 2010, LinkedIn Corporation-- http://mail.python.org/mailman/listinfo/p

RICHARD MOORE wants to stay in touch on LinkedIn

2010-03-03 Thread RICHARD MOORE
LinkedIn I'd like to add you to my professional network on LinkedIn. - RICHARD MOORE Confirm that you know RICHARD MOORE https://www.linkedin.com/e/isd/1117171902/jlHq1JKw/EML-invg_56/ -- (c) 2010, LinkedIn Corporation-- http://mail.python.org/mailman/listinfo/p

Re: Docstrings considered too complicated

2010-03-03 Thread Richard Brodie
"Ed Keith" wrote in message news:[email protected]... > That has always puzzled me to. ETX and EOT were well established, > why no use one of them? I'd love to know what they were thinking. It goes back to ancient PDP operating systems, so may well predate Un

10th Python Game Programming Challenge in three weeks

2010-03-05 Thread Richard Jones
increase the public body of game tools, code and expertise, - Will let a lot of people actually finish a game, and - May inspire new projects (with ready made teams!) Come along and play, it's lots of fun :) Richard -- http://mail.python.org/mailman/listinfo/python-list

Re: String is ASCII or UTF-8?

2010-03-09 Thread Richard Brodie
"C. Benson Manica" wrote in message news:98375575-1071-46af-8ebc-f3c817b47...@q23g2000yqd.googlegroups.com... >The strings come from the same place, i.e. they're exclusively > normal ASCII characters. In this case then converting them to/from UTF-8 is a no-op, so it makes no difference at all.

Re: subtraction is giving me a syntax error

2010-03-15 Thread Richard Brodie
"Joel Pendery" wrote in message news:[email protected]... >> y_diff = y_diff-H > > Syntaxerror: Non-ASCII character '\x96' in file on line 70, but no > encoding declared. That's likely an en-dash, not a minus sign. -- http://mail.python.org/ma

help sending text to windows edit control

2010-03-24 Thread Richard Leahy
I am trying to write text into a windows edit control using python. it seems to write to every control i try except the edit box not sure if this is a security measure or not. here is my code any help please. import os,sys,subprocess,time from subprocess import * from os import * from cty

libpst - python bindings

2010-03-31 Thread Richard Lamboj
Hello, are there any python bindings for libpst? http://www.five-ten-sg.com/libpst/ https://alioth.debian.org/projects/libpst/ Kind Regards Richi -- http://mail.python.org/mailman/listinfo/python-list

Re: unittests with different parameters

2010-11-22 Thread Richard Thomas
On Nov 22, 11:38 am, Ulrich Eckhardt wrote: > Hi! > > I'm writing tests and I'm wondering how to achieve a few things most > elegantly with Python's unittest module. > > Let's say I have two flags invert X and invert Y. Now, for testing these, I > would write one test for each combination. What I

Next Melbourne PUG meeting Monday 6th of December

2010-11-28 Thread Richard Jones
Hi all, The Melbourne Python Users Group will be meeting 6PM next Monday, the 6th of December at RMIT University. For details see http://bit.ly/mpug. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to populate all possible hierarchical clusterings from a set of elements?

2011-01-13 Thread Richard Thomas
On Jan 13, 10:02 am, Alain Ketterlin wrote: > justin writes: > > Suppose I have [1,2,3,4,5], then there are many ways of making > > clustering. > > Among them, I want to pair up terminals until there is only one left > > at the end. > > Are you trying "ascending hierarchical clustering" by any ch

Re: How to populate all possible hierarchical clusterings from a set of elements?

2011-01-13 Thread Richard Thomas
On Jan 13, 3:59 pm, Alain Ketterlin wrote: > Richard Thomas writes: > > On Jan 13, 10:02 am, Alain Ketterlin > >> def clusterings(l): > >>     if len(l) == 1: > >>         print repr(l) > >>     else: > >>         n = len(l) > >>  

PIL Open Problem

2011-02-07 Thread Richard Holmes
I'm trying to create an image for use in Tkinter. If I understand the PIL documentation correctly, I first need to import Image, then create an instance of the Image class and call 'open' (this according to the documentation). When I try to do this using the model in the documentation, I get: Trac

Re: PIL Open Problem

2011-02-07 Thread Richard Holmes
On Mon, 07 Feb 2011 17:28:45 -0500, Corey Richardson wrote: >On 02/07/2011 05:27 PM, Richard Holmes wrote: >> I'm trying to create an image for use in Tkinter. If I understand the >> PIL documentation correctly, I first need to import Image, then >> create an instance o

Re: PIL Open Problem

2011-02-07 Thread Richard Holmes
On Tue, 08 Feb 2011 09:47:32 +1100, Ben Finney wrote: >Richard Holmes writes: > >> I'm trying to create an image for use in Tkinter. If I understand the >> PIL documentation correctly, I first need to import Image, then >> create an instance of the Image class an

Re: PIL Open Problem

2011-02-07 Thread Richard Holmes
On Tue, 08 Feb 2011 10:56:52 +1100, Ben Finney wrote: >Richard Holmes writes: > >> Thanks, Ben. It turns out that I imported both Image and Tkinter and >> Tkinter has an Image class that masked the Image class in the Image >> module. I solved the problem by moving the

Python Game Programming Challenge 12 (April 2011) is coming!

2011-02-08 Thread Richard Jones
rease the public body of game tools, code and expertise, - Will let a lot of people actually finish a game, and - May inspire new projects (with ready made teams!) Richard http://pyweek.org/12/ -- http://mail.python.org/mailman/listinfo/python-list

PyCon Australia 2011: 20th & 21st August, Sydney Masonic Center

2011-02-08 Thread Richard Jones
following the conference proper. International guests should note that Kiwi PyCon is to run on the following weekend, making it a great opportunity to attend a couple of awesome Down Under conferences and hopefully do some sprinting with the locals. Richard Jones http://pycon-au.org

Re: return an object of a different class

2011-02-15 Thread Richard Thomas
On Feb 16, 2:23 am, [email protected] wrote: > How can I do something like this in python: > > #!/usr/bin/python3.1 > > class MyNumbers: >    def __init__(self, n): >      self.original_value = n >      if n <= 100: >        self = SmallNumers(self) >      else: >        self = BigNumbers(self) > > clas

PyCon Australia 2011 - Call for Participation

2011-02-21 Thread Richard Jones
d out more go to the official Call for Proposals page here: http://pycon-au.org/2011/conference/proposals/ The deadline for proposal submission is the 2nd of May. See you in Sydney in August! Richard Jones PyCon AU Program Chair -- http://mail.python.org/mailman/listinfo/python-list

Re: Interfaces

2010-04-05 Thread Richard Thomas
On Apr 5, 4:40 pm, Roald de Vries wrote: > Dear all, > > PEP 245 and 246 about interfaces for python are both rejected for   > 'something much better' (GvR in 246's rejection notice). Does anybody   > know what this is? I am *very* curious! > > Kind regards, Roald Given that was in 2001, probably

Python and Regular Expressions

2010-04-07 Thread Richard Lamboj
Hello, i want to parse this String: version 3.5.1 { $pid_dir = /opt/samba-3.5.1/var/locks/ $bin_dir = /opt/samba-3.5.1/bin/ service smbd { bin = ${bin_dir}smbd -D pid = ${pid_dir}smbd.pid } service nmbd { b

Re: Python and Regular Expressions

2010-04-07 Thread Richard Lamboj
Am Wednesday 07 April 2010 10:52:14 schrieb Chris Rebert: > On Wed, Apr 7, 2010 at 1:37 AM, Richard Lamboj wrote: > > i want to parse this String: > > > > version 3.5.1 { > > > >        $pid_dir = /opt/samba-3.5.1/var/locks/ > >        $bin_dir = /opt/samba

PyCon Australia Call For Proposals

2010-04-07 Thread Richard Jones
f May. See you in Sydney in June! Richard Jones PyCon AU Program Chair -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Regular Expressions

2010-04-08 Thread Richard Lamboj
At the moment i have less time, so its painful to read about parsing, but it is quite interessting. I have taken a look at the different Parsing Modules and i'am reading the Source Code to understand how they Work. Since Yesterday i'am writing on my own small Engine - Just for Fun and understa

Re: Generating a rainbow?

2010-04-08 Thread Richard Thomas
On Apr 8, 5:46 pm, Tobiah wrote: > I'm having a difficult time with this.  I want > to display a continuous range of hues using HTML > hex representation (#RRGGBB).  How would I go > about scanning through the hues in order to > make a rainbow? > > Thanks, > > Toby Look at the colorsys module. h

PyCon Australia 2010 update

2010-04-21 Thread Richard Jones
gt; In Kind: Linux Australia <http://linux.org.au/> Thanks to our sponsors for helping make the event a reality. Richard Jones PyCon Australia 2010 -- http://mail.python.org/mailman/listinfo/python-list

WIN32 - get the GUID of a Network Device

2010-04-26 Thread Richard Lamboj
Hello, is there a way to get the GUID from a Network Device? Kind Regard, Richi -- http://mail.python.org/mailman/listinfo/python-list

Re: WIN32 - get the GUID of a Network Device

2010-04-26 Thread Richard Lamboj
Am Monday 26 April 2010 10:14:24 schrieb Tim Golden: > On 26/04/2010 09:06, Richard Lamboj wrote: > > is there a way to get the GUID from a Network Device? > > Are you talking about the MAC address? If so, here's > one way: > > > i

Python 2.5.x _winreg - rename a subkey

2010-04-27 Thread Richard Lamboj
Hello, is there a way to rename a subkey? Kind Regards, Richi -- http://mail.python.org/mailman/listinfo/python-list

PyCon Australia CFP: One Day Left!

2010-04-27 Thread Richard Jones
u.org/cfp As always, please pass this message on to people you feel will find it interesting. Richard Jones PyCon Australia 2010 http://pycon-au.org/ -- http://mail.python.org/mailman/listinfo/python-list

winreg - access mask

2010-04-28 Thread Richard Lamboj
Hello, if i want to read, write a key and set a value, does i only need to set KEY_WRITE, or does i need to set KEY_READ, KEY_WRITE and KEY_SET_VALUE? This questions is related to the OpenKey Function. http://docs.python.org/py3k/library/winreg.html <- The other Access modes are missing in th

function name

2010-04-28 Thread Richard Lamboj
Hello, is there any way to get the name from the actual called function, so that the function knows its own name? Kind Regards, Richi -- http://mail.python.org/mailman/listinfo/python-list

dynamic function add to an instance of a class

2010-04-29 Thread Richard Lamboj
Hello, i want to add functions to an instance of a class at runtime. The added function should contain a default parameter value. The function name and function default paramter values should be set dynamical. Kind Regards, Richi -- http://mail.python.org/mailman/listinfo/python-list

Re: dynamic function add to an instance of a class

2010-04-29 Thread Richard Lamboj
Am Thursday 29 April 2010 09:59:22 schrieb Xavier Ho: > On Thu, Apr 29, 2010 at 5:55 PM, Richard Lamboj wrote: > > Hello, > > > > i want to add functions to an instance of a class at runtime. The added > > function should contain a default parameter value. The fun

Re: dynamic function add to an instance of a class

2010-04-29 Thread Richard Lamboj
Am Thursday 29 April 2010 10:13:01 schrieb Peter Otten: > Richard Lamboj wrote: > > i want to add functions to an instance of a class at runtime. The added > > function should contain a default parameter value. The function name and > > function default paramter values sh

win32 - catch events(wmi?)

2010-05-03 Thread Richard Lamboj
Hello, i want catch the following events: - registry has chanced - file has chanced - outgoing network connection - programm start and i want to be able to allow, or deny this "requests". Kind Regards Richi -- http://mail.python.org/mailman/listinfo/python-list

Next Melbourne PUG meeting 6:30pm Monday 10th of May @ Horse Bazaar

2010-05-04 Thread Richard Jones
Fort) ... please feel free to suggest a topic - anything cool you've discovered lately. And I'm sure there'll be some talk about PyCon Australia as well! Richard -- http://mail.python.org/mailman/listinfo/python-list

PyCon Australia Early-Bird running out!

2010-05-05 Thread Richard Jones
Registration is open and the Early Bird tickets are running out. Register here: http://pycon-au.org/reg We offer two levels of registration for PyCon Australia 2010: Full (Early Bird) - $165 This is the registration rate for regular attendees. We're offering a limited Early Bird rate for the

Classes: nested functions vs. private methodes

2010-05-06 Thread Richard Lamboj
Hello, what should i take: - nested functions: class MyClass(object) def blah(self): def blub(var1, var2): do something... blub(1, 5) or class MyClass(object) def blah(self): def _blub(var1, var2): do something... _blub(1, 5) - "private" functions: class MyCl

Re: Classes: nested functions vs. private methodes

2010-05-06 Thread Richard Lamboj
Am Thursday 06 May 2010 12:02:47 schrieb Steven D'Aprano: > On Thu, 06 May 2010 11:24:49 +0200, Richard Lamboj wrote: > > Hello, > > > > what should i take: > > - nested functions: > > class MyClass(object) > > def blah(self): > >

importing modules

2010-05-07 Thread Richard Lamboj
Hello, I have a question about importing python modules. I have modul package, with submodules. So how can a submodul access a modul that is on level upper? Is there something like "import ../../blah"? I don't mean something like this: "import bla.blub.moep" Kind Regards, Richi -- http://

Re: importing modules

2010-05-07 Thread Richard Lamboj
Am Friday 07 May 2010 13:50:15 schrieb Jean-Michel Pichavant: > Richard Lamboj wrote: > > Hello, > > > > I have a question about importing python modules. > > > > I have modul package, with submodules. So how can a submodul access a > > modul that is on

inherit from data type

2010-05-11 Thread Richard Lamboj
Hello, i want to inherit from a data type. How can i do this? Can anyone explain more abou this? How knows python that it is a float, or a string? Kind Regards Richi -- http://mail.python.org/mailman/listinfo/python-list

Re: inherit from data type

2010-05-11 Thread Richard Lamboj
Am Tuesday 11 May 2010 10:47:35 schrieb Ulrich Eckhardt: > Richard Lamboj wrote: > > i want to inherit from a data type. How can i do this? Can anyone explain > > more abou this? > > Other than in e.g. C++ where int and float are special types, you can > inherit from them

Re: inherit from data type

2010-05-11 Thread Richard Lamboj
Am Tuesday 11 May 2010 11:38:42 schrieb Ulrich Eckhardt: > Richard Lamboj wrote: > > "How knows python that it is a float, or a string?" Sorry this was bad > > expressed. I want to create a new data type, which inherits from float. I > > just know the "dir"

Re: inherit from data type

2010-05-11 Thread Richard Lamboj
Am Tuesday 11 May 2010 20:16:50 schrieb Terry Reedy: > On 5/11/2010 7:51 AM, Richard Lamboj wrote: > > I just want to test what is possible with python and what not. There is > > no problem that i need to solve. > > > > This is what i'am searching for: >

PyCon Australia 2010 program announced

2010-05-17 Thread Richard Jones
Hi all, The program for PyCon Australia 2010, to be held at the Sydney Masonic Center over the weekend of June 26 and 27, has been posted. View the full list of presentations and the schedule at: http://pycon-au.org/2010/conference/ Register here: http://pycon-au.org/reg Richard

Re: function that counts...

2010-05-19 Thread Richard Thomas
For this kind of problem you should avoid all that stringification. I find it best to deal with sequences of digits of a fixed length and go from there. For example: def count1(m, n, cache={}): """Number of digit sequences of length `n` summing to `m`.""" if n < 0 or m < 0: return

Re: Drawing Multigraphs

2010-06-02 Thread Richard Brodie
"geremy condra" wrote in message news:[email protected]... > On Tue, Jun 1, 2010 at 9:42 AM, Nima wrote: >> Hi there, >> Is it possible to draw an (undirected) multigraph using a python library? >> I need to write a program that finds an Eulerian circuit in a

Re: map is useless!

2010-06-06 Thread Richard Thomas
y the name 'str' is only looked up once rather than 1 times. :-) Richard. -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading file bit by bit

2010-06-07 Thread Richard Thomas
y inefficient approach. If you explain what you are planning > to do we can most certainly come up with a better alternative. > > Peter You're reading those bits backwards. You want to read the most significant bit of each byte first... Richard. -- http://mail.python.org/mailman/listinfo/python-list

PyCon Australia 2010 registration deadline reminder

2010-06-07 Thread Richard Jones
udent registrations do not include a seat at the conference dinner. Additional seats at the conference dinner may be purchased for $77 each. All prices include GST. Information about the registration process is on the PyCon Australia website. Richard Jones PyCon Australia 2010 --

Re: UnboundLocalError: local variable referenced before assignment

2010-06-08 Thread Richard Thomas
on. so I did it, but still nothing... > using python 2.6.2 and reportlab 2.4 > help plz :) The version of mkTable.py you posted is clearly different to the one in the traceback. You might want to check that. Richard. -- http://mail.python.org/mailman/listinfo/python-list

Re: pythonize this!

2010-06-16 Thread Richard Brodie
"Lie Ryan" wrote in message news:[email protected]... > Probably bending the rules a little bit: > sum(x**2 - 8*x - 20 for x in range(1, 2010, 5)) > 536926141 Or, letting Python do the algera for you: >>> from sympy import var, sum >>> dummy = var('j k') >>> k = (5 * j) + 1 >>>

PyCon Australia 2010 Registration Closes Tomorrow

2010-06-20 Thread Richard Jones
registrations at the door. We will NOT be accepting money at the door. If you're registered and haven't paid by tomorrow you will not have a seat at the conference dinner. Richard Jones PyCon Australia 2010 -- http://mail.python.org/mailman/listinfo/python-list

Re: Python dynamic attribute creation

2010-06-25 Thread Richard Thomas
even > from a view of beauty, this is not a good design. > > I hope someone could teach me more about why Python design it like > it is. Any reply is more than welcome. > > Thanks for your time! > > -- > Live like a child, think like the god. If you desperately want to

Sphinx-1.0b compilation for python3.1

2010-07-01 Thread Richard Mathar
I am trying to install Sphinx-1.0b under a Python3 environment. Does anyone have experience with that task? cd *1.0b2 python3 setup.py build File "setup.py", line 50 print 'ERROR: Sphinx requires at least Python 2.4 to run.' So ../ 2to3 -w Sphinx-1.0b2 ... RefactoringTool: Warnings/mes

Re: Argh! Name collision!

2010-07-06 Thread Richard Thomas
On Jul 7, 3:11 am, "Alf P. Steinbach /Usenet" wrote: > Donald Knuth once remarked (I think it was him) that what matters for a > program > is the name, and that he'd come up with a really good name, now all he'd had > to > do was figure out what it should be all about. > > And so considering Stu

Re: C interpreter in Lisp/scheme/python

2010-07-07 Thread Richard Bos
Tim Rentsch wrote: > nanothermite911fbibustards > > > How to make Lisp go faster than C > > Didier Verna > > Asking whether Lisp is faster than C is like asking why it's > colder in the mountains than it is in the summer. YM warmer. HTH; HAND. Richard --

Re: Subsets of Python implemented in Python

2010-07-16 Thread Richard Thomas
On Jul 17, 12:34 am, candide wrote: > I don't understand why some parts of the Python language (or the Python > standard library too) are implemented in C while some other parts are > implemented in the Python language itself. For instance, lists and > dictionnaries are implemented in C but sets a

Re: Fascinating interview by Richard Stallman on Russia TV

2010-07-18 Thread Richard Heathfield
u must be an idiot, that's entirely up to you, but I would take it as a personal favour if you could be an idiot *somewhere else*. If you don't like GNU software, fine - don't use it. End of problem. -- Richard Heathfield <http://www.cpax.org.uk> Email: -http://www. +rjh@ &qu

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-19 Thread Richard Harter
On Wed, 18 Aug 2010 01:39:09 -0700 (PDT), Nick Keighley wrote: >On 17 Aug, 18:34, Standish P wrote: >> How are these heaps being implemented ? Is there some illustrative >> code or a book showing how to implement these heaps in C for example ? > >any book of algorithms I'd have thought > >http:

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-19 Thread Richard Harter
On Thu, 19 Aug 2010 04:14:42 -0700 (PDT), spinoza wrote: >On Aug 18, 1:44=A0am, James Kanze wrote: >> On Aug 17, 6:21 pm, Standish P wrote: >> >> > > Garbage collection doesn't use a stack. It uses a "heap", >> > > which is in the abstract a collection of memory blocks of >> > > different l

OI VEY, I AGREE -was once [Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?]

2010-08-20 Thread Richard Owlett
John Passaniti wrote: On Aug 20, 6:51 pm, Hugh Aguilar wrote: You can see an example of lists in my novice package (in the list.4th file):http://www.forth.org/novice.html Also in there is symtab, which is a data structure intended to be used for symbol tables (dictionaries). Almost nobody uses

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-24 Thread Richard Owlett
David Kastrup wrote: John Bokma writes: On the other hand: some people I knew during my studies had no problem at all with introducing countless memory leaks in small programs (and turning off compiler warnings, because it gave so much noise...) [...] As for electrical engineering: done th

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-24 Thread Richard Owlett
Hugh Aguilar wrote: [SNIP ;] The real problem here is that C, Forth and C++ lack automatic garbage collection. If I have a program in which I have to worry about memory leaks (as described above), I would be better off to ignore C, Forth and C++ and just use a language that supports garbage coll

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-24 Thread Richard Owlett
Hugh Aguilar wrote: On Aug 24, 4:17 pm, Richard Owlett wrote: Hugh Aguilar wrote: [SNIP ;] The real problem here is that C, Forth and C++ lack automatic garbage collection. If I have a program in which I have to worry about memory leaks (as described above), I would be better off to ignore

Re: Funny xmlrpc / linux problem

2009-06-19 Thread Richard Brodie
"Hans Müller" wrote in message news:[email protected]... > Small addition: > > While tracing the network data I found the server to be the problem, > the answer to a request is beeing delayed by about 180ms - no idea why. Nagle's algorithm: you've unintentionally pro

Re: PEP 376

2009-07-01 Thread Richard Brodie
"Joachim Strömbergson" wrote in message news:[email protected]... > Even so, choosing md5 in 2009 for something that (hopefully) will be > used in years is a bad design decision. It creates a dependency for to > an algorithm that all sensible recommendations po

Re: gett error message: "TypeError: 'int' object is not callable"

2009-07-09 Thread Richard Brodie
"Nick" wrote in message news:e54c4461-c0b7-42fb-8542-cefd7bf5f...@h18g2000yqj.googlegroups.com... > file = open(prefix1) > text = file.readlines() > len = len(text) You have redefined two built-in functions "file" and "len" in the first three lines. This is usually considered poor practice. S

Re: gett error message: "TypeError: 'int' object is not callable"

2009-07-09 Thread Richard Brodie
"Tom Kermode" wrote in message news:[email protected]... > Do you know a good way to avoid running into this problem? It > makes sense to suggest not calling variables the same names as > built-in functions, but that's hard for a new python programmer who > do

Announcing the 9th Pyweek game programming challenge!

2009-07-10 Thread Richard Jones
The date for the ninth PyWeek challenge has been set: Sunday 30th August to Sunday 6th September (00:00UTC to 00:00UTC) The PyWeek challenge invites entrants to write a game in one week from scratch either as an individual or in a team. Entries must be developed in Python, during the challeng

Re: strange python scripting error

2009-07-23 Thread Richard Brodie
"Diez B. Roggisch" wrote in message news:[email protected]... > They have different line-ending-conventions. Not sure if and why that makes > a difference. Depends on your setup. Shells can be a bit dumb about it, so it will likely break simple cgi-style hosting. -bash: ./pyth

Next meeting: Tuesday 11th August

2009-07-27 Thread Richard Jones
onger. I'll be getting up to talk a bit about my experiences playing with IronPython - what's cool and what's downright odd :) If you've got an idea for a talk just add it to the wiki page. Richard -- http://mail.python.org/mailman/listinfo/python-list

Registation is open for the 9th PyWeek game programming challenge!

2009-08-02 Thread Richard Jones
The ninth PyWeek challenge will run between: Sunday 30th August to Sunday 6th September (00:00UTC to 00:00UTC) The PyWeek challenge invites entrants to write a game in one week from scratch either as an individual or in a team. Entries must be developed in Python, during the challenge, and must

Re: Character encoding & the copyright symbol

2009-08-06 Thread Richard Brodie
"Robert Dailey" wrote in message news:29ab0981-b95d-4435-91bd-a7a520419...@b15g2000yqd.googlegroups.com... > UnicodeEncodeError: 'charmap' codec can't encode character '\xa9' in > position 1650: character maps to > > The file is defined as ASCII. That's the problem: ASCII is a seven bit code.

Re: Character encoding & the copyright symbol

2009-08-06 Thread Richard Brodie
"Robert Dailey" wrote in message news:f64f9830-c416-41b1-a510-c1e486271...@g19g2000vbi.googlegroups.com... > As you can see, I am trying to load the file with encoding 'cp1252' > which, according to the python 3.1 docs, translates to windows-1252. I > also tried 'latin_1', which translates to I

Re: unittest

2009-08-14 Thread Richard Thomas
You should certainly keep your test suite separate. There's a quick example of how to write unit tests in the unittest documentation: http://docs.python.org/library/unittest.html#basic-example Richard. -- http://mail.python.org/mailman/listinfo/python-list

Re: Code formatting question: conditional expression

2009-08-18 Thread Richard Brodie
"John Posner" wrote in message news:[email protected]... > 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 with one that

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-22 Thread Richard Harter
imes 2**172 (hex ac). I grant that this example looks a bit gobbledegookish, but normal usage would be much simpler. The notation doesn't handle balanced trinary; however I opine that balanced trinary requires special notation. Richard Harter, [email protected] http://home.tiac.net/~cri, http://www.varinoma.com No one asks if a tree falls in the forest if there is no one there to see it fall. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python/Fortran interoperability

2009-08-23 Thread Richard Maine
sturlamolden wrote: > On 24 Aug, 02:26, [email protected] (Richard Maine) wrote: > > > You missed the word "OOP", which seemed like the whole point. Not that > > the particular word is used in the Fortran standard, but it isn't hard > > to guess that he

Re: Python/Fortran interoperability

2009-08-23 Thread Richard Maine
old "soon"). Some other compilers are also getting there. But there is just no way that most people have spent much time developing with compilers that adequately supported the f2003 OOP features. (I'd cite my formal comment on f2008, and maybe David Muxworthy's r

Re: Python/Fortran interoperability

2009-08-24 Thread Richard Maine
tes back to f77 when character type was introduced; f2003 just extends it to the C character kind for the obscure case where the C character kind might be different from the default character kind (I don't know of any compilers where this is so, but the standard allows for it). -- Richard Maine

Re: Python/Fortran interoperability

2009-08-24 Thread Richard Maine
James Van Buskirk wrote: > "Richard Maine" wrote in message > news:1j4y84p.v5docbtueccmn%[email protected]... > > > One might plausibly regard this as a kludge, but it is a kludge that is > > part of the Fortran standard and is guaranteed to work with all

Next week: the 9th PyWeek game programming challenge!

2009-08-24 Thread Richard Jones
The ninth PyWeek challenge starts this weekend, running between Sunday 30th August to Sunday 6th September (00:00UTC to 00:00UTC) The PyWeek challenge invites entrants to write a game in one week from scratch either as an individual or in a team. Entries must be developed in Python, during the

Re: Python/Fortran interoperability

2009-08-30 Thread Richard Maine
e Fortran standard, but it isn't hard to guess that he means a derived type that uses some of the OOP features. Inheritance, polymorphism, and type-bound procedure (aka methods in some other languages) come to mind. Since you say that you haven't used any of the F2003 OOP features, it

Re: obscure problem using elementtree to make xhtml website

2009-09-04 Thread Richard Brodie
"Stefan Behnel" wrote in message news:[email protected]... >>Not a bug in IE (this time), which is correctly parsing the file as html. > > ... which is obviously not the correct thing to do when it's XHTML. It isn't though; it's HTML with a XHTML DOCTYPE, a

Re: palindrome iteration

2010-08-27 Thread Richard Arts
t >    return s[0:until] == s[-1:runtil:-1] > > At first glance this seems to be correct, but it is tricky indeed. Particularly the assignment of the offset variable, casting a bool to an integer of a negated expression. Given that Baba notes that this is a beginners level query, it wouldn't have hurt to be a little bit more verbose there. Richard -- http://mail.python.org/mailman/listinfo/python-list

Re: palindrome iteration

2010-08-27 Thread Richard Arts
   def reversed(s): >        return s[::-1] >    return s == reversed(s) > -- > http://mail.python.org/mailman/listinfo/python-list > That seems like a bit of overkill... Why would you want to define a function in a function for something trivial like this? Just def palindrome(s): return s[::-1] will do fine. Of course, you can stick the inner function in a library somewhere if you like. Regards, Richard -- http://mail.python.org/mailman/listinfo/python-list

Re: palindrome iteration

2010-08-27 Thread Richard Arts
On Fri, Aug 27, 2010 at 11:47 PM, Richard Arts wrote: > On Fri, Aug 27, 2010 at 10:51 PM, Jussi Piitulainen > wrote: >> MRAB writes: >>> On 27/08/2010 20:43, Jussi Piitulainen wrote: >>>> Dave Angel writes: >>>>> Jussi Piitulainen wrote: &g

<    5   6   7   8   9   10   11   >