Can PyObjC be used on shared Mac OS X hosting?

2006-06-21 Thread weston
Does anyone have experience with (or failing that, theoretical knowledge about) installing using the PyObjC bridge on a Mac OS X machine in a context where one doesn't have root/admin access (and therefore can't install things in conventional locations)? Can such a thing be done? -- http://mail.

Re: wx.Yield() during socket timeout

2006-06-21 Thread Frank Millman
Kiran wrote: > Hello All, > I am creating a socket connection in order to read and write to a > location. My problem is,the gui becomes unresponsive if the socket > times out. > I know that a good solution is to have the socket read and write with > a thread. However, I have tried this and h

php vs python (operator comparison)-repost

2006-06-21 Thread brandon.mcginty
I’m sorry if this was already posted to the list; I’ve been having major e-mail problems lately.   Hi All,   I’ve already done a large amount of searching on Google to find out this information, but to no avale.   Does anyone here know of a list of operators in python and there counte

Weekly Python Patch/Bug Summary

2006-06-21 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 378 open ( +3) / 3298 closed (+34) / 3676 total (+37) Bugs: 886 open (-24) / 5926 closed (+75) / 6812 total (+51) RFE : 224 open ( +7) / 227 closed ( +7) / 451 total (+14) New / Reopened Patches __ Improve s

Mouse wheel event for Canvas

2006-06-21 Thread John McMonagle
I tried binding mouse wheel events (, ) to a Tkinter Canvas widget with the hope of using the event.delta value to subsequently scroll the Canvas. However, it seems that event.delta always returns 0. For example, from Tkinter import * r = Tk() c = Canvas(r, scrollregion=(0,0,500,500), height=20

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Chris Smith
Rob Warnock <[EMAIL PROTECTED]> wrote: > Another language which has *neither* latent ("dynamic") nor > manifest ("static") types is (was?) BLISS[1], in which, like > assembler, variables are "just" addresses[2], and values are > "just" a machine word of bits. I'm unsure that it's correct to descri

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Rob Warnock
Marshall <[EMAIL PROTECTED]> wrote: +--- | Anton van Straaten wrote: | > 3. A really natural term to refer to types which programmers reason | > about, even if they are not statically checked, is "latent types". It | > captures the situation very well intuitively, and it has plenty of

python + postgres psql + os.popen

2006-06-21 Thread damacy
hello, everyone. i am trying to write a program which executes SQL commands stored in .sql files. i wrote a function called psql() whose contents look like the following. ... os.popen(command) file = os.popen(command, 'w') file.write(password) file.close() ... where command looks like psql -h [

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Rob Warnock
Rob Thorpe <[EMAIL PROTECTED]> wrote: +--- | > So, will y'all just switch from using "dynamically typed" to "latently | > typed", and stop talking about any real programs in real programming | > languages as being "untyped" or "type-free", unless you really are | > talking about situati

Re: new python icons for windows

2006-06-21 Thread Istvan Albert
[EMAIL PROTECTED] wrote: > > For example it resembles the icon for text files. > > This is intentional: to make it obvious that .py files are the > readable, editable scripts, contrasting with .pyc's binary gunk - I think this is a mistake, it does not seem obious, all it does is just blends in

Re: dynamic inheritance

2006-06-21 Thread alf
Michele Simionato wrote: > alf wrote: > Python is ways cooler than C++. I switched to Python from C++ over year ago and do not see a way back. C++ just sucks at each corner. > This is a sensible use case where you may > want to change the base class at runtime: Thx for the example. A. -- htt

Re: What is a type error?

2006-06-21 Thread Chris Smith
David Hopwood <[EMAIL PROTECTED]> wrote: > Typical programming languages have many kinds of semantic error that can occur > at run-time: null references, array index out of bounds, assertion failures, > failed casts, "message not understood", ArrayStoreExceptions in Java, > arithmetic overflow, div

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Chris Smith
Marshall <[EMAIL PROTECTED]> wrote: > Well, it strikes me that some of what the dynamic camp likes > is the actual *absence* of declared types, or the necessity > of having them. At the very least, requiring types vs. not requiring > types is mutually exclusive. So you're saying, then, that while

Re: Standard Yes / No Windows Dialog box creation

2006-06-21 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > I found a way to create "Open File" or "Open Folder" windows dialog > boxes, but not to create an easier Yes / No dialog box... > Maybe someone has a solution for this? Maybe you would like EasyGui http://www.ferg.org/easygui/ Kent -- http://mail.python.org/mailman/lis

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Benjamin Franksen
Pascal Costanza wrote: > There is, of course, room for research on performing static type checks > in a running system, for example immediately after or before a software > update is applied, or maybe even on separate type checking on software > increments such that guarantees for their composition

Re: Iteration over recursion?

2006-06-21 Thread Tim Peters
[MTD <[EMAIL PROTECTED]>] > I've been testing my recursive function against your iterative > function, and yours is generally a quite steady 50% faster on > factorizing 2**n +/- 1 for 0 < n < 60. If you're still not skipping multiples of 3, that should account for most of it. > I think that, for

popen2 question

2006-06-21 Thread David Bear
I'm using popen2 and getting an extra 1 at the end of my output. I didn't see where this was explained in the docs so I clearly don't understand the behavior. My code is simple. (input, output) = os.popen2('whackyperlprogram') results = output.read() rc = output.close() print results The document

Python to PHP Login System (HTTP Post)

2006-06-21 Thread test
Hi everyone, I'm creating a desktop Python application that requires web-based authentication for accessing additional application features. HTTP GET is really simple. HTTP POST is not (at least for me anyway);) I have tried a few different sources, but I cannot get HTTP POST to successfully

The code that could not be...

2006-06-21 Thread Alex A. Naanou
Though Python is the language I use the most, there are several things that I still hate, mostly about the implementation (CPython)... The good thing is that some of these warts are now resolved, like the exec dict issue. Here is another one: The object's __dict__ can only be a dict derivative an

Re: OT: wxPython GUI designer

2006-06-21 Thread Don Taylor
Frithiof Andreas Jensen wrote: > Just gave is a spin yesterday: How does on fix the size of layout; I > can only manage to get sizers to distribute space evently amongst the > fields, which is *not* what I want. > Use spacers. Don. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python at compile - possible to add to PYTHONPATH

2006-06-21 Thread Avell Diroll
rh0dium wrote: (snip) > I want to add /foo/bar to the PYTHONPATH build so I don't have to add > it later on. Is there a way to do this? (snip) If i understand correctly, you want to add a directory to your PYTHONPATH for a specific script without modifying the system PYTHONPATH global variable

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread George Neuner
On 21 Jun 2006 15:04:23 -0700, "Greg Buchholz" <[EMAIL PROTECTED]> wrote: >I haven't been following this thread too closely, but I thought the >following article might be of interest... > >Eliminating Array Bound Checking through Non-dependent types. >http://okmij.org/ftp/Haskell/types.html#br

Re: Python at compile - possible to add to PYTHONPATH

2006-06-21 Thread Serge Orlov
On 21 Jun 2006 15:54:56 -0700, rh0dium <[EMAIL PROTECTED]> wrote: > Hi all, > > Can anyone help me out. I would like to have python automatically look > in a path for modules similar to editing the PYTHONPATH but do it at > compile time so every user doesn't have to do this.. > > Soo... > > I want

Re: returning index of minimum in a list of lists

2006-06-21 Thread bearophileHUGS
This way is probably slowe (two scans of the list for l1, and even more work for l2), but for small lists it's probably simple enough to be considered: For a simple list: >>> l1 = [5, 3, 2, 1, 4] >>> l1.index(min(l1)) 3 For a list of lists: >>> l2 = [[3, 3, 3, 3], [6], [10], [3, 3, 3, 1, 4], [3,

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread David Hopwood
Marshall wrote: > Chris Smith wrote: >>Marshall <[EMAIL PROTECTED]> wrote: >> >>>I think what this highlights is the fact that our existing terminology >>>is not up to the task of representing all the possible design >>>choices we could make. Some parts of dynamic vs. static >>>a mutually exclusive

Re: OS specific command in Python

2006-06-21 Thread 3c273
"Avell Diroll" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 3c273 wrote: > > I was just trying to learn how to use .communicate() and all of the examples > > I see have [0] after .communicate(). What is the significance of the [0]? > > > From the Python Library Reference > (http:/

source reduction using Python

2006-06-21 Thread beliavsky
Intel has introduced something called CESR, written in Python, to aid C, C++, and Fortran programmers in reducing the sizes of programs included in bug reports. Here is a brief description from http://cache-www.intel.com/cd/00/00/21/93/219320_relnotes_10.pdf : "Compiler Error Source Reducer (CESR)

Question regarding commit/backout of a message using the pymqi module

2006-06-21 Thread Andrew Robert
Hi everyone, Could someone help explain what I am doing wrong in this code block? This code block is an excerpt from a larger file that receives transmitted files via IBM WebSphere MQSeries an drops it to the local file system. Transmission of the file works as designed but it has a flaw. If th

Python at compile - possible to add to PYTHONPATH

2006-06-21 Thread rh0dium
Hi all, Can anyone help me out. I would like to have python automatically look in a path for modules similar to editing the PYTHONPATH but do it at compile time so every user doesn't have to do this.. Soo... I want to add /foo/bar to the PYTHONPATH build so I don't have to add it later on. Is

Re: Is it possible to split a class definition?

2006-06-21 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Hi, > > Is it possible to split a Class definition over two or more text files? > (if so, how:) Not in that sense. But if you must, you can use several classes and then a resulting class that inherits from all of these. Diez -- http://mail.python.org/mailman/listi

Re: random.jumpahead: How to jump ahead exactly N steps?

2006-06-21 Thread Ben Cartwright
Matthew Wilson wrote: > The random.jumpahead documentation says this: > > Changed in version 2.3: Instead of jumping to a specific state, n steps > ahead, jumpahead(n) jumps to another state likely to be separated by > many steps.. This change was necessary because the random module go

Re: tkMessagebox.askyesno always returns False

2006-06-21 Thread James Stroud
peter wrote: > I have a weird problem in some code I am writing. The user selects a > number of files from a list and then can select an option which will > rename the selected files. Before the process starts, a yes/no dialog > box pops up just to confirm. > > Most of the time this works fine,

ANN: Axon 1.5.0 RELEASED!

2006-06-21 Thread Michael
Hi! I'm extremely pleased to say - Axon 1.5.0 has been released! Axon is Kamaelia's core concurrency system, largely based around python generators to enable components to be built following a slightly updated paraphrasing of Unix Philosophy: """Write components that do one thing and do it wel

Kamaelia 0.4.0 RELEASED - Faster! More Tools! More Examples! More Docs! ; -)

2006-06-21 Thread Michael
Hi! (OK, slightly silly subject line :) I'm extremely pleased to say - Kamaelia 0.4.0 has been released! What's New & Changed? = Kamaelia 0.4.0 is a consolidation, documentation and optimisation enhanced release. Whilst there are a wide variety of new components, existing f

Re: random.jumpahead: How to jump ahead exactly N steps?

2006-06-21 Thread Tim Peters
[Matthew Wilson] > The random.jumpahead documentation says this: > > Changed in version 2.3: Instead of jumping to a specific state, n steps > ahead, jumpahead(n) jumps to another state likely to be separated by > many steps.. > > I really want a way to get to the Nth value in a random

SendKeys for mac?

2006-06-21 Thread nate
does anyone know if there is a way to inject keyboard events to a mac similar to the way SendKeys works for a windows machine? (Can you point me at it?) thanks, n -- http://mail.python.org/mailman/listinfo/python-list

ANN (Screencast): Using python at WebFaction

2006-06-21 Thread remi
Hello everyone, WebFaction (formerly Python-Hosting.com) have just released a screencast demo of their control panel. The 6 minute demo shows how you can setup some sites in a few clicks, using a variety of applications (including some Python ones such as Django and TurboGears). The one-click in

Re: Is it possible to split a class definition?

2006-06-21 Thread Lawrence Oluyede
<[EMAIL PROTECTED]> wrote: > Is it possible to split a Class definition over two or more text files? > (if so, how:) There's no partial types like in .NET 2.0 but since Python is dynamic you can add members at runtime :-) -- Lawrence - http://www.oluyede.org/blog "Nothing is more dangerous than

Is it possible to split a class definition?

2006-06-21 Thread jerry . levan
Hi, Is it possible to split a Class definition over two or more text files? (if so, how:) Jerry -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Chris F Clark
Chris F Clark schrieb: > In that sense, a static type system is eliminating tags, because the > information is pre-computed and not explicitly stored as a part of the > computation. Now, you may not view the tag as being there, but in my > mind if there exists a way of perfoming the computation th

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Greg Buchholz
George Neuner wrote: > You can't totally prevent it ... if the index computation involves > types having a wider range, frequently the solution is to compute a > wide index value and then narrow it. But if the wider value is out of > range for the narrow type you have a problem. > ...snip... > > T

Re: returning index of minimum in a list of lists

2006-06-21 Thread Bas
[EMAIL PROTECTED] wrote: > Thanks so much for your help. I was wondering if there was anything > even simpler, but this will be great. >>> from numpy import * >>> a=array([[3,3,3,3], [3,3,3,1], [3,3,3,3]]) >>> where(a==a.min()) (array([1]), array([3])) Probably overkill for your simple problem,

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread David Hopwood
Rob Thorpe wrote: > Vesa Karvonen wrote: > >>In comp.lang.functional Anton van Straaten <[EMAIL PROTECTED]> wrote: >> >>>Let me add another complex subtlety, then: the above description misses >>>an important point, which is that *automated* type checking is not the >>>whole story. I.e. that comp

Re: OS specific command in Python

2006-06-21 Thread Avell Diroll
[EMAIL PROTECTED] wrote: (snip) > I have a linux box, from where I remotely execute all the commands. The > remote machine is windows machine. I installed an OpenSSH server for > windows to send the shutdown command. I setup the public keys in such a > way that I could login to SSH server without u

random.jumpahead: How to jump ahead exactly N steps?

2006-06-21 Thread Matthew Wilson
The random.jumpahead documentation says this: Changed in version 2.3: Instead of jumping to a specific state, n steps ahead, jumpahead(n) jumps to another state likely to be separated by many steps.. I really want a way to get to the Nth value in a random series started with a particu

wx.Yield() during socket timeout

2006-06-21 Thread Kiran
Hello All, I am creating a socket connection in order to read and write to a location. My problem is,the gui becomes unresponsive if the socket times out. I know that a good solution is to have the socket read and write with a thread. However, I have tried this and have a problem where ONLY o

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread George Neuner
On Wed, 21 Jun 2006 16:12:48 + (UTC), Dimitri Maziuk <[EMAIL PROTECTED]> wrote: >George Neuner sez: >> On Mon, 19 Jun 2006 22:02:55 + (UTC), Dimitri Maziuk >><[EMAIL PROTECTED]> wrote: >> >>>Yet Another Dan sez: >>> >>>... Requiring an array index to be an integer is considered a typing >

tkMessagebox.askyesno always returns False

2006-06-21 Thread peter
I have a weird problem in some code I am writing. The user selects a number of files from a list and then can select an option which will rename the selected files. Before the process starts, a yes/no dialog box pops up just to confirm. Most of the time this works fine, but occasionally it seem

Re: OS specific command in Python

2006-06-21 Thread Avell Diroll
3c273 wrote: > I was just trying to learn how to use .communicate() and all of the examples > I see have [0] after .communicate(). What is the significance of the [0]? From the Python Library Reference (http://docs.python.org/lib/node239.html), you learn that the method communicate() from the

Re: Update on Memory problem with NumPy arrays

2006-06-21 Thread sonjaa
I've been in contact with Travis O, and he said it was fixed in the SVN. thanks for the suggestions, I'll try them out now. best Sonja Filip Wasilewski wrote: > sonjaa wrote: > > Hi > > > > last week I posted a problem with running out of memory when changing > > values in NumPy arrays. Since th

Re: OS specific command in Python

2006-06-21 Thread Avell Diroll
[EMAIL PROTECTED] wrote: > I have a question on getpass. Since I am a newbie you might find it a > little dumb. > > By using the getpass, are u trying to retrieve the username and > password of remote mahcine or local ? > the module getpass contains 2 functions, getuser() and getpass() : getuse

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Marshall
Chris Smith wrote: > Marshall <[EMAIL PROTECTED]> wrote: > > I think what this highlights is the fact that our existing terminology > > is not up to the task of representing all the possible design > > choices we could make. Some parts of dynamic vs. static > > a mutually exclusive; some parts are

Re: Update on Memory problem with NumPy arrays

2006-06-21 Thread Filip Wasilewski
sonjaa wrote: > Hi > > last week I posted a problem with running out of memory when changing > values in NumPy arrays. Since then I have tried many different > approaches and > work-arounds but to no avail. [...] Based on the numpy-discussion this seems to be fixed in the SVN now(?). Anyway, you

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Marshall
Matthias Blume wrote: > "Marshall" <[EMAIL PROTECTED]> writes: > > > Torben Ægidius Mogensen wrote: > >> > >> That's not true. ML has variables in the mathematical sense of > >> variables -- symbols that can be associated with different values at > >> different times. What it doesn't have is muta

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Marshall
Dr.Ruud wrote: > Marshall schreef: > > > "dynamic types." I don't have a firm definition for > > that term, but my working model is runtime type tags. In which > > case, I would say that among statically typed languages, > > Java does have dynamic types, but C does not. C++ is > > somewhere in the

Re: Update on Memory problem with NumPy arrays

2006-06-21 Thread Fredrik Lundh
sonjaa wrote: > Also, are there other python methods/extensions that can create > multi-deminsional arrays? if this example is typical for the code you're writing, you might as well use nested Python lists: def make_array(width, height, value): out = [] for y in range(hei

Re: Porting python to a TI Processor (C64xx)

2006-06-21 Thread Serge Orlov
On 6/21/06, Roland Geibel <[EMAIL PROTECTED]> wrote: Dear all.We want to make python run on DSP processors (C64xx family of TI).I don't know what C64xx is, but I believe python needs general purpose CPU to run I've already tried to ask [EMAIL PROTECTED] (about his "Python forarm-Linux"),but didn't

What is a type error?

2006-06-21 Thread David Hopwood
Chris Uppal wrote: > David Hopwood wrote: > >> When people talk about "types" being associated with values in a "latently >> typed" >> or "dynamically typed" language, they really mean *tag*, not type. > > I don't think that's true. Maybe /some/ people do confuse the two, but I am > certainly a

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Marshall
Andreas Rossberg wrote: > Chris Uppal wrote: > > > > I have never been very happy with relating type to sets of values (objects, > > whatever). > > Indeed, this view is much too narrow. In particular, it cannot explain > abstract types, which is *the* central aspect of decent type systems. What pr

Re: Update on Memory problem with NumPy arrays

2006-06-21 Thread Robert Kern
sonjaa wrote: > Hi > > last week I posted a problem with running out of memory when changing > values in NumPy arrays. Since then I have tried many different > approaches and > work-arounds but to no avail. > > I was able to reduce the code (see below) to its smallest size and > still > have the

Help with deprecation-wrapper code

2006-06-21 Thread David Hirschfield
I have a deprecation-wrapper that allows me to do this: def oldFunc(x,y): ... def newFunc(x,y): ... oldFunc = deprecated(oldFunc, newFunc) It basically wraps the definition of "oldFunc" with a DeprecationWarning and some extra messages for code maintainers, and also prompts them t

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Joe Marshall
Marshall wrote: > > That's really coming home to me in this thread: the terminology is *so* > bad. I have noticed this previously in the differences between > structural > and nominal typing; many typing issues associated with this distinction > are falsely labeled as a static-vs-dynamic issues, s

Re: Initializing a set from a list

2006-06-21 Thread Robert Kern
Xiaolei wrote: > Sybren Stuvel wrote: > >>Xiaolei enlightened us with: >> >>>from pylab import * >> >>You'd better not do that. Just use "import pylab". >> >>>If I remove the first line, I correctly get: >>> >>>[1, 2, 3, 3] >>> >>>set([1, 2, 3]) >> >>Pylab shadows the built-in set name, which is o

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Chris Smith
Marshall <[EMAIL PROTECTED]> wrote: > I think what this highlights is the fact that our existing terminology > is not up to the task of representing all the possible design > choices we could make. Some parts of dynamic vs. static > a mutually exclusive; some parts are orthogonal. Really? I can s

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Chris Smith
Joachim Durchholz <[EMAIL PROTECTED]> wrote: > Assume a language that > a) defines that a program is "type-correct" iff HM inference establishes > that there are no type errors > b) compiles a type-incorrect program anyway, with an establishes > rigorous semantics for such programs (e.g. by throw

Vancouver Python Conference: T-Shirt design contest

2006-06-21 Thread Brian Quinlan
The Vancouver Python Workshop organizers are having problems coming up with text for our T-Shirts (don't worry: we already have the graphics figured out). We want something that matches Python's simplicity and elegance. So we're asking for your help. If you submit the text that we end up using

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Dr.Ruud
Rob Thorpe schreef: > Dr.Ruud: >> Marshall: >>> "dynamic types." I don't have a firm definition for >>> that term, but my working model is runtime type tags. In which >>> case, I would say that among statically typed languages, >>> Java does have dynamic types, but C does not. C++ is >>> somewhere

Re: How to override the doc of an object instance.

2006-06-21 Thread David Huard
It works ! Wow. Thanks a lot. If you don't mind, I'll post your code to the ipython list so it can be reused. David -- http://mail.python.org/mailman/listinfo/python-list

Re: Iterating a list in reverse ?

2006-06-21 Thread Andy Dingley <[EMAIL PROTECTED]>
Fredrik Lundh wrote: > for item in reversed(listOfThings): Thanks! I was staring so hard at reverse() that I'd completely missed reversed() I think I prefer this to listOfThings[::-1]: as it's a little more readable. Not that I'm reacting to past bad experience of Perl, you understand 8-) --

Re: How to truncate/round-off decimal numbers?

2006-06-21 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, Scott David Daniels <[EMAIL PROTECTED]> writes: |> Nick Maclaren wrote: (of fixed point) |> > I am (just) old enough to remember when it was used for |> > numeric work, and to have used it for that myself, but not old enough |> > to have done any numeric work

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Darren New
Andreas Rossberg wrote: > AFAICT, ADT describes a type whose values can only be accessed by a > certain fixed set of operations. No. AFAIU, an ADT defines the type based on the operations. The stack holding the integers 1 and 2 is the value (push(2, push(1, empty(. There's no "internal" re

Re: How to truncate/round-off decimal numbers?

2006-06-21 Thread Scott David Daniels
Nick Maclaren wrote: (of fixed point) > I am (just) old enough to remember when it was used for > numeric work, and to have used it for that myself, but not old enough > to have done any numeric work using fixed-point hardware. You are using fixed point hardware today. Fixed point tracked t

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Andreas Rossberg
Darren New wrote: > >> Maybe I don't understand what you mean with ADT here, but all >> languages with a decent module system support ADTs in the sense it is >> usually understood, see ML for a primary example. > > OK. Maybe some things like ML and Haskell and such that I'm not > intimately f

Re: help() on stdout.closed

2006-06-21 Thread Nick Craig-Wood
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, Pekka Karjalainen wrote: > > > Suppose I had no idea what sys.stdout.closed was and wanted to find out. > > Where would I look it up? > > `sys.stdout` is a file (like) object: > > http://docs.python.org/lib/bltin-f

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Rob Thorpe
Dr.Ruud wrote: > Marshall schreef: > > > "dynamic types." I don't have a firm definition for > > that term, but my working model is runtime type tags. In which > > case, I would say that among statically typed languages, > > Java does have dynamic types, but C does not. C++ is > > somewhere in the

Re: Iterating a list in reverse ?

2006-06-21 Thread Luis M. González
Andy Dingley <[EMAIL PROTECTED]> wrote: > Python newbie: I've got this simple task working (in about ten > different ways), but I'm looking for the "favoured" and "most Python > like" way. > > Forwards I can do this > for t in listOfThings: > print t > > Now how do I do it in reverse? In pa

Re: How to override the doc of an object instance.

2006-06-21 Thread Maric Michaud
Le Mercredi 21 Juin 2006 17:00, Paul McGuire a écrit : > No need to, just assign your special docstrings to w.x.__doc__, and print > w.x.__doc__.  Instances that have special docstrings will print their > instance-specific versions; instances without instance-specific docstrings > will print the cl

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread David Hopwood
Marshall wrote: > Torben Ægidius Mogensen wrote: > >>That's not true. ML has variables in the mathematical sense of >>variables -- symbols that can be associated with different values at >>different times. What it doesn't have is mutable variables (though it >>can get the effect of those by havi

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Darren New
Andreas Rossberg wrote: > Maybe I don't understand what you mean with ADT here, but all languages > with a decent module system support ADTs in the sense it is usually > understood, see ML for a primary example. OK. Maybe some things like ML and Haskell and such that I'm not intimately familia

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Darren New
Matthias Blume wrote: > There are *tons* of languages that "actually" facilitate abstract data > types, and some of these languages are actually used by real people. I don't know of any others in actual use. Could you name a couple? Note that I don't consider things like usual OO languages (Eiffe

Re: [newbie] Iterating a list in reverse ?

2006-06-21 Thread Fredrik Lundh
Andy Dingley <[EMAIL PROTECTED]> wrote: > Python newbie: I've got this simple task working (in about ten > different ways), but I'm looking for the "favoured" and "most Python > like" way. > > Forwards I can do this > for t in listOfThings: > print t > > Now how do I do it in reverse? In

Re: [newbie] Iterating a list in reverse ?

2006-06-21 Thread Tim Chase
> Python newbie: I've got this simple task working (in about ten > different ways), but I'm looking for the "favoured" and "most Python > like" way. > > Forwards I can do this > for t in listOfThings: > print t > > Now how do I do it in reverse? Then general process would be to use the r

Re: How to override the doc of an object instance.

2006-06-21 Thread Bruno Desthuilliers
David Huard wrote: (snip) > Has this problem come up before ? > It seems that with the new classes, this > kind of wish will generalize, AFAIK, there's no (and never have been) docstrings for non-callable attributes of a class or module. And properties are non-callable attributes. > or is it a b

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Andreas Rossberg
Vesa Karvonen wrote: > >>>Indeed, the ability to declare a new type that has the exact same >>>underlying representation and isomorphically identical operations but >>>not be the same type is something I find myself often missing in >>>languages. It's nice to be able to say "this integer repres

Re: need all python dialog equivalent

2006-06-21 Thread Eric S. Johansson
Fredrik Lundh wrote: > Eric S. Johansson wrote: > http://excess.org/urwid/ ? I just found that about an hour ago. the demos work on the target system so I'm comfortable enough to go down that path. thank you all. ---eric -- http://mail.python.org/mailman/listinfo/python-list

[newbie] Iterating a list in reverse ?

2006-06-21 Thread Andy Dingley <[EMAIL PROTECTED]>
Python newbie: I've got this simple task working (in about ten different ways), but I'm looking for the "favoured" and "most Python like" way. Forwards I can do this for t in listOfThings: print t Now how do I do it in reverse? In particular, how might I do it if I only wanted to iterate p

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Rob Thorpe
Vesa Karvonen wrote: > In comp.lang.functional Anton van Straaten <[EMAIL PROTECTED]> wrote: > > Let me add another complex subtlety, then: the above description misses > > an important point, which is that *automated* type checking is not the > > whole story. I.e. that compile time/runtime distin

Re: returning index of minimum in a list of lists

2006-06-21 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: >> Is there a simple python function to return the list index of the >> minimum entry in a list of lists? >> ie, for [[3,3,3,3], [3,3,3,1], [3,3,3,3]] to return 2,4. >> Or, same question but just for a list of numbers, not a list of lists. > >

Re: returning index of minimum in a list of lists

2006-06-21 Thread jwelby
def minIndexFinder(seq): mins = [] listIndex = 0 result = [] for item in seq: mins.append([listIndex,min(item),item.index(min(item))]) listIndex += 1 lowest = min([x[1] for x in mins]) for item in mins:

Update on Memory problem with NumPy arrays

2006-06-21 Thread sonjaa
Hi last week I posted a problem with running out of memory when changing values in NumPy arrays. Since then I have tried many different approaches and work-arounds but to no avail. I was able to reduce the code (see below) to its smallest size and still have the problem, albeit at a slower rate.

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Vesa Karvonen
In comp.lang.functional Andreas Rossberg <[EMAIL PROTECTED]> wrote: > Darren New wrote: [...] > > Indeed, the ability to declare a new type that has the exact same > > underlying representation and isomorphically identical operations but > > not be the same type is something I find myself often m

Re: memory error with zipfile module

2006-06-21 Thread Fredrik Lundh
Hari Sekhon wrote: > I've seen people using everything from zip to touch, either out of > laziness or out of the fact it wouldn't work very well in python, this > zip case is a good example. so based on a limitation in one library, and some random code you've seen on the internet, you're makin

Re: OS specific command in Python

2006-06-21 Thread 3c273
"Avell Diroll" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > ##Python Script : > from subprocess import Popen > p1 = Popen(["dmesg"], stdout=PIPE) > p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE) > output = p2.communicate()[0] I was just trying to learn how to use .commu

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Andreas Rossberg
Darren New wrote: > > As far as I know, LOTOS is the only > language that *actually* uses abstract data types Maybe I don't understand what you mean with ADT here, but all languages with a decent module system support ADTs in the sense it is usually understood, see ML for a primary example. Cl

Re: How to override the doc of an object instance.

2006-06-21 Thread David Huard
On Wed, 21 Jun 2006 17:15:16 +0200, Maric Michaud wrote: > > In [53]: class a(object) : >: x=property(lambda s: 0, doc='my doc string') >: >: > > In [54]: b=a() > > In [55]: help(b) I agree it works, but for a class with tens of attributes, this is not very practical

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Rob Thorpe
Rob Thorpe wrote: > Chris Smith wrote: > > Torben Ægidius Mogensen <[EMAIL PROTECTED]> wrote: > > > That's not really the difference between static and dynamic typing. > > > Static typing means that there exist a typing at compile-time that > > > guarantess against run-time type violations. Dynami

Porting python to a TI Processor (C64xx)

2006-06-21 Thread Roland Geibel
Dear all. We want to make python run on DSP processors (C64xx family of TI). I've already tried to ask [EMAIL PROTECTED] (about his "Python for arm-Linux"), but didn't get an answer so far. Neither could I find it in the Python tree at sourceforge. Any hints welcome Roland Geibel [EMAIL PROT

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Dimitri Maziuk
George Neuner sez: > On Mon, 19 Jun 2006 22:02:55 + (UTC), Dimitri Maziuk ><[EMAIL PROTECTED]> wrote: > >>Yet Another Dan sez: >> >>... Requiring an array index to be an integer is considered a typing >>> problem because it can be checked based on only the variable itself, >>> whereas checkin

Re: returning index of minimum in a list of lists

2006-06-21 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Is there a simple python function to return the list index of the > minimum entry in a list of lists? > ie, for [[3,3,3,3], [3,3,3,1], [3,3,3,3]] to return 2,4. > Or, same question but just for a list of numbers, not a list of lists. In Python 2.5: Python 2.5a2 (trun

Re: 'module' object has no attribute 'ssl'

2006-06-21 Thread Daniel Dittmar
Niurka Perez wrote: > ssl = socket.ssl(sock, self.key_file, > self.cert_file) > AttributeError: 'module' object has no attribute 'ssl' The socket module failed to import the _ssl module. And the ssl function gets only defined if _ssl could be imported. You probably haven't installed the Open

  1   2   3   >