Re: need all python dialog equivalent

2006-06-20 Thread [EMAIL PROTECTED]
dialog binary is 110 KB. Won't it fit ? Eric S. Johansson wrote: > I'm creating a dialogue style interface for an application on a > dedicated system. All I have is basic Python 2.3. Is there anything > like an all Python dialog equivalent floating around? I'm currently > hacking away in curse

Re: Initializing a set from a list

2006-06-20 Thread Xiaolei
Robert Kern wrote: > Xiaolei Li wrote: > > Hi, > > > > I'm trying to initialize a set from a list but am unable to do so. My > > list "c", looks like: > > > > [(1.00909, 0.91966, -0.13550388182991072, 0), > > (0.874239991, 0.7001, -0.2123048713754, 0)] > > > > S

Re: Problem Py2exe pygtk and Pil

2006-06-20 Thread thomas carpentier
I have already read the py2exe docs. When I come back at home, I will write a message who contains the script and the errors faulkner a écrit : > read the py2exe docs. py2exe should put everything a new user should > need in the dist directory. if it doesn't, copy the libraries [be they > .pyc o

Re: Simple question regarding module initialization

2006-06-20 Thread Terry Hancock
> On 6/20/06, Patrick M. Nielsen <[EMAIL PROTECTED]> wrote: > > for module in modules: print "Loading %s..." % module exec 'import > > %s' % module > > > > Although I like the outcome of writing it like this, I don't feel > > good about it. Is this against standard Python conventions or > > morals

Re: Python is fun (useless social thread) ;-)

2006-06-20 Thread Terry Hancock
John Salerno wrote: > Did you have to learn it for a job? No, for me, programming is primarily a hobby. I worked on scientific programming in Fortran in the 1980s and in C in the 1990s. Later I did some sys admin work, and managed to use a bit of Python in that. > Or did you just like what you

separation events

2006-06-20 Thread Ghido
Hi all, i'm writing a software with python and wxpython for manage the quality/environmental/security system for the my factory. I want to separate the gui structure from the events and database operations for obtain a very modular software, for this reason i start to use sqlalchemy. Unfortunately

Re: Initializing a set from a list

2006-06-20 Thread Robert Kern
Xiaolei Li wrote: > Hi, > > I'm trying to initialize a set from a list but am unable to do so. My > list "c", looks like: > > [(1.00909, 0.91966, -0.13550388182991072, 0), > (0.874239991, 0.7001, -0.2123048713754, 0)] > > So basically a list of 2 tuples, each

Initializing a set from a list

2006-06-20 Thread Xiaolei Li
Hi, I'm trying to initialize a set from a list but am unable to do so. My list "c", looks like: [(1.00909, 0.91966, -0.13550388182991072, 0), (0.874239991, 0.7001, -0.2123048713754, 0)] So basically a list of 2 tuples, each with 4 elements. Since tuples are

Re: OS specific command in Python

2006-06-20 Thread Avell Diroll
[EMAIL PROTECTED] wrote: > When you connect (via ssh or telnet) to a remote machine, you need to > type (manually) > your username and your password. Programming that is never easy. > This is really eased by the module getpass (std library) : ### import getpass login = getpass.getuser() passwo

Re: Cycles between package imports

2006-06-20 Thread Martin Blais
On 18 Jun 2006 05:25:14 -0700, John Roth <[EMAIL PROTECTED]> wrote: > Martin Blais wrote: > > Hi > > > > I'm a tad confused over a problem involving cycles between > > packages. > > [lengthy example snipped] > > > > > > > I don't see why the reference to module a.alice could not be > > available v

Re: Segmentation fault only on Iinux

2006-06-20 Thread Frank Millman
Kiran wrote: > Hello All, > In my program, I have a main thread which is the GUI (wxPython) and > then a thread which goes and reads data from a socket. The reason this > is in a different thread is because the data might take some time to > come back, and I want to have the GUI to be responsiv

Re: OS specific command in Python

2006-06-20 Thread Avell Diroll
[EMAIL PROTECTED] wrote: > I tried the following and it seemed to work > > import os > os.system('') > > Any comments > This is an simple way to proceed if you don't need your python script to know what happens to the launched process ... When you need to : * send some input to the command

Re: need all python dialog equivalent

2006-06-20 Thread Miki
Hello Eric, > Is there anything like an all Python dialog equivalent floating around? http://www.pythonware.com/library/tkinter/introduction/ HTH, -- Miki http://pythonwise.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread David Hopwood
genea wrote: > [...] NOW that being said, I think > that the reason I like Haskell, a very strongly typed language, is that > because of it's type system, the language is able to do things like > lazy evaluation, [...] Lazy evaluation does not depend on, nor is it particularly helped by static typ

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread David Hopwood
Pascal Costanza wrote: > Rob Thorpe wrote: >> Pascal Costanza wrote: >>> Matthias Blume wrote: Pascal Costanza <[EMAIL PROTECTED]> writes: > (slot-value p 'address) is an attempt to access the field 'address in > the object p. In many languages, the notation for this is p.address.

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Ben Morrow
Quoth David Hopwood <[EMAIL PROTECTED]>: > Pascal Costanza wrote: > > Chris Smith wrote: > > > > Types can be represented at runtime via type tags. You could insist on > > using the term "dynamically tagged languages", but this wouldn't change > > a lot. Exactly _because_ it doesn't make sense in

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread David Hopwood
Pascal Costanza wrote: > Chris Smith wrote: > >> Knowing that it'll cause a lot of strenuous objection, I'll >> nevertheless interject my plea not to abuse the word "type" with a >> phrase like "dynamically typed". If anyone considers "untyped" to be >> perjorative, as some people apparently do,

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread David Hopwood
Chris Smith wrote: > Chris Uppal <[EMAIL PROTECTED]> wrote: > >>>I'm unsure whether to consider explicitly stored array lengths, which >>>are present in most statically typed languages, to be part of a "type" >>>in this sense or not. >> >>If I understand your position correctly, wouldn't you be pr

Re: Psyco performance

2006-06-20 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Place all the code in a function. Even without psyco you might get > > somewhat better performances then. And I doubt psyco can optimise code > > that isn't in a function anyway. > > > > And lastly, most of the code is probably spend c

Re: code is data

2006-06-20 Thread Ian Bicking
Ravi Teja wrote: > > Or... maybe to be more specific, the hard work later on goes into > > *code*. If you are enhancing your model, you do so with methods on the > > model classes, and those methods don't effect the DSL, they are just > > "code". You create some raw XML in the beginning, but quic

need all python dialog equivalent

2006-06-20 Thread Eric S. Johansson
I'm creating a dialogue style interface for an application on a dedicated system. All I have is basic Python 2.3. Is there anything like an all Python dialog equivalent floating around? I'm currently hacking away in curses but it's taking me a long way down what I fear to be a wrong path. I

Re: Python is fun (useless social thread) ;-)

2006-06-20 Thread BartlebyScrivener
>>> You know what are dicts, right ? That is, containers with >>> keyword-access to values ? Then you probably have dicts >>> with a known, defined structure, and functions working on >>> it. What classes (and hence 00) gives you is a way to >>> associate these functions with the dicts themselves.

Re: Absolute noob to Linux programming needs language choice help

2006-06-20 Thread stylecomputers
Thanks James, Good to know resist shell scripting. Python web programming now theres something I had no Idea you could do with Python. how interesting :). Just been to your website, the letters after your name wouldnt fit very easily on one line would they :) Cheers Ty > Yes python will be go

Re: Simple script to make .png thumbnails from .zip archive...

2006-06-20 Thread K P S
Thanks a lot! This is what I ended up with. (I would like to get rar archive support, but browsing the web it looks like rar support isn't in any python library (yet)) :-( Anyway, I was able to use the below code unchanged to create thumbnails in nautilus based on the first .jpg file in a .zip ar

Re: Absolute noob to Linux programming needs language choice help

2006-06-20 Thread James Stroud
[EMAIL PROTECTED] wrote: > Hey guys, > > I am absolutely new to Linux programming, with no w##s programming > experience except a small amount of C++ console apps. > Reasonably new to Linux, BSD etc, got good sound networking base of > knowledge and dont have any problem working the command li

Absolute noob to Linux programming needs language choice help

2006-06-20 Thread stylecomputers
Hey guys, I am absolutely new to Linux programming, with no w##s programming experience except a small amount of C++ console apps. Reasonably new to Linux, BSD etc, got good sound networking base of knowledge and dont have any problem working the command line etc. I want to learn a language t

Re: Simple question regarding module initialization

2006-06-20 Thread Troy Melhase
$ ipython in [1]: __import__? Type: builtin_function_or_method Base Class: String Form: Namespace: Python builtin Docstring: __import__(name, globals, locals, fromlist) -> module Import a module. The globals are only used to determine the context; they are not

Re: Another Eclipse Question with Python

2006-06-20 Thread Fabio Zadrozny
On 6/20/06, Stan Cook <[EMAIL PROTECTED]> wrote: I followed the help instructions to set a watchpoint for avariable, or at lest I tried.  When I hilight the variableand go to the run menu, the "toggle watchpoint" is grayedout and can't be selected as specified.  Is this Python related only?  Just w

Simple question regarding module initialization

2006-06-20 Thread Patrick M. Nielsen
Hi guys.Yes, this is very much a neophyte question, but I was pondering;modules = ['stackless',   'sys',   'slsocket as socket',   'random, time',   'traceback',    'string',   'util']for module in modules:    print "Loading %s..." % module    exec 'i

Re: Python with Eclipse

2006-06-20 Thread Philippe Martin
Dennis Benzinger wrote: > Philippe Martin wrote: >> Dennis Benzinger wrote: >> >>> Stan Cook wrote: I've been trying to use Eclipse with Python on Linux for a while and have noticed something odd. After running the code or debugging a few times, its responsiveness gets really bad.

Re: dynamic inheritance

2006-06-20 Thread alf
bruno at modulix wrote: > > *But* you'd probably better tell us about the problem you're trying to > solve. Since in Python, inheritance is mostly about implementation (ie: > not needed for subtyping), your problem would probably be best solved > with composition/delegation, for which Python offe

Another Eclipse Question with Python

2006-06-20 Thread Stan Cook
I followed the help instructions to set a watchpoint for a variable, or at lest I tried. When I hilight the variable and go to the run menu, the "toggle watchpoint" is grayed out and can't be selected as specified. Is this Python related only? Just wondering, I want to use the software with

Re: Python with Eclipse

2006-06-20 Thread Stan Cook
Jason wrote: > PyDev Eclipse keeps around the python interpreter unless it gets > removed. I think part of the point is to keep around failed runs so > the user can investigate the stack. Eclipse doesn't keep this around > if you Run you script, but it will keep the interpreter alive if you > Deb

[Announce] haddoc and haddoc.el

2006-06-20 Thread Martin Blais
Description === Haddoc is a simple tool that allows an emacs user to search the Python HTML documentation indexes and to bring a web browser to an index term page. Motivation -- Even though I have the Python TexInfo documentation installed from my Emacs, somehow I always end up b

Deprecation wrapper

2006-06-20 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 to

Re: Getting external name of passed variable

2006-06-20 Thread David Hirschfield
Cool, thanks. Stack inspection of sorts it is. -Dave faulkner wrote: import sys tellme = lambda x: [k for k, v in sys._getframe(1).f_locals.iteritems() if v == x] a=1 tellme(a) ['a'] Michael Spencer wrote: David Hirschfield wrote:

Re: Getting external name of passed variable

2006-06-20 Thread faulkner
>>> import sys >>> tellme = lambda x: [k for k, v in sys._getframe(1).f_locals.iteritems() if >>> v == x] >>> a=1 >>> tellme(a) ['a'] Michael Spencer wrote: > David Hirschfield wrote: > > I'm not sure this is possible, but it sure would help me if I could do it. > > > > Can a function learn the n

Re: Problem Py2exe pygtk and Pil

2006-06-20 Thread faulkner
read the py2exe docs. py2exe should put everything a new user should need in the dist directory. if it doesn't, copy the libraries [be they .pyc or .pyd or .dll] that py2exe missed into dist. i know for a fact that py2exe is intelligent with the gtk libraries, so check if the PIL libraries are in t

Re: Segmentation fault only on Iinux

2006-06-20 Thread faulkner
if you don't know exactly which line of code causes the segfault, use print statements to determine that. then try to either redesign/refactor so that line isn't necessary, or protect its operation somehow. if you do know, tell us what it is and we might not need to see all your code. Kiran wrote:

Re: __getattribute__ doesn't work on 'type' type for '__class__'

2006-06-20 Thread Barry Kelly
Barry Kelly <[EMAIL PROTECTED]> wrote: > From "pydoc __getattribute__": > > ---8<--- > Help on method-wrapper object: > > __getattribute__ = class method-wrapper(object) > | Methods defined here: > | > | __call__(...) > | x.__call__(...) <==> x(...) > | > | __getattribute__(...

Re: Bus error in PyGILState_Release (callbacks from other threads)

2006-06-20 Thread geoffschmidt
[EMAIL PROTECTED] wrote: > I'm trying to write an extension in C that delivers callbacks to > Python. The C code starts several threads, and I'd like one of the new > threads that is started to be able to deliver callbacks to Python. I > thought I could do this by wrapping the callback function in

Re: Getting external name of passed variable

2006-06-20 Thread Michael Spencer
David Hirschfield wrote: > I'm not sure this is possible, but it sure would help me if I could do it. > > Can a function learn the name of the variable that the caller used to > pass it a value? For example: > > def test(x): > print x > > val = 100 > test(val) > > Is it possible for function

Re: Running code on assignment/binding

2006-06-20 Thread Michael Spencer
David Hirschfield wrote: > Another deep python question...is it possible to have code run whenever > a particular object is assigned to a variable (bound to a variable)? > > So, for example, I want the string "assignment made" to print out > whenever my class "Test" is assigned to a variable: >

Re: Iteration over recursion?

2006-06-20 Thread Sudden Disruption
Nick, > you will have cursed the concept to hell and back again. Been there - done > that :-( My point exactly. Years ago with Pascal I took the recursive approach way too often with much distress. I began to learn that if I move enough stuff out of the loop and set up a context that could eas

Re: Iteration over recursion?

2006-06-20 Thread MTD
Thanks a lot! More food for thought! -- http://mail.python.org/mailman/listinfo/python-list

Problem Py2exe pygtk and Pil

2006-06-20 Thread thomas carpentier
Hello, I have created a program with a GUI ( glade). In this script I call the Python Imaging Library. I have developped this program onto linux, but il would like export it on Windows, however I have a problem with py2exe. If the new user has not python and library(PIL, GLADE) installed, it d

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Matthias Blume
Joachim Durchholz <[EMAIL PROTECTED]> writes: > Matthias Blume schrieb: >> Perhaps better: A language is statically typed if its definition >> includes (or ever better: is based on) a static type system, i.e., a >> static semantics with typing judgments derivable by typing rules. >> Usually typing

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Joachim Durchholz
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: Iteration over recursion?

2006-06-20 Thread Sudden Disruption
Bruno, > Yes. And everything done with Python can be done with assembly language > too. It's even more general than that... To simply Turning, anything that can compute, can compute anything that can be computed - hardware OR software. But that doesn't mean you should use it. Imagine if we all

Re: Iteration over recursion?

2006-06-20 Thread Tim Peters
[MTD] > I've been messing about for fun creating a trial division factorizing > function and I'm naturally interested in optimising it as much as > possible. > > I've been told that iteration in python is generally more > time-efficient than recursion. Is that true? Since you heard it from me to b

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Joachim Durchholz
Matthias Blume schrieb: > Perhaps better: A language is statically typed if its definition > includes (or ever better: is based on) a static type system, i.e., a > static semantics with typing judgments derivable by typing rules. > Usually typing judgmets associate program phrases ("expressions") w

Re: code is data

2006-06-20 Thread Ravi Teja
> Or... maybe to be more specific, the hard work later on goes into > *code*. If you are enhancing your model, you do so with methods on the > model classes, and those methods don't effect the DSL, they are just > "code". You create some raw XML in the beginning, but quickly it's > just a matter

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Joachim Durchholz
Torben Ægidius Mogensen schrieb: > 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. Dynamic typing means > that such violations are detected at run-time. Agreed.

[ANN] pysqlite 2.3.1 released

2006-06-20 Thread Gerhard Häring
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 pysqlite 2.3.1 released === I'm pleased to announce the availability of pysqlite 2.3.1. This is a bugfix release, but it includes important fixes. Users of pysqlite 2.2.1 to 2.3.0 should definitely upgrade. Go to http://pysqlite.o

Re: Psyco performance

2006-06-20 Thread [EMAIL PROTECTED]
> Place all the code in a function. Even without psyco you might get > somewhat better performances then. And I doubt psyco can optimise code > that isn't in a function anyway. > > And lastly, most of the code is probably spend computing x**2 which is > already optimised C code. I've changed the c

Re: TEST IGNORE

2006-06-20 Thread George Sakkis
David Hirschfield wrote: > Having email trouble... > Having bathroom trouble... can I help myself at your house entrance ? Didn't think so... -- http://mail.python.org/mailman/listinfo/python-list

Re: socket programming question

2006-06-20 Thread Grant Edwards
On 2006-06-20, Kiran <[EMAIL PROTECTED]> wrote: > is it possible to make python do some other processing while > it is waiting for a socket to timeout? Yes. You can either use threads or select. Or you can use one of the async server frameworks like twisted. -- Grant Edwards

Re: socket programming question

2006-06-20 Thread Irmen de Jong
Kiran wrote: > Hello All, > My question is, is it possible to make python do some other > processing while it is waiting for a socket to timeout? sure, you have to use threads and/or use asynchronous socket programming. Google is your friend. --Irmen -- http://mail.python.org/mailman/listinfo

Re: Psyco performance

2006-06-20 Thread Amaury Forgeot d'Arc
Hello, Gregory Piñero a écrit : > What's the reasoning behind requiring everything to be in functions? > Just curious. You may want to read this: http://psyco.sourceforge.net/introduction.html#differences-with-traditional-jit-compilers Psyco has to run the code at least once to emit code specia

socket programming question

2006-06-20 Thread Kiran
Hello All, My question is, is it possible to make python do some other processing while it is waiting for a socket to timeout? thanks a lot! Kiran -- http://mail.python.org/mailman/listinfo/python-list

Re: Python with Eclipse

2006-06-20 Thread Jason
PyDev Eclipse keeps around the python interpreter unless it gets removed. I think part of the point is to keep around failed runs so the user can investigate the stack. Eclipse doesn't keep this around if you Run you script, but it will keep the interpreter alive if you Debug your script, regardl

Re: Newbie Question

2006-06-20 Thread Bruno Desthuilliers
Saint Malo a écrit : > BTW my program isn't about red blue yellow etc. I'm just using it as > an example. I guess i didn't asked the question correctly or am not > expressing myself correctly. Let me try one more. > > Ok. > > Contents of text file follow: > > red blue purble > yellow blue gr

Re: need helping tracking down weird bug in cPickle

2006-06-20 Thread Tim Peters
[Carl J. Van Arsdall] > Hey everyone, cPickle is raising an ImportError that I just don't quite > understand. When that happens, the overwhelmingly most likely cause is that the set of modules on your PYTHONPATH has changed since the pickle was first created, in ways such that a module _referenced

Re: __getattribute__ doesn't work on 'type' type for '__class__'

2006-06-20 Thread Ziga Seilnacht
Barry Kelly wrote: [snipped] > Yet when I try this with the 'type' type, it doesn't work: > > ---8<--- > >>> x.__class__.__class__ > > >>> x.__class__.__getattribute__('__class__') > Traceback (most recent call last): > File "", line 1, in ? > TypeError: descriptor '__getattribute__' requires a

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Chris Smith
Chris Uppal <[EMAIL PROTECTED]> wrote: > > I'm unsure whether to consider explicitly stored array lengths, which > > are present in most statically typed languages, to be part of a "type" > > in this sense or not. > > If I understand your position correctly, wouldn't you be pretty much forced to >

Re: need helping tracking down weird bug in cPickle

2006-06-20 Thread Scott David Daniels
Carl J. Van Arsdall wrote: > Hey everyone, cPickle is raising an ImportError that I just don't quite > understand. Before I paste the code, let me explain the application. > Basically the part of the application that failed is a function that > loads a list of objects from a file using cPickle

Re: Iteration over recursion?

2006-06-20 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, Bruno Desthuilliers <[EMAIL PROTECTED]> writes: |> Sudden Disruption a écrit : |> |> Because I do like recursion, and would personnally prefer tail-recursion |> optimisation over nice tracebacks. But I'm not in position to decide |> anything here. [ See below be

Re: __getattribute__ doesn't work on 'type' type for '__class__'

2006-06-20 Thread Bruno Desthuilliers
Barry Kelly a écrit : > I'm running this version of Python: > > Python 2.4.3 (#1, May 18 2006, 07:40:45) > [GCC 3.3.3 (cygwin special)] on cygwin > > I read in the documentation that these two expressions are > interchangeable: > > x.__getattribute__('name') <==> x.name I wouldn't say th

SWIG problems with gcc and Cygwin?

2006-06-20 Thread Michael Yanowitz
Hello: I am just trying out SWIG, but quickly ran into problems. Using Cygwin gcc, I tried the following: 1) Created example.c (as given on http://www.swig.org/tutorial.html ) /* File : example.c */ #include double My_variable = 3.0; int fact(int n) { if (n <= 1) return 1; else

Segmentation fault only on Iinux

2006-06-20 Thread Kiran
Hello All, In my program, I have a main thread which is the GUI (wxPython) and then a thread which goes and reads data from a socket. The reason this is in a different thread is because the data might take some time to come back, and I want to have the GUI to be responsive during this wait. Wh

Re: Python with Eclipse

2006-06-20 Thread Dennis Benzinger
Philippe Martin wrote: > Dennis Benzinger wrote: > >> Stan Cook wrote: >>> I've been trying to use Eclipse with Python on Linux for a while and >>> have noticed something odd. After running the code or debugging a few >>> times, its responsiveness gets really bad. Upon checking the equivalent >>

Re: __getattribute__ doesn't work on 'type' type for '__class__'

2006-06-20 Thread Scott David Daniels
Barry Kelly wrote: > I read in the documentation that these two expressions are > interchangeable: > x.__getattribute__('name') <==> x.name I think you'll find: getattr(x, 'name') <==> x.name is what is equivalent. You can define a '__getattribute__' method which will get used, bu

Getting external name of passed variable

2006-06-20 Thread David Hirschfield
I'm not sure this is possible, but it sure would help me if I could do it. Can a function learn the name of the variable that the caller used to pass it a value? For example: def test(x):    print x val = 100 test(val) Is it possible for function "test()" to find out that the variable

Running code on assignment/binding

2006-06-20 Thread David Hirschfield
Another deep python question...is it possible to have code run whenever a particular object is assigned to a variable (bound to a variable)? So, for example, I want the string "assignment made" to print out whenever my class "Test" is assigned to a variable: class Test:    ... x = Test

Re: can't find win32api from embedded pyrun call

2006-06-20 Thread Jim
Miki wrote: > IIRC you need to set the path explicitly in an embedded interpreter. > See the code in "site.py" (which again IMO is *not* imported when the > interpreter starts). Thanks Miki. Actually that doesn't turn out to be the problem. If I display sys.path within the embedded script, it s

Re: Iteration over recursion?

2006-06-20 Thread Jon Clements
Kay Schluehr wrote: > Nick Maclaren wrote: > > > Tail recursion removal can often eliminate the memory drain, but the > > code has to be written so that will work - and I don't know offhand > > whether Python does it. > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496691 > > Regards

Re: Iteration over recursion?

2006-06-20 Thread Bruno Desthuilliers
Sudden Disruption a écrit : > Bruno, > > >>It doesn't. Technical possible, but BDFL's decision... > > > Sure. But why bother? Because I do like recursion, and would personnally prefer tail-recursion optimisation over nice tracebacks. But I'm not in position to decide anything here. > Anyth

Re: Iteration over recursion?

2006-06-20 Thread Jon Clements
Sudden Disruption wrote: > Bruno, > > > It doesn't. Technical possible, but BDFL's decision... > > Sure. But why bother? > I agree. > Anything that can be done with recursion can be done with iteration. > Turng proved that in 1936. > > Recursion was just an attempt to "unify" design approach b

Re: Iteration over recursion?

2006-06-20 Thread Kay Schluehr
Nick Maclaren wrote: > Tail recursion removal can often eliminate the memory drain, but the > code has to be written so that will work - and I don't know offhand > whether Python does it. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496691 Regards, Kay -- http://mail.python.org/mail

Running a Python App from a Web Page

2006-06-20 Thread Andrew Burkhardt
I have created an Tkinter GUI application with Python and I want to host this on a web page that is provided by my internet provider (mediacom).  Whats the easiest and best method to convert my python code in order for it can be ran from a web page? -- http://mail.python.org/mailman/listi

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Pascal Costanza
Rob Thorpe wrote: > Pascal Costanza wrote: >> Matthias Blume wrote: >>> Pascal Costanza <[EMAIL PROTECTED]> writes: (slot-value p 'address) is an attempt to access the field 'address in the object p. In many languages, the notation for this is p.address. Although the class defin

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Matthias Blume
"Rob Thorpe" <[EMAIL PROTECTED]> writes: > I think we're discussing this at cross-purposes. In a language like C > or another statically typed language there is no information passed > with values indicating their type. You seem to be confusing "does not have a type" with "no type information is

Re: Iteration over recursion?

2006-06-20 Thread Sudden Disruption
Bruno, > It doesn't. Technical possible, but BDFL's decision... Sure. But why bother? Anything that can be done with recursion can be done with iteration. Turng proved that in 1936. Recursion was just an attempt to "unify" design approach by abstracting itteration and creating a new context.

TEST IGNORE

2006-06-20 Thread David Hirschfield
Having email trouble... -- Presenting: mediocre nebula. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Darren New
Chris Uppal wrote: > Personally, I would be quite happy to go there -- I dislike the idea that a > value has a specific inherent type. Interestingly, Ada defines a type as a collection of values. It works quite well, when one consistantly applies the definition. For example, it makes very clear

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread genea
Joe Marshall wrote: {...} > The issue of `static vs. dynamic types' comes up about twice a year in > comp.lang.lisp It generally gets pretty heated, but eventually people > come to understand what the other person is saying (or they get bored > and drop out of the conversation - I'm not sure whic

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Chris Uppal
Chris Smith wrote: > > Easy, any statically typed language is not latently typed. > > I'm actually not sure I agree with this at all. I believe that > reference values in Java may be said to be latently typed. Practically > all class-based OO > languages are subject to similar consideration, as i

Re: Psyco performance

2006-06-20 Thread Gregory Piñero
What's the reasoning behind requiring everything to be in functions? Just curious. On 6/20/06, Christophe <[EMAIL PROTECTED]> wrote: > > Place all the code in a function. Even without psyco you might get > somewhat better performances then. And I doubt psyco can optimise code > that isn't in a fu

Re: comparing two arrays

2006-06-20 Thread Scott David Daniels
Diez B. Roggisch wrote: > Maric Michaud wrote: > >> Le Mardi 20 Juin 2006 12:09, Diez B. Roggisch a écrit : >>> [i for i, equals in enumerate((x == y for x, y in zip(a, b))) if equals] >> No needs to nest comprehensions, should be : >> [ i for i, v in enumerate(zip(a, b)) if v[0] == v[1] ] > > Yo

need helping tracking down weird bug in cPickle

2006-06-20 Thread Carl J. Van Arsdall
Hey everyone, cPickle is raising an ImportError that I just don't quite understand. Before I paste the code, let me explain the application. Basically the part of the application that failed is a function that loads a list of objects from a file using cPickle. This list is a queue of request

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Darren New
Rob Thorpe wrote: > Darren New wrote: >>Rob Thorpe wrote: >>>The values themselves have no type information associated with them. >>int x = (int) (20.5 / 3); > In that case it knew because it could see at compile time. Well, yes. That's the point of static typing. > In general though it doesn't.

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Rob Thorpe
Pascal Costanza wrote: > Matthias Blume wrote: > > Pascal Costanza <[EMAIL PROTECTED]> writes: > >> (slot-value p 'address) is an attempt to access the field 'address in > >> the object p. In many languages, the notation for this is p.address. > >> > >> Although the class definition for person does

Re: __getattribute__ doesn't work on 'type' type for '__class__'

2006-06-20 Thread Maric Michaud
Le Mardi 20 Juin 2006 18:36, Barry Kelly a écrit : > Yet when I try this with the 'type' type, it doesn't work: > > ---8<--- > > >>> x.__class__.__class__ > > > > >>> x.__class__.__getattribute__('__class__') > you're looking for getattr : In [11]: getattr(object, '__class__') Out[12]: In [13]:

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Rob Thorpe
Darren New wrote: > Rob Thorpe wrote: > > The compiler > > relys entirely on the types of the variables to know how to correctly > > operate on the values. The values themselves have no type information > > associated with them. > > int x = (int) (20.5 / 3); > > What machine code operations does t

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Pascal Costanza
Matthias Blume wrote: > Pascal Costanza <[EMAIL PROTECTED]> writes: > >> - In a dynamically typed language, you can run programs successfully >> that are not acceptable by static type systems. > > This statement is false. The example I have given is more important than this statement. > For e

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Joe Marshall
Chris Smith wrote: > Joe Marshall <[EMAIL PROTECTED]> wrote: > > > > Agreed. That is why there is the qualifier `dynamic'. This indicates > > that it is a completely different thing from static types. > > If we agree about this, then there is no need to continue this > discussion. I'm not sure

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread George Neuner
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 checking whether it's in bounds req

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Rob Thorpe
Andreas Rossberg wrote: > Rob Thorpe wrote: > >Andreas Rossberg wrote: > >>Rob Thorpe wrote: > >> > >"A language is latently typed if a value has a property - called it's > >type - attached to it, and given it's type it can only represent values > >defined by a certain class." > >

Re: OS specific command in Python

2006-06-20 Thread diffuser78
I tried the following and it seemed to work import os os.system('') Any comments -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Darren New
Rob Thorpe wrote: > The compiler > relys entirely on the types of the variables to know how to correctly > operate on the values. The values themselves have no type information > associated with them. int x = (int) (20.5 / 3); What machine code operations does the "/" there invoke? Integer divi

  1   2   3   >