Re: sort array, apply rearrangement to second

2010-03-30 Thread Alf P. Steinbach
* Victor Eijkhout: I have two arrays, made with numpy. The first one has values that I want to use as sorting keys; the second one needs to be sorted by those keys. Obviously I could turn them into a dictionary of pairs and sort by the first member, but I think that's not very efficient, at leas

Re: Getting a Python program to run of off a flash drive?

2010-03-31 Thread Alf P. Steinbach
* Abethebabe: I wanted to know if there was a way I could get a Python program to run off of my flash drive as soon as the computer (Windows) detected the device? For example I could have a a simple program that would create a text document on the computers desktop when my flash drive is detecte

Re: Get Eclipse/PyDev to run scripts that don't end in .py

2010-03-31 Thread Martin P. Hellwig
On 03/31/10 22:37, J wrote: Is there any way to tell PyDev in Eclipse to run a script that doesn't end in .py? Even if I have to go and manually set something for each file... I've inherited (in a manner of speaking) a dev project that is done in python2.6... I pulled the latest dev branch and

Re: C-style static variables in Python?

2010-04-01 Thread Alf P. Steinbach
* kj: When coding C I have often found static local variables useful for doing once-only run-time initializations. For example: int foo(int x, int y, int z) { static int first_time = TRUE; static Mongo *mongo; if (first_time) { mongo = heavy_lifting_at_runtime(); first_time = FAL

idle 2.x and unicode literals

2010-04-02 Thread Joe P. Cool
Hi, I'm working with Python 2.6.4 on Ubuntu 9.10 and noticed a difference between IDLE and command line python. If I enter an é (accented e, LATIN SMALL LETTER E WITH ACUTE) as a unicode string in command line python I get this: >>> u'é' u'\xe9' In IDLE 2.6.4 I get this: >>> u'é' u'\xc3\xa9'

Re: subclass of object

2010-04-02 Thread Alf P. Steinbach
* Jason Friedman: Hi, what is the difference between: def MyClass(object): pass and def MyClass(): pass If you really meant 'def', then the first is a routine taking one argument, and the second is a routine of no arguments. If you meant 'class' instead of 'def', then it depends o

Re: subclass of object

2010-04-02 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * Jason Friedman: Hi, what is the difference between: def MyClass(object): pass and def MyClass(): pass If you really meant 'def', then the first is a routine taking one argument, and the second is a routine of no arguments. If

Re: off topic but please forgive me me and answer

2010-04-03 Thread Martin P. Hellwig
On 04/03/10 14:38, Steve Holden wrote: If you think you will persuade a crackpot to drop his lunacy by logical argument you are clearly an optimist of the first water. But since I like a challenge (and bearing in mind this is OT so I don't claim to be an expert) you might try first of all persu

Re: off topic but please forgive me me and answer

2010-04-03 Thread Martin P. Hellwig
On 04/03/10 16:17, Steven D'Aprano wrote: On Sat, 03 Apr 2010 15:43:41 +0100, Martin P. Hellwig wrote: I am replying to this post not because I disagree but because it postalogically fits the best (I am by no means an expert either). IMHO, the crackpot in this regard is actually part

Re: off topic but please forgive me me and answer

2010-04-03 Thread Martin P. Hellwig
On 04/03/10 16:46, Patrick Maupin wrote: On Apr 3, 9:43 am, "Martin P. Hellwig"> IMHO, the crackpot in this regard is actually partially right, multiplication does mean that the number must get bigger, however for fractions you multiply four numbers, two numerators and two deno

Re: Splitting a string

2010-04-03 Thread Alf P. Steinbach
* Steven D'Aprano: Tests which you know can't fail are called assertions, pre-conditions and post-conditions. We test them because if we don't, they will fail :) :-) It's the umbrella law. Cheers, - Alf -- http://mail.python.org/mailman/listinfo/python-list

Multiple independently started python processes and sharing of a module

2011-01-13 Thread Martin P. Hellwig
uared wheel or am totally missing the point. Any suggestions/comments are greatly appreciated, Thanks in advanced, Martin P. Hellwig -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple independently started python processes and sharing of a module

2011-01-14 Thread Martin P. Hellwig
On 01/14/11 03:04, Kushal Kumaran wrote: - Original message - Hi all, I have the following problem (which I already have a hacked around solution that works but I'd would like some more input on it): I have a situation where multiple python processes are started independently from each

Re: Multiple independently started python processes and sharing of a module

2011-01-14 Thread Martin P. Hellwig
On 01/14/11 10:05, Kushal Kumaran wrote: This might help though: https://code.google.com/p/modwsgi/wiki/ProcessesAndThreading It seems if you're not using 'daemon' mode, global data might be shared. Yes I read that thoroughly before I started out implementing a solution. B

Should there be a 'core' python install? (was Re: Tkinter: The good, the bad, and the ugly!)

2011-01-17 Thread Martin P. Hellwig
On 01/17/11 19:39, rantingrick wrote: Q: If you could replace Tkinter with any module/library (THAT IS NOT A GUI OR IDE!!) what would you like to see fill its place? Some systems, like FreeBSD have Tkinter and IDLE as a separate package which is not installed by default. Purely because those

Re: Should there be a 'core' python install? (was Re: Tkinter: The good, the bad, and the ugly!)

2011-01-17 Thread Martin P. Hellwig
On 01/17/11 22:00, rantingrick wrote: On Jan 17, 2:09 pm, "Martin P. Hellwig" wrote: fortunately it is not my call and I actually quite like Tkinter. Are you sure about that Martin? :))) From: "Martin P. Hellwig" Newsgroups: comp.lang.python Subject: Re: GUIs - A Modes

Re: locale settings and date parsing under windows

2011-02-03 Thread Martin P. Hellwig
On 02/03/11 10:59, AlienBaby wrote: On Feb 3, 10:22 am, AlienBaby wrote: Hi, I'm attempting to convert some date-time strings from a text file under windows into a datetime object as returned by strptime() However, the strings can represent dates in various formats based on the country of ori

Displaying SVG in tkinter using cairo and rsvg

2011-02-15 Thread Martin P. Hellwig
Hi all, Information on using tkinter for displaying an svg image seems a bit low spread on the Internet. I recently played around with pygame and svg and realized, hold on this can be done with tk too. So I thought I post a little example for future generations :-) (and also have stored at ht

Re: Displaying SVG in tkinter using cairo and rsvg

2011-02-16 Thread Martin P. Hellwig
On 02/16/11 09:04, Arndt Roger Schneider wrote: raster images from SVG: There are multiple methods to convert a scalable vector graphic into a bitmap. In addition to cairo, librsvg and rsvg imageMagick contains a vector graphic format similar to svg--gradients and transparency are problematic fo

Re: Is there a standard name for this tree structure?

2010-04-04 Thread Alf P. Steinbach
* Steven D'Aprano: I have a hierarchical structure something like a directory tree or a nested tree structure: Mammal +-- Ape : +-- Chimpanzee : +-- Gorilla : +-- Human +-- Carnivore : +-- Cat : +-- Tiger Reptile +-- Lizard +-- Snake +-- Cobra +-- Python This is a forest

Re: Incorrect scope of list comprehension variables

2010-04-04 Thread Alf P. Steinbach
* Ethan Furman: Steve Howell wrote: On Apr 3, 9:58 pm, Tim Roberts wrote: Alain Ketterlin wrote: I've just spent a few hours debugging code similar to this: d = dict() for r in [1,2,3]: d[r] = [r for r in [4,5,6]] print d Yes, this has been fixed in later revisions, but I'm curious

In disGuiodoise?

2010-04-04 Thread Alf P. Steinbach
* ratingrick: A while back i had wondered why Guido never posts to c.l.py anymore. Was it because he thinks himself better than us, no, it's because of the "low-brow-infantile-Jerry-Springer-ish-nature" that this list has imploded into. Perhaps Guido provides subtle guidance under some unreco

Re: In disGuiodoise?

2010-04-04 Thread Alf P. Steinbach
* Patrick Maupin: On Apr 4, 11:14 am, "Alf P. Steinbach" wrote: "He walks among you, and you don't recognize him" - Old jungle proverb Hm, interesting Google results for that phrase. Interesting self-promotion :-) No, I'm not Guido. Cheers, - Alf --

Re: local variable referenced before assignment

2010-04-04 Thread Alf P. Steinbach
* johngilbrough: I cannot make sense of what's happening here ... I'm getting the following error: initializing last modified time /home/john/Dropbox/Projects/python/scripts/src 29 referencing last modified time /home/john/Dropbox/Projects/python/scripts/src 29 referencing last modified time Tr

Re: local variable referenced before assignment

2010-04-04 Thread Alf P. Steinbach
* Stephen Hansen: On 2010-04-04 15:22:48 -0700, Alf P. Steinbach said: * johngilbrough: I cannot make sense of what's happening here ... I'm getting the following error: (1) At least in Py3 you can declare the variable as 'global', like this: global lastModi

Re: In disGuiodoise?

2010-04-05 Thread Martin P. Hellwig
On 04/05/10 00:05, r wrote: However i have also considered that maybe *all* the "well knowns" are in fact the many colorful personalities of Guido. De vraag is dan natuurlijk of al zijn persoonlijkheden nog steeds nederlands machtig zijn. -- mph -- http://mail.python.org/mailman/listinfo/

Re: Q about assignment and references

2010-04-06 Thread Alf P. Steinbach
* jdbosmaus: Pretty new to Python, but I thought I understood what is meant by "an assignment is a reference." Until I tried to understand this. Here is a (fragment of an) event handler for a group of three wxPython toggle buttons. The idea is to change the appearance of the label of the button

Re: order that destructors get called?

2010-04-08 Thread Alf P. Steinbach
* Brendan Miller: Thanks Steven and Gabriel. Those are very informative responses. In my case my resource isn't bound to a lexical scope, but the: def __del__(self, delete_my_resource=delete_my_resource): pattern works quite well. I've made sure to prevent my class from being

Cleanup guarantees?

2010-04-08 Thread Alf P. Steinbach
Consider ... import urllib.request # urlopen import codecs # getreader import sys # stderr def text_stream_from( url, encoding ): text_reader = codecs.getreader( encoding ) connection = urllib.request.urlopen( url ) return text_reader( connection ) def lis

Re: Cleanup guarantees?

2010-04-08 Thread Martin P. Hellwig
On 04/09/10 05:13, Alf P. Steinbach wrote: Second, I'm unable to find documentation of when they're called and what they do. It seems that (A) when the connection object's stream is exhausted by reading, its close() method is called automatically, and (B) that when the text_

Re: The Regex Story

2010-04-09 Thread Alf P. Steinbach
language unrelated to normal maths syntax for doing so: # Calculate the roots of sin**2(3*x-y): result = me.compile("{^g.?+*y:h}|\Y^r&(?P:2+)|\w+(x&y)|[?#\s]").solve() http://www.youtube.com/watch?v=a9xAKttWgP4 Cheers, - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Cleanup guarantees?

2010-04-10 Thread Alf P. Steinbach
* Gabriel Genellina: En Fri, 09 Apr 2010 01:13:37 -0300, Alf P. Steinbach escribió: > > import urllib.request # urlopen > import codecs # getreader > import sys # stderr > > def text_stream_from( url, encoding ): > text_reader = codec

Re: 2.7 beta 1

2010-04-11 Thread Martin P. Hellwig
On 04/12/10 06:57, Mensanator wrote: On Apr 11, 6:08 pm, Steven D'Aprano wrote: On Sun, 11 Apr 2010 11:54:04 -0700, Mensanator wrote: On Apr 11, 11:53 am, Steven D'Aprano wrote: On Sat, 10 Apr 2010 21:08:44 -0700, Mensanator wrote: Maybe because I'm a user, not a developer. You write co

Re: curious about python version numbers

2010-04-13 Thread Alf P. Steinbach
* Alex Hall: Hi all, I am just curious: if Python3.x is already out, why is 2.7 being released? Are there two main types of Python? Thanks. Old code and old programming habits may work as-is with 2.7 but not with a 3.x implementation. So yes, there are two main extant variants of Python, 2.x

Re: Unit testing errors (testing the platform module)

2010-04-13 Thread Martin P. Hellwig
On 04/13/10 15:01, John Maclean wrote: I normally use languages unit testing framework to get a better understanding of how a language works. Right now I want to grok the platform module; 1 #!/usr/bin/env python 2 '''a pythonic factor''' 3 import unittest 4 import platform 5 6

Re: msvcr90.dll is MIA?

2010-04-14 Thread Alf P. Steinbach
* Alex Hall: Hi all, For testing purposes, and because I am not yet distributing my application (which, thanks to you all, is now running perfectly!), I am going to just bundle msvcr90.dll. However, I cannot find it! I ran vcredist_x86.exe (I have a 64-bit version of win7, but all I have is the x

Can anyone reproduce this crash?

2010-04-16 Thread Alf P. Steinbach
Python 3.1.1 in Windows XP Prof: def number_from_user( prompt ): while True: spec = input( prompt ) try: return float( spec ) except ValueError: s = "Sorry, '{}' is not a valid number spec. Try e.g. '3.14'." print( s.format( spec )

Re: Can anyone reproduce this crash?

2010-04-16 Thread Alf P. Steinbach
* MRAB: Alf P. Steinbach wrote: Python 3.1.1 in Windows XP Prof: def number_from_user( prompt ): while True: spec = input( prompt ) try: return float( spec ) except ValueError: s = "Sorry, '{}' is not a valid number spec.

Re: Can anyone reproduce this crash?

2010-04-16 Thread Alf P. Steinbach
* Alf P. Steinbach: * MRAB: Alf P. Steinbach wrote: Python 3.1.1 in Windows XP Prof: def number_from_user( prompt ): while True: spec = input( prompt ) try: return float( spec ) except ValueError: s = "Sorry, '{}' is not

Re: Can anyone reproduce this crash?

2010-04-16 Thread Alf P. Steinbach
* Alf P. Steinbach: > [About baffling almost not reproducible interpreter crash on Ctrl C] The error code 0xc417 is some custom one, not a standard Windows code. Sorry, I was wrong about that, just that the MS ErrLook utility didn't find it. http://social.msdn.microsoft.com/F

Re: Can anyone reproduce this crash?

2010-04-16 Thread Alf P. Steinbach
* Alf P. Steinbach: * Alf P. Steinbach: > [About baffling almost not reproducible interpreter crash on Ctrl C] The error code 0xc417 is some custom one, not a standard Windows code. Sorry, I was wrong about that, just that the MS ErrLook utility didn't find it

Re: Can anyone reproduce this crash?

2010-04-16 Thread Alf P. Steinbach
* Alf P. Steinbach: Found a another bug discussion with * same exception, 0xc417 STATUS_INVALID_CRUNTIME_PARAMETER * same address, 0x78588389 * almost same Python version, namely Py3, * almost same context, namely occurring when program terminates, at http

Re: Incorrect scope of list comprehension variables

2010-04-16 Thread Alf P. Steinbach
* Steven D'Aprano: On Fri, 16 Apr 2010 08:48:03 -0700, Aahz wrote: In article <4bb92850$0$8827$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: Nevertheless, it is a common intuition that the list comp variable should *not* be exposed outside of the list comp, and that the for-loop variable

Re: Building a GUI Toolkit

2010-04-18 Thread Martin P. Hellwig
On 04/18/10 12:49, Tim Diels wrote: Hi I was thinking of writing a GUI toolkit from scratch using a basic '2D library'. I have already come across the Widget Construction Kit. My main question is: Could I build a GUI toolkit of reasonable performance with the Widget Construction Kit, would it s

Req. for feedback -- writings on error handling & cleanup (Py3)

2010-04-19 Thread Alf P. Steinbach
After at least 3 false starts on my programming introduction's chapter 3, and some good and bad feedback from this group[1], I finally think the present chapter 3 approach is Good (enough). So no, I haven't given up in this book project, even though 4 months to produce these chapter 3's first

Re: Building a GUI Toolkit

2010-04-20 Thread Martin P. Hellwig
On 04/20/10 19:53, Lie Ryan wrote: Rather than writing a windowing toolkit from the low-level, I would rather like to see some wrapper for existing windowing toolkit which uses more pythonic idioms. Most popular python GUI toolkit currently in use are only a simple thin wrapper over the librar

Re: Building a GUI Toolkit

2010-04-20 Thread Martin P. Hellwig
On 04/20/10 21:15, Martin P. Hellwig wrote: On 04/20/10 19:53, Lie Ryan wrote: Rather than writing a windowing toolkit from the low-level, I would rather like to see some wrapper for existing windowing toolkit which uses more pythonic idioms. Most popular python GUI toolkit currently in use

Re: rfind bug ?

2010-04-21 Thread Alf P. Steinbach
* Chris Rebert: On Wed, Apr 21, 2010 at 2:59 AM, Stef Mientki wrote: On 21-04-2010 10:56, Chris Rebert wrote: On Wed, Apr 21, 2010 at 1:51 AM, Stef Mientki wrote: With the following code, I would expect a result of 5 !! a= 'word1 word2 word3' a.rfind(' ',7) 11 Is this a bug ? No. Don'

Re: when should I explicitly close a file?

2010-04-21 Thread Alf P. Steinbach
* Lawrence D'Oliveiro: In message <4bc9aad...@dnews.tpgi.com.au>, Lie Ryan wrote: Since in python nothing is guaranteed about implicit file close ... It is guaranteed that objects with a reference count of zero will be disposed. Only in current CPython. In my experiments, this happens i

Re: a.extend(b) better than a+=b ?

2010-04-22 Thread Alf P. Steinbach
* candide: Suppose a and b are lists. What is more efficient in order to extend the list a by appending all the items in the list b ? I imagine a.extend(b)to be more efficient for only appendinding the items from b while a+=b creates a copy of a before appending, right ? No. But in gener

Re: string caracters:

2010-04-22 Thread Alf P. Steinbach
* luca72: i get a string from a web server and i save it in to a file, that i open the file and i read the string: the string looks like : http://lhti.gs/JKBTYD after the read i use webbrowser open (sting), but i get the error because at the end of the string are added '%0D%0A', and if i ask for

Re: Linux servers, network and file names

2010-04-23 Thread Martin P. Hellwig
On 04/22/10 15:13, Infinity77 wrote: For me: //SERVER/gavana/Folder/FileName.txt Colleague: //SERVER/Colleague/Folder/FileName.txt So, no matter what I do, the file name stored in the database is user- dependent and not universal and common to all of us. If that user dependent part happens t

Re: when should I explicitly close a file?

2010-04-23 Thread Alf P. Steinbach
* Adam Tauno Williams: On Fri, 2010-04-23 at 16:29 +1200, Lawrence D'Oliveiro wrote: In message , Chris Rebert wrote: On Wed, Apr 21, 2010 at 5:53 PM, Lawrence D'Oliveiro wrote: In message <4bc9aad...@dnews.tpgi.com.au>, Lie Ryan wrote: Since in python nothing is guaranteed about implicit fil

Re: when should I explicitly close a file?

2010-04-24 Thread Alf P. Steinbach
* Steven D'Aprano: On Fri, 23 Apr 2010 13:19:41 +0200, Alf P. Steinbach wrote: But for a literal context-free interpretation e.g. the 'sys.getrefcount' function is not documented as CPython only and thus an implementation that didn't do reference counting would not be

Re: [ANN] pyjamas 0.7 released

2010-04-25 Thread Alf P. Steinbach
* Luke Kenneth Casson Leighton: http://pyjs.org/examples/asteroids/public/Space.html An error has been encountered in accessing this page. 1. Server: pyjs.org 2. URL path: /examples/asteroids/public/examples/asteroids/public/bootstrap.js 3. Error notes: NONE 4. Error type: 404 5. Reques

Re: chr(i) ASCII under Python 3

2010-04-26 Thread Alf P. Steinbach
On 26.04.2010 22:12, * Dodo: Hi all, Under python 2.6, chr() "Return a string of one character whose ASCII code is the integer i." (quoted from docs.python.org) Under python 3.1, chr() "Return the string of one character whose Unicode codepoint is the integer i." I want to convert a ASCII code b

Re: chr(i) ASCII under Python 3

2010-04-26 Thread Alf P. Steinbach
On 26.04.2010 22:26, * Dodo: Le 26/04/2010 22:26, Alf P. Steinbach a écrit : On 26.04.2010 22:12, * Dodo: Hi all, Under python 2.6, chr() "Return a string of one character whose ASCII code is the integer i." (quoted from docs.python.org) Under python 3.1, chr() "Return th

Re: assigning multi-line strings to variables

2010-04-27 Thread Alf P. Steinbach
On 28.04.2010 07:11, * Sagar K: Use triple quote: d = """ this is a sample text which does not mean anything""" "goldtech" wrote in message news:4e25733e-eafa-477b-a84d-a64d139f7...@u34g2000yqu.googlegroups.com... On Apr 27, 7:31 pm, Brendan Abel<007bren...@gmail.com> wrote: On Apr 27, 7:20 p

Re: assigning multi-line strings to variables

2010-04-28 Thread Alf P. Steinbach
On 28.04.2010 18:54, * Lie Ryan: On 04/28/10 15:34, Alf P. Steinbach wrote: On 28.04.2010 07:11, * Sagar K: Use triple quote: d = """ this is a sample text which does not mean anything""" "goldtech" wrote in message news:4e25733e-eafa-477b-a84d-a

Re: function name

2010-04-28 Thread Alf P. Steinbach
* Richard Lamboj: is there any way to get the name from the actual called function, so that the function knows its own name? There was an earlier thread about this not very long ago. General consensus, as I recall, to replace function with an object of a class (possibly with __call__ method

Re: assigning multi-line strings to variables

2010-04-29 Thread Alf P. Steinbach
On 30.04.2010 01:29, * Carl Banks: On Apr 28, 11:16 am, "Alf P. Steinbach" wrote: On 28.04.2010 18:54, * Lie Ryan: Python have triple-quoted string when you want to include large amount of text; Yes, that's been mentioned umpteen times in this thread, including the *ver

Re: find integers in f.readline()

2010-04-29 Thread Alf P. Steinbach
On 30.04.2010 04:22, * elsa: Hi people, I'm having a problem getting the info I need out of a file. I've opened the file with f=open('myFile','r'). Next, I take out the first line with line=f.readline() line looks like this: '83927 300023_25_5_09_FL 9086 9134 F3LQ2BE01AQLXF 1 49 + 80 ZA8Z89H

Re: assigning multi-line strings to variables

2010-04-30 Thread Alf P. Steinbach
On 30.04.2010 12:51, * Lie Ryan: On 04/30/10 12:07, Alf P. Steinbach wrote: On 30.04.2010 01:29, * Carl Banks: On Apr 28, 11:16 am, "Alf P. Steinbach" wrote: On 28.04.2010 18:54, * Lie Ryan: Python have triple-quoted string when you want to include large amount of text; Y

Re: assigning multi-line strings to variables

2010-04-30 Thread Alf P. Steinbach
On 30.04.2010 19:31, * Lie Ryan: On 05/01/10 00:01, Alf P. Steinbach wrote: On 30.04.2010 12:51, * Lie Ryan: On 04/30/10 12:07, Alf P. Steinbach wrote: On 30.04.2010 01:29, * Carl Banks: On Apr 28, 11:16 am, "Alf P. Steinbach"wrote: On 28.04.2010 18:54, * Lie Ryan: Python h

Re: assigning multi-line strings to variables

2010-04-30 Thread Alf P. Steinbach
On 30.04.2010 21:46, * Lie Ryan: On 05/01/10 05:43, Lie Ryan wrote: On 05/01/10 03:56, Alf P. Steinbach wrote: Use triple-quoted, let them flow, done. I've never heard of any text editor in current use without text wrapping capability, even Notepad has it. And if I've got 5k

Re: assigning multi-line strings to variables

2010-04-30 Thread Alf P. Steinbach
On 30.04.2010 21:40, * Lie Ryan: On 05/01/10 04:08, Neil Cerutti wrote: On 2010-04-30, Lie Ryan wrote: Use triple-quoted, let them flow, done. I've never heard of any text editor in current use without text wrapping capability, even Notepad has it. And if I've got 5k of text in source code wi

Re: Python dot-equals (syntax proposal)

2010-05-01 Thread Alf P. Steinbach
On 01.05.2010 14:13, * Tim Chase: On 05/01/2010 12:08 AM, Patrick Maupin wrote: +=, -=, /=, *=, etc. conceptually (and, if lhs object supports in- place operator methods, actually) *modify* the lhs object. Your proposed .= syntax conceptually *replaces* the lhs object (actually, rebinds the lhs

Re: Python dot-equals (syntax proposal)

2010-05-01 Thread Alf P. Steinbach
On 02.05.2010 06:06, * Aahz: In article<4bdcd631$0$27782$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: On Sat, 01 May 2010 07:13:42 -0500, Tim Chase wrote: The += family of operators really do rebind the symbol, not modify the object. They potentially do both, depending on the object,

Re: Python dot-equals (syntax proposal)

2010-05-02 Thread Alf P. Steinbach
* Terry Reedy: * Alf P. Steinbach: * Aahz: and sometimes they rebind the original target to the same object. At the Python level that seems to be an undetectable null-operation. If you try t=(1,2,3); t[1]+=3, if very much matters that a rebind occurs. Testing: >&

Re: design question

2010-05-03 Thread Alf P. Steinbach
* Tim Arnold: This is a question about system design I guess. I have a django website that allows users to change/view configuration details for documentation builds. The database is very small. The reason I'm using a database in the first place is to make it easy for users to change the configur

Re: Teaching Programming

2010-05-04 Thread Martin P. Hellwig
On 05/04/10 11:28, superpollo wrote: Samuel Williams ha scritto: I personally like indentation. I just wonder whether it is an issue that some people will dislike. there might be problems if for example you generate code from a one-line template. Well a one-line template code generator are

Re: Teaching Programming

2010-05-05 Thread Martin P. Hellwig
On 05/04/10 12:59, superpollo wrote: Martin P. Hellwig ha scritto: For the corner cases (I can think of a couple) it is good to know you can use ';' most of the time. most but not always as i noted (think about loops or function definition) Well through in some exec magic

Re: Picking a license

2010-05-08 Thread Martin P. Hellwig
On 05/08/10 09:37, Steven D'Aprano wrote: If encouraging third parties to take open source code and lock it up behind proprietary, closed licences *isn't* a moral hazard, then I don't know what one is. I fail to see what is morally wrong with it. When I ,as the author, share my work to the pu

Re: Picking a license

2010-05-09 Thread Martin P. Hellwig
On 05/09/10 04:49, Paul Rubin wrote: As I read it, he is saying that when someone releases free software, they have "for all intends and purposes lost control over its use", so they "should have made peace with the fact" and surrender gracefully. I'm asking why he doesn't think Microsoft has los

Re: Picking a license

2010-05-09 Thread Martin P. Hellwig
On 05/09/10 18:24, Stephen Hansen wrote: Wait, what? Why shouldn't I profit repeatedly from the "same work already done"? *I* created, its *mine*. I put blood, sweat and tears into it and perhaps huge amounts of resources, risking financial security and sanity, and you're arguing I shouldn't

Re: Picking a license

2010-05-09 Thread Martin P. Hellwig
On 05/09/10 21:06, Stephen Hansen wrote: On Sun, May 9, 2010 at 12:33 PM, Martin P. Hellwig mailto:martin.hell...@dcuktec.org>> wrote: On 05/09/10 18:24, Stephen Hansen wrote: Wait, what? Why shouldn't I profit repeatedly from the "same work a

Re: Local variables persist across function calls

2010-05-15 Thread Alf P. Steinbach
On 15.05.2010 19:18, * Dave: I've been writing Python for a few years now, and tonight I ran into something that I didn't understand. I'm hoping someone can explain this to me. I'm writing a recursive function for generating dictionaries with keys that consist of all permutations of a certain set

250

2010-05-20 Thread Martin P. Hellwig
On 05/20/10 07:51, cosmeticsafrolatino wrote: hi 250 locahost.local Hello WimaxUser3645-219.wateen.net [110.36.45.219], pleased to meet you -- http://mail.python.org/mailman/listinfo/python-list

Re: where are the program that are written in python?

2010-05-21 Thread Martin P. Hellwig
On 05/21/10 11:21, Deep_Feelings wrote: python is not a new programming language ,it has been there for the last 15+ years or so ? right ? Yeah about the same as Java however by having a look at this page http://wiki.python.org/moin/Applications i could not see many programs written in py

Re: Chatroom

2010-05-24 Thread Martin P. Hellwig
On 05/24/10 19:50, narcissus wrote: Hello , I want to create a program that is one chatroom and everyone has this program can Enter into that chatroom. how can i do this? and i want gui for it too (GTK) What have you tried so far? -- mph -- http://mail.python.org/mailman/listinfo/python-list

Re: confusing error with nntplib

2010-05-27 Thread Alf P. Steinbach
* Eduardo Alvarez, on 27.05.2010 03:01: When trying to use nntplib to connect to the news server nntp.aioe.org, a bizarre sequence of events occurs: 1) I import the module, and create an instance, as follows: s = nntplib.NNTP('nntp.aioe.org') I get no errors, which leads me to believe all went

Re: confusing error with nntplib

2010-05-27 Thread Martin P. Hellwig
On 05/27/10 02:01, Eduardo Alvarez wrote: When trying to use nntplib to connect to the news server nntp.aioe.org, a bizarre sequence of events occurs: 1) I import the module, and create an instance, as follows: s = nntplib.NNTP('nntp.aioe.org') I get no errors, which leads me to believe all we

Re: if, continuation and indentation

2010-05-27 Thread Martin P. Hellwig
On 05/27/10 13:22, HH wrote: I have a question about best practices when it comes to line wrapping/ continuation and indentation, specifically in the case of an if statement. When I write an if statement with many conditions, I prefer to use a parenthesis around the whole block and get the impli

Re: multiprocessing and accessing server's stdout

2010-05-28 Thread Martin P. Hellwig
On 05/28/10 13:17, Adam Tauno Williams wrote: You should be able to point it any any file-like object. But, again, why? If you have the data in the process why send it to stdout and redirect it. Why not just send the data to the client directly? Well you might want to multiplex it to more

Re: multiprocessing and accessing server's stdout

2010-05-28 Thread Martin P. Hellwig
On 05/28/10 21:44, Adam Tauno Williams wrote: On Fri, 2010-05-28 at 15:41 +0100, Martin P. Hellwig wrote: On 05/28/10 13:17, Adam Tauno Williams wrote: You should be able to point it any any file-like object. But, again, why? If you have the data in the process why send it to stdout and

Re: tkinter function outout to text widget

2010-05-29 Thread Alf P. Steinbach
* Johan Lans, on 29.05.2010 22:51: Hi I'm totally new on python and I'm doing an assignement where I'm doing a class that manipulates a text. The program is also supposed to have a GUI, for which I have used tkinter. So far I have entry widgets for file names and buttons, its all working like I w

Re: GUI programs

2010-05-30 Thread Alf P. Steinbach
* jyoun...@kc.rr.com, on 30.05.2010 03:13: Just curious if anyone would be willing to share their thoughts about different Python GUI programming modules. I've been doing a bit of research and am trying to find something that: 1. Is portable. Would like to be able to send the module along wit

Re: Address of an immutable object

2010-05-30 Thread Alf P. Steinbach
* candide, on 30.05.2010 19:38: Suppose a Python program defines an integer object with value 42. The object has an "address" we can capture with the built-in function id() : >>> a=42 >>> id(a) 152263540 >>> Now I was wondering if any integer object with value 42 will be refered at the same

Re: Python Forum

2010-06-03 Thread Martin P. Hellwig
On 06/03/10 11:16, Pierre Quentel wrote: I'm not saying that pythonforum.org is the best solution but it certainly looks more attractive than c.l.p. to the new generation of Python users - Pierre On the other hand it might not be so bad that you don't get questions from users here who are un

Re: Python Forum

2010-06-03 Thread Martin P. Hellwig
On 06/03/10 12:46, Michele Simionato wrote: On Jun 3, 12:28 pm, "Martin P. Hellwig" wrote: On the other hand it might not be so bad that you don't get questions from users here who are unable to use a nntp reader or news to mail service. I am unable to use a nntp reader

Re: An empty object with dynamic attributes (expando)

2010-06-03 Thread Alf P. Steinbach
* dmtr, on 03.06.2010 23:00: How can I create an empty object with dynamic attributes? It should be something like: m = object() m.myattr = 1 But this doesn't work. And I have to resort to: class expando(object): pass m = expando() m.myattr = 1 Is there a one-liner that would do the thing

Re: one more exception newbie query

2010-06-04 Thread Alf P. Steinbach
* Payal, on 04.06.2010 12:10: Hi all, In http://docs.python.org/tutorial/errors.html#handling-exceptions it says, |>>> try: | ...raise Exception('spam', 'eggs') Why would I want to use a class for exception? I could simply use raise w/o it? Also the help() says, class Exception(BaseExcepti

Re: Python Forum

2010-06-04 Thread Alf P. Steinbach
* Andreas Waldenburger, on 04.06.2010 20:21: On Fri, 04 Jun 2010 00:57:15 +1000 Ben Finney wrote: Andreas Waldenburger writes: But consolidation is the *only* way to go, really. The parallelism between c.l.p. and python-list is great already. Now throw some sort of Forum in the mix This

Re: Python Forum

2010-06-04 Thread Alf P. Steinbach
* John Bokma, on 04.06.2010 20:19: Steven D'Aprano writes: But the really sad thing is that you think that "bigger" automatically equals "better". I don't think that was the point. Anyway, not everbody can pick a provider, there are plenty of places that have only one or maybe two. And if t

Re: An empty object with dynamic attributes (expando)

2010-06-04 Thread Alf P. Steinbach
* Terry Reedy, on 05.06.2010 03:01: On 6/4/2010 8:01 PM, dmtr wrote: Why does it have to be a one-liner? Is the Enter key on your keyboard broken? Nah. I was simply looking for something natural and intuitive, like: m = object(); m.a = 1; Usually python is pretty good providing these natural a

Re: Tkinter help - Why this behavior ? (py3)

2010-06-05 Thread Alf P. Steinbach
* Dodo, on 05.06.2010 15:46: Hi, let's consider this exemple : from tkinter import * from tkinter.ttk import * class First: def __init__(self): self.root = Tk() B = Button(self.root, command=self.op) B.pack() self.root.mainloop() def op(self): Second(self) print("print") class Second: def

Re: GUIs - A Modest Proposal

2010-06-06 Thread Alf P. Steinbach
* pyt...@bdurham.com, on 06.06.2010 17:17: Why not a GUI based on HTML, CSS and Javascript? To paraphrase another poster and to borrow from SQLite: Pick any *THREE*: - Simple - Beautiful - Cross-platform I'm not sure what this discussion is about, but anyway, modern GUI frameworks /are/ base

Re: Tkinter help - Why this behavior ? (py3)

2010-06-07 Thread Alf P. Steinbach
* Dodo, on 07.06.2010 12:38: Le 05/06/2010 19:07, Alf P. Steinbach a écrit : * Dodo, on 05.06.2010 15:46: Hi, let's consider this exemple : from tkinter import * from tkinter.ttk import * class First: def __init__(self): self.root = Tk() B = Button(self.root, command=self.op) B

Re: GUIs - A Modest Proposal

2010-06-07 Thread Martin P. Hellwig
On 06/06/10 03:22, ant wrote: I get the strong feeling that nobody is really happy with the state of Python GUIs. Tkinter is not widely liked, but is widely distributed. WxPython and PyGtk are both powerful, but quirky in different ways. PyQt is tied to one platform. And there are dozens more.

Re: GUIs - A Modest Proposal

2010-06-08 Thread Martin P. Hellwig
On 06/08/10 07:59, rantingrick wrote: On Jun 8, 1:39 am, "Martin P. Hellwig" wrote: On 06/06/10 03:22, ant wrote: I get the strong feeling that nobody is really happy with the state of Python GUIs. Tkinter is not widely liked, but is widely distributed. WxPython and PyGtk are bot

<    10   11   12   13   14   15   16   17   >