Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Pascal Bourguignon
"Marshall" <[EMAIL PROTECTED]> writes: > Pascal Costanza wrote: >> >> Consider a simple expression like 'a + b': In a dynamically typed >> language, all I need to have in mind is that the program will attempt to >> add two numbers. In a statically typed language, I additionally need to >> know tha

Re: better Python IDE? Mimics Maya's script editor?

2006-06-22 Thread Ten
On Friday 09 June 2006 00:40, warpcat wrote: > I've been scripting in Maya, via mel for years now. Recently learning > to Python, love it. Thing that's driving me nuts it the IDE. I'm > using PythonWin right now and trying to find something better, mainly > with this functionality: > > In Maya's

Confused by subclassing, threading and scopes...

2006-06-22 Thread ph0b0s
I'm working on a program that needs a progress bar... I have a gtk class, with a subclass in it that takes care of the progress bar, but i seem to have a problem  with the variable scope... The program converts a complete directory of mp3's uing LAME, so it first counts how many files  need

Re: The code that could not be...

2006-06-22 Thread Alex A. Naanou
Fredrik Lundh wrote: > Alex A. Naanou wrote: > > > To mention several tasks that can be made trivial using this technique > > are, for instance zope-like acquisitions, various ACLs, interfaces and > > other namespace manipulation patterns. > > eh ? why not use Python's OO mechanisms for this, lik

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Pascal Bourguignon
Matthias Blume <[EMAIL PROTECTED]> writes: > Pascal Bourguignon <[EMAIL PROTECTED]> writes: > >> Matthias Blume <[EMAIL PROTECTED]> writes: >> >>> Pascal Bourguignon <[EMAIL PROTECTED]> writes: >>> Moreover, a good proportion of the program and a good number of algorithms don't even need

Re: The code that could not be...

2006-06-22 Thread Alex A. Naanou
Steven Bethard wrote: > Alex A. Naanou wrote: > > The object's __dict__ can only be a dict derivative and at that none of > > the Python's mapping API will be used (the dict is accessed directly). > [snip] > > I wrote a patch some time back, it appears rather stable and is being > > production tes

Standard names for common keyboard events

2006-06-22 Thread [EMAIL PROTECTED]
Hello, I thought that I should ask here for comments on a blog entry that I wrote some weeks ago. I am sure that other people have been thinking about this, but I didn't yet find them. The Python standard library unfortunately doesn't provide a module that gives unique names to common keyboard ev

Re: better Python IDE? Mimics Maya's script editor?

2006-06-22 Thread Christian Convey
Ten wrote: > If you get into emacs, it's worth the time invested. The learning curve's > alleged to be steep, but it isn't that bad, I use it and I'm as dumb as a > stump. It's a very good IDE for everyday use. :-) Not to get into the classic emacs/vi/etc. argument, but from my experience emac

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Joe Marshall
Chris Smith wrote: > 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 fo

Re: How to generate all permutations of a string?

2006-06-22 Thread James Stroud
Girish Sahani wrote: >>In article <[EMAIL PROTECTED]>, >> "Girish Sahani" <[EMAIL PROTECTED]> wrote: >> >> >>> I want to generate all permutations of a string. >> >>def permute(Seq) : >>"""generator which yields successive permutations of the elements >>of Seq.""" >>if len(Seq) == 0 : >

Re: Absolute noob to Linux programming needs language choice help

2006-06-22 Thread Mirco Wahab
Thus spoke [EMAIL PROTECTED] (on 2006-06-21 03:51): > I want to learn a language that I can use in my networking duties that > is most likely to be of use to me. I have a few choices I can think of > being: > > Python > Perl > C C is not really a choice in the perimeter of Perl and Python. Perl

Numeric N-dimensional array initialization

2006-06-22 Thread TG
Hi there ! I'm just starting to use Numeric here, and I'm wondering : how can I efficiently initialize every values of a N-dimensional array, given I don't know the number of dimensions ? I'm looking for something like a map function, or a way to conveniently iterate through the whole N-array, bu

Re: Numeric N-dimensional array initialization

2006-06-22 Thread TG
I tried to use Numeric.fromfunction, but there seems to be a problem : the function called must have the right number of args (hint : the number of dimensions, which I don't know). So i tried to use a function like : def myfunc(*args, **kw): return 0 and then i get : >> Numeric.fromfunctio

Re: Numeric N-dimensional array initialization

2006-06-22 Thread Robert Kern
TG wrote: > Hi there ! > > I'm just starting to use Numeric here, and I'm wondering : how can I > efficiently initialize every values of a N-dimensional array, given I > don't know the number of dimensions ? > > I'm looking for something like a map function, or a way to conveniently > iterate thr

win32com and name of com

2006-06-22 Thread bli
hi all first post. I am using python to connect to dll. I have read everything I can find on [EMAIL PROTECTED] and tried all variations of the name of the dll to use in the Dispatch. I get a com error-(-2147...1005, 'Invalid class string',None,None) Do I add .Application to the name? (eg ' Cont

Re: What is a type error?

2006-06-22 Thread Chris Smith
Chris Uppal <[EMAIL PROTECTED]> wrote: > I think we're agreed (you and I anyway, if not everyone in this thread) that > we > don't want to talk of "the" type system for a given language. We want to > allow > a variety of verification logics. So a static type system is a logic which > can > be

Re: Numeric N-dimensional array initialization

2006-06-22 Thread Robert Kern
TG wrote: > I tried to use Numeric.fromfunction, but there seems to be a problem : > > the function called must have the right number of args (hint : the > number of dimensions, which I don't know). So i tried to use a function > like : > > def myfunc(*args, **kw): > return 0 > > and then i

Network Programming in Python

2006-06-22 Thread diffuser78
I am a newbie in python. I want to learn and implement a small networking concept. Please help me. Every help is appreciated. I have one Linux Box and one Windows PC. I want to have a daemon running on Windows PC which listens on some specicif port number. I want to send a TCP/IP or UDP/IP packet

Re: Network Programming in Python

2006-06-22 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I am a newbie in python. I want to learn and implement a small > networking concept. Please help me. Every help is appreciated. > > I have one Linux Box and one Windows PC. I want to have a daemon > running on Windows PC which listens on some specicif port number. I > w

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Chris F Clark
Pascal Costanza wrote: > Consider a simple expression like 'a + b': In a dynamically typed > language, all I need to have in mind is that the program will attempt to > add two numbers. In a statically typed language, I additionally need to > know that there must a guarantee that a and b will always

Re: Network Programming in Python

2006-06-22 Thread Jean-Paul Calderone
On 22 Jun 2006 12:02:14 -0700, [EMAIL PROTECTED] wrote: >I am a newbie in python. I want to learn and implement a small >networking concept. Please help me. Every help is appreciated. > >I have one Linux Box and one Windows PC. I want to have a daemon >running on Windows PC which listens on some sp

Re: Network Programming in Python

2006-06-22 Thread diffuser78
Thanks...I will read that up...could you give me some more headstart or if you any sample code which I can study. Thanks for your help, every help is appreciated Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > I am a newbie in python. I want to learn and implement a small > > networking co

Re: Help req: Problems with MySQLdb

2006-06-22 Thread timw.google
Do you have a MySQL acccount set up on the localhost? I usually create two users with the same privs. One for the localhost where the server is, another to connect from somewhere else. Something like mysql> grant usage on *.* to 'user'@'localhost' identitfied by 'some_pass'; mysql> grant usage on

Re: Numeric N-dimensional array initialization

2006-06-22 Thread TG
Thanks for your precious advices. The flat iterator is definitely what i need. -- http://mail.python.org/mailman/listinfo/python-list

Re: Network Programming in Python

2006-06-22 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > I am a newbie in python. I want to learn and implement a small > networking concept. Please help me. Every help is appreciated. (hums the Batman Theme song replacing the words Batman with Google)... http://www.amk.ca/python/howto/sockets/ http://www.devshed.com/c/a/Pyth

Re: Network Programming in Python

2006-06-22 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Thanks...I will read that up...could you give me some more headstart or > if you any sample code which I can study. both chapters I pointed you to contain examples. -- http://mail.python.org/mailman/listinfo/python-list

Quick Question

2006-06-22 Thread xkenneth
I want to be able to cycle through an array and print something in hexadecimal. Such as this thisArray = ["AF","0F","5F"] for x in range(len(thisArray)): print "\x" + thisArray[x] However python chokes on the escaped identifier, how can I get around this? Thanks! Regards, Ken -- http

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Joachim Durchholz
Marshall schrieb: > immutable = can't change > vary-able = can change > > Clearly a contradiction in terms. Not in mathematics. The understanding there is that a "variable" varies - not over time, but according to the whim of the usage. (E.g. if a function is displayed in a graph, the parameter

Re: Quick Question

2006-06-22 Thread Bruno Desthuilliers
xkenneth a écrit : > I want to be able to cycle through an array and print something in > hexadecimal. Such as this > thisArray = ["AF","0F","5F"] > for x in range(len(thisArray)): >print "\x" + thisArray[x] > > However python chokes on the escaped identifier, how can I get around > th

Re: source reduction using Python

2006-06-22 Thread Roger Miller
[EMAIL PROTECTED] wrote: > 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 : > ...

Re: Quick Question

2006-06-22 Thread Carl J. Van Arsdall
xkenneth wrote: > I want to be able to cycle through an array and print something in > hexadecimal. Such as this > thisArray = ["AF","0F","5F"] > for x in range(len(thisArray)): >print "\x" + thisArray[x] > > However python chokes on the escaped identifier, how can I get around > this?

Re: Quick Question

2006-06-22 Thread Alexis Roda
En/na xkenneth ha escrit: > I want to be able to cycle through an array and print something in > hexadecimal. Such as this > thisArray = ["AF","0F","5F"] > for x in range(len(thisArray)): >print "\x" + thisArray[x] > > However python chokes on the escaped identifier, how can I get arou

Re: Network Programming in Python

2006-06-22 Thread diffuser78
I have Python 2.4.2 on windows and Linux both. I got an import error. how can we obtain the twisted libraries ? When I try to run your code Jean-Paul Calderone wrote: > On 22 Jun 2006 12:02:14 -0700, [EMAIL PROTECTED] wrote: > >I am a newbie in python. I want to learn and implement a small > >ne

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Joachim Durchholz
Andreas Rossberg schrieb: > Joachim Durchholz wrote: >>> It's worth noting, too, that (in some sense) the type of an object can change over time[*]. >>> >>> No. Since a type expresses invariants, this is precisely what may >>> *not* happen. >> >> No. A type is a set of allowable values,

Re: Status of optional static typing in Python?

2006-06-22 Thread Bruno Desthuilliers
Christian Convey a écrit : > Hi guys, > > I'm looking at developing a somewhat complex system, and I think some > static typing will help me keep limit my confusion. Then I think you're suffering from an alas too common delusion. Static typing (at least declarative static typing) will only ma

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Joachim Durchholz
Andreas Rossberg schrieb: > (Btw, Pascal did not have it either, AFAIK) Indeed. Some Pascal dialects have it. Regards, Jo -- http://mail.python.org/mailman/listinfo/python-list

Re: Network Programming in Python

2006-06-22 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: > > Really, was that so hard? > > Python makes sockets a total breeze. You can write an 80's style HTTP > server in less than a page of code. But making a *good* 80's style http/socket server is a lot of work. Better pick one of the high level protocols built on top of i

Re: Specifing arguments type for a function

2006-06-22 Thread Bruno Desthuilliers
George Sakkis a écrit : > Maric Michaud wrote: > > >>Le Mardi 20 Juin 2006 13:28, Maric Michaud a écrit : >> >>>if not getattr(arg, '__iter__') and not getattr(arg, '__getitem__') : >>>raise ValueError('Function accepts only iterables') # or error handling >>>code >> >>oops, hasattr of course

Re: Status of optional static typing in Python?

2006-06-22 Thread Christian Convey
Perhaps I'm deluded but I don't think so. I'll tell you my situation and I'd appreciate your take on it... I'm looking into the design a network simulator. The simulator has a few requirements: (1) I need to be able to swap in a variety of replacement components during different simulations.

Is Queue.Queue.queue.clear() thread-safe?

2006-06-22 Thread Russell Warren
I'm guessing no, since it skips down through any Lock semantics, but I'm wondering what the best way to clear a Queue is then. Esentially I want to do a "get all" and ignore what pops out, but I don't want to loop through a .get until empty because that could potentially end up racing another thre

Re: Network Programming in Python

2006-06-22 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > I have Python 2.4.2 on windows and Linux both. I got an import error. > how can we obtain the twisted libraries ? Is google down ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Status of optional static typing in Python?

2006-06-22 Thread Kay Schluehr
Christian Convey wrote: > Hi guys, > > I'm looking at developing a somewhat complex system, and I think some > static typing will help me keep limit my confusion. I.e.: > > http://www.artima.com/weblogs/viewpost.jsp?thread=87182 > > Does anyone know if/when that feature may become part of Python?

Re: Network Programming in Python

2006-06-22 Thread diffuser78
I got it ...initially sourceforge page linked all old libraries..later then got this link to twistedmatrix. Thanks. Bruno Desthuilliers wrote: > [EMAIL PROTECTED] a écrit : > > I have Python 2.4.2 on windows and Linux both. I got an import error. > > how can we obtain the twisted libraries ? > > I

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread rossberg
Joachim Durchholz wrote: > > > A type is the encoding of these properties. A type > > varying over time is an inherent contradiction (or another abuse of the > > term "type"). > > No. It's just a matter of definition, essentially. > E.g. in Smalltalk and Lisp, it does make sense to talk of the "ty

Re: What is a type error?

2006-06-22 Thread Eliot Miranda
> Chris Smith wrote: >>I suspect you'll see the Smalltalk version of the objections raised in >>response to my post earlier. In other words, whatever terminology you >>think is consistent, you'll probably have a tough time convincing >>Smalltalkers to stop saying "type" if they did before. If y

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Claudio Grondi
Xah Lee wrote: > in March, i posted a essay “What is Expressiveness in a Computer > Language”, archived at: > http://xahlee.org/perl-python/what_is_expresiveness.html > > I was informed then that there is a academic paper written on this > subject. > > On the Expressive Power of Programming Langu

Re: Network Programming in Python

2006-06-22 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: >I have Python 2.4.2 on windows and Linux both. I got an import error. >how can we obtain the twisted libraries ? . . . Look for "Downloading" under http://twistedmatr

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Chris Smith
Claudio Grondi <[EMAIL PROTECTED]> wrote: > Looking this thread growing it appears to me, that at least one thing > becomes evident here: > > Xah unwillingness to learn from the bad past experience contaminates > others (who are still posting to his trolling threads). > > Here another try to re

Re: better Python IDE? Mimics Maya's script editor?

2006-06-22 Thread Russell Warren
Check out the Wing IDE - www.wingware.com . As part of it's general greatness it has a "debug probe" which lets you execute code snippets on active data in mid-debug execution. It doesn't have precisely what you are after... you can't (yet) highlight code segments and say "run this, please", but

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Timo Stamm
Claudio Grondi schrieb: > Looking this thread growing it appears to me, that at least one thing > becomes evident here: > > Xah unwillingness to learn from the bad past experience contaminates > others (who are still posting to his trolling threads). This is actually one of the most interesting

Re: What is a type error?

2006-06-22 Thread Darren New
Eliot Miranda wrote: > can only actually carry-out operations on objects that implement them. Execpt that every operation is implemented by every object in Smalltalk. Unless you specify otherwise, the implementation of every method is to call the receiver with doesNotUnderstand. (I don't recal

Re: Status of optional static typing in Python?

2006-06-22 Thread Bruno Desthuilliers
Christian Convey a écrit : > Perhaps I'm deluded but I don't think so. . You are. > I'll tell you my situation > and I'd appreciate your take on it... > > I'm looking into the design a network simulator. The simulator has a > few requirements: > > (1) I need to be able to swap in a variety

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread David Hopwood
Rob Thorpe wrote: > David Hopwood wrote: > >>As far as I can tell, the people who advocate using "typed" and "untyped" >>in this way are people who just want to be able to discuss all languages in >>a unified terminological framework, and many of them are specifically not >>advocates of statically

Clearing pythonwin environment

2006-06-22 Thread Network Ninja
I want to restart the environment occasionally to default (like I restarted pythonwin). I wrote this script. I know why it doesn't work, cause it deletes my variable (item) on each iteration. My question is: is it possible to do this? What other things might I try? # Reset Pythonwin enviroment #

Re: Specifing arguments type for a function

2006-06-22 Thread bearophileHUGS
Paolo Pantaleo: > and I want to state that the_arg must be only of a certain type > (actually a list). Is there a way to do that? I suggest this very good library, typecheck: http://oakwinter.com/code/typecheck/ Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Queue.Queue.queue.clear() thread-safe?

2006-06-22 Thread Tim Peters
[Russell Warren] > I'm guessing no, since it skips down through any Lock semantics, Good guess :-) It's also unsafe because some internal conditions must be notified whenever the queue becomes empty (else you risk deadlock). > but I'm wondering what the best way to clear a Queue is then. > > Ese

Typing (was: Re: What is Expressiveness in a Computer Language)

2006-06-22 Thread Dr.Ruud
Timo Stamm schreef: > This is actually one of the most interesting threads I have read in a > long time. If you ignore the evangelism, there is a lot if > high-quality information and first-hand experience you couldn't find > in a dozen books. Much of what is talked about, is in these articles (a

Re: Is Queue.Queue.queue.clear() thread-safe?

2006-06-22 Thread Fredrik Lundh
Tim Peters wrote: >> I'm guessing no, since it skips down through any Lock semantics, > > Good guess :-) It's also unsafe because some internal conditions must > be notified whenever the queue becomes empty (else you risk deadlock). "also" ? if it weren't for the other things, the clear() call

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Benjamin Franksen
George Neuner wrote: > The point is really that the checks that prevent these things [such as 'array index out of bounds'] > must be > performed at runtime and can't be prevented by any practical type > analysis performed at compile time. I'm not a type theorist but my > opinion is that a stati

Re: code is data

2006-06-22 Thread Paul Boddie
Anton Vredegoor wrote: > Bruno Desthuilliers wrote: > > > You mean like 'converting' javascript to python or python to ruby (or > > converting any home-grown DSL to Python, etc) ? > > Yes, but also what some other posters mentioned, making Pythons internal > parsing tree available to other programs

map() return of flat tuple list

2006-06-22 Thread Mirco Wahab
Hi, I have a 2D array, maybe irregular, like arr = [[2,2,2,2], [2,2,2,2], [2,2,2,2]] if tried to pull an index list (tuples or array elements) of all positions - via the map funtion, but failed. I tried to get sth. like [ [0,0], [0,1], [0,2], ... ] for each element which reall

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Anton van Straaten
Marshall wrote: > Can you be more explicit about what "latent types" means? > I'm sorry to say it's not at all natural or intuitive to me. > Are you referring to the types in the programmers head, > or the ones at runtime, or what? Sorry, that was a huge omission. (What I get for posting at 3:30a

Re: Status of optional static typing in Python?

2006-06-22 Thread George Sakkis
Christian Convey wrote: > Perhaps I'm deluded but I don't think so. I'll tell you my situation > and I'd appreciate your take on it... > > I'm looking into the design a network simulator. The simulator has a > few requirements: > > (1) I need to be able to swap in a variety of replacement compon

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread David Hopwood
Pascal Bourguignon wrote: > Pascal Costanza <[EMAIL PROTECTED]> writes: >>Andreas Rossberg wrote: >>>Pascal Costanza wrote: >>> Consider a simple expression like 'a + b': In a dynamically typed language, all I need to have in mind is that the program will attempt to add two numbers. In

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread David Hopwood
Pascal Bourguignon wrote: > But it's always possible at run-time that new functions and new > function calls be generated such as: > > (let ((x "two")) > (eval `(defmethod g ((self ,(type-of x))) t)) > (eval `(defmethod h ((x ,(type-of x)) (y string)) >(,(intern (format nil "DO-SO

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread David Hopwood
Andreas Rossberg wrote: > Marshall wrote: > What prohibits us from describing an abstract type as a set of values? >>> >>> If you identify an abstract type with the set of underlying values then >>> it is equivalent to the underlying representation type, i.e. there is no >>> abstraction. >> >

Re: map() return of flat tuple list

2006-06-22 Thread bearophileHUGS
Maybe you want something like this (but this doesn't use map): def indexes(m): return [(r,c) for r, row in enumerate(m) for c in xrange(len(row))] m1 = [[2,2,5], [2,2], [2,2,2,2]] m2 = [[], [2], [1,2,3,4]] print indexes(m1) print indexes(m2) Output: [(0, 0), (0, 1),

Re: Python at compile - possible to add to PYTHONPATH

2006-06-22 Thread rh0dium
Hi all, Thanks for the response. Yeah that's what I'm currently doing but I thought that it would be cleaner for me to append my own location at compile time. I'm surprised that this doesn't exist.. Thanks. Avell Diroll wrote: > rh0dium wrote: > (snip) > > I want to add /foo/bar to the PYTHO

Re: Python to PHP Login System (HTTP Post)

2006-06-22 Thread Justin Azoff
Jeethu Rao wrote: > You need to use httplib. > http://docs.python.org/lib/httplib-examples.html > > Jeethu Rao Not at all. They need to read the documentation for urrlib: http://docs.python.org/lib/module-urllib.html http://docs.python.org/lib/node483.html "The following example uses the "POST"

Using metaclassed to dynamically generate a class based on a parameter to the objects init function.

2006-06-22 Thread sashang
Hi I'd like to use metaclasses to dynamically generate a class based on a parameter to the objects init function. For example: class MetaThing(type): def __init__(cls, name, bases, dict, extra_information): super(MetaThing, cls).__init__(name, bases, dict) #setup the class ba

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Anton van Straaten
Vesa Karvonen wrote: > In comp.lang.functional Anton van Straaten <[EMAIL PROTECTED]> wrote: > [...] > > This static vs dynamic type thing reminds me of one article written by > Bjarne Stroustrup where he notes that "Object-Oriented" has become a > synonym for "good". More precisely, it seems to

Program slowing down with greater memory use

2006-06-22 Thread Dan Stromberg
I have two different python programs that are slowing down quite a bit as their memory use goes up. I'm not really sure if this is some sort of CPU cache effect, or if it's something about python's garbage collector taking more time, or what. One of the programs is one of those "how fast is data

coderwiki.com is starting and needs you!

2006-06-22 Thread da404LewZer
i'm starting a wiki on coding, keeping everything seperate. anyone who wants to help check out the site. i want to document every function for every language ever www.coderwiki.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Specifing arguments type for a function

2006-06-22 Thread George Sakkis
Bruno Desthuilliers wrote: > George Sakkis a écrit : > > This is ok - in theory. In practice I've found that e.g. strings are > > more often than not handled as scalars although they are typically > > iterables. > >>> hasattr('', '__iter__') > False >>> hasattr('', '__iter__') or hasattr('', '__

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Anton van Straaten
Rob Thorpe 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 situations in which human reasoning doesn't come int

Re: Mouse wheel event for Canvas

2006-06-22 Thread John McMonagle
On Thu, 2006-06-22 at 14:24 +1000, John McMonagle wrote: > 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 Tki

Re: Is Queue.Queue.queue.clear() thread-safe?

2006-06-22 Thread Tim Peters
[Russell Warren] >>> I'm guessing no, since it skips down through any Lock semantics, [Tim Peters] >> Good guess :-) It's also unsafe because some internal conditions must >> be notified whenever the queue becomes empty (else you risk deadlock). [Fredrik Lundh] > "also" ? if it weren't for the

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Anton van Straaten
Andreas Rossberg wrote: > Rob Warnock wrote: > >> >> Here's what the Scheme Standard has to say: >> >> http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-4.html >> 1.1 Semantics >> ... >> Scheme has latent as opposed to manifest types. Types are assoc- >> iated wit

String negative indices?

2006-06-22 Thread drtimhill
I'm just starting out on Python, and am stumped by what appears an oddity in the way negative indices are handled. For example, to get the last character in a string, I can enter "x[-1]". To get the 2nd and 3rd to last, I can enter x[-3:-1] etc. This is fine. Logically, I should be able to ente

Re: String negative indices?

2006-06-22 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: > Is there some magic I'm missing here? Wouldn't it actually be better for > Python to treat 0 as a > special case here, so that x[-2:0] and x[-2:] generated the same result? No, since x[-2:0:-1] already has meaning and it isn't what you want. -- Erik Max Francis &&

Re: String negative indices?

2006-06-22 Thread George Sakkis
[EMAIL PROTECTED] wrote: > I'm just starting out on Python, and am stumped by what appears an oddity in > the way negative indices are handled. > > For example, to get the last character in a string, I can enter "x[-1]". To > get the 2nd and 3rd to last, I can enter x[-3:-1] etc. This is fine. >

Re: How to generate all permutations of a string?

2006-06-22 Thread Girish Sahani
>> thanks lawrence...however this func doesnt return the permuted strings, >> so >> i added some code as follows to generate a list of all the permutations: >> >> def permute(seq): >> l = [] >> if len(seq) == 0: >> yield [] >> else: >> for i in range(0,len(seq)): >>

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Marshall
Joe Marshall wrote: > > That's the important point: I want to run broken code. I want to make sure I understand. I can think of several things you might mean by this. It could be: 1) I want to run my program, even though I know parts of it are broken, because I think there are parts that are not

Using SQLite3 with python 2.5 beta

2006-06-22 Thread Harold Shore
>From the release notes I read that "If you're compiling the Python source yourself, note that the source tree doesn't include the SQLite code, only the wrapper module. You'll need to have the SQLite libraries and headers installed before compiling Python, and the build process will compile th

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Marshall
Joachim Durchholz wrote: > Marshall schrieb: > > immutable = can't change > > vary-able = can change > > > > Clearly a contradiction in terms. > > Not in mathematics. So stipulated. However, it *is* a contradiction in English. Now, we often redefine or narrow terms for technical fields. However,

Re: code is data

2006-06-22 Thread Ravi Teja
> I don't think that distinction is very meaningful. As a programmer I > have to understand both. > I understand the Python compiler well, and it gives me reasonably good > feedback when I > get things wrong, and it has a lot of flexibility along several > orthogonal lines. > We're talking about

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Marshall
Timo Stamm wrote: > > This is actually one of the most interesting threads I have read in a > long time. If you ignore the evangelism, there is a lot if high-quality > information and first-hand experience you couldn't find in a dozen books. Hear hear! This is an *excellent* thread. The evangelism

Re: need all python dialog equivalent

2006-06-22 Thread Eric S. Johansson
Thomas Dickey wrote: > Eric S. Johansson <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> dialog binary is 110 KB. Won't it fit ? > >> missing library. I have ncurses and newt and dialog seems to require >> something called ncursesw. I've been trying to find the Python newt > > "se

Re: Using SQLite3 with python 2.5 beta

2006-06-22 Thread Tim Heaney
Harold Shore <[EMAIL PROTECTED]> writes: > From the release notes I read that > > "If you're compiling the Python source yourself, note that > the source tree doesn't include the SQLite code, only the > wrapper module. You'll need to have the SQLite libraries > and headers installed before comp

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Chris Smith
Anton van Straaten wrote: > Vesa Karvonen wrote: > > > > This static vs dynamic type thing reminds me of one article written by > > Bjarne Stroustrup where he notes that "Object-Oriented" has become a > > synonym for "good". More precisely, it seems to me that both camps > > (static & dynamic) th

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Marshall
Anton van Straaten wrote: > Marshall wrote: > > Can you be more explicit about what "latent types" means? > > I'm sorry to say it's not at all natural or intuitive to me. > > Are you referring to the types in the programmers head, > > or the ones at runtime, or what? > > Sorry, that was a huge omis

[ANN] RUR-PLE version 0.9.9

2006-06-22 Thread André
Roberge's Used Robot: a Python Learning Environment Version 0.9.9 of RUR-PLE has been released. It can be found at: https://sourceforge.net/project/showfiles.php?group_id=125834 RUR-PLE should work properly on all major platforms (Mac, Linux and Windows) in 3 different languages (English, French

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Chris Smith
Chris Smith <[EMAIL PROTECTED]> wrote: > I see it as quite reasonable when there's an effort by several > participants in this thread to either imply or say outright that static > type systems and dynamic type systems are variations of something > generally called a "type system" [...] I didn't

Re: win32com and name of com

2006-06-22 Thread Roger Upole
"bli" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > hi all > first post. > I am using python to connect to dll. I have read everything I can find > on [EMAIL PROTECTED] > and tried all variations of the name of the dll to use in the Dispatch. > I get a com error-(-2147...1005, 'Inv

Re: embedded Python calling app via COM

2006-06-22 Thread Roger Upole
"Jim" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I have a C++ app which fires up a Python script using C API calls. > That script operates the app via Automation calls, like this: > > from win32com.client import * > from mywrapper import * > > myapp = Application() > myapp.Visibl

Re: Python to PHP Login System (HTTP Post)

2006-06-22 Thread test
On 22 Jun 2006 16:19:50 -0700, "Justin Azoff" <[EMAIL PROTECTED]> wrote: >Jeethu Rao wrote: >> You need to use httplib. >> http://docs.python.org/lib/httplib-examples.html >> >> Jeethu Rao > >Not at all. They need to read the documentation for urrlib: > >http://docs.python.org/lib/module-urllib.

Python Position Available

2006-06-22 Thread pythonfreak
http://seeker.dice.com/jobsearch/servlet/JobSearch?op=101&dockey=xml/2/d/[EMAIL PROTECTED]&c=1&source=1 -- http://mail.python.org/mailman/listinfo/python-list

Re: occasional win32com error

2006-06-22 Thread Roger Upole
You could try using DispatchEx to make sure you always get a new instance of Excel. Roger "Ransom" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hey folks... > > Newbie here. I'm working with win32com launching, closing and > re-launching Excel grabbing output and doing stu

Re: How to generate all permutations of a string?

2006-06-22 Thread James Stroud
Girish Sahani wrote: >>>thanks lawrence...however this func doesnt return the permuted strings, >>>so >>>i added some code as follows to generate a list of all the permutations: >>> >>>def permute(seq): >>>l = [] >>>if len(seq) == 0: >>>yield [] >>>else: >>>for i in rang

Re: Network Programming in Python

2006-06-22 Thread Bill Maxwell
On 22 Jun 2006 12:02:14 -0700, [EMAIL PROTECTED] wrote: >I am a newbie in python. I want to learn and implement a small >networking concept. Please help me. Every help is appreciated. > >I have one Linux Box and one Windows PC. I want to have a daemon >running on Windows PC which listens on some s

<    1   2   3   >