Re: Python database access

2006-06-28 Thread Steve Holden
Damjan wrote: >>The odbc module is part of the Python Standard Library. > > > Since when? > > Nope, it's a standard part of Mark Hammond's win32all extensions. As such it probably comes with ActivePython for Windows, which many people use as their standard distro. regards Steve -- Steve

Re: to py or not to py ?

2006-06-28 Thread Steve Holden
Serge Orlov wrote: > On 6/27/06, Chandrashekhar kaushik <[EMAIL PROTECTED]> wrote: [...] >>also is it actually a good idea to write high perf applications in python ? > > > Take a look at Mercurial sources. > It's a high performance python application. Or watch

Re: [W2k, wxPython 2.6.1.0] - MDISashDemo bug?

2006-06-28 Thread Steve Holden
w.p. wrote: > Steve Holden wrote: > > >>Well done! Do you know how to feed this information on to the developers >>(probably Robin Dunn)? All such changes are valuable. >> > > > Hmm... i dont know. wxpython.org -> "submit a patch" or "Report a bug" ? > > w.p. Either of those would do, since

Re: languages with full unicode support

2006-06-28 Thread Tim Roberts
"Xah Lee" <[EMAIL PROTECTED]> wrote: >Languages with Full Unicode Support > >As far as i know, Java and JavaScript are languages with full, complete >unicode support. That is, they allow names to be defined using unicode. >(the JavaScript engine used by FireFox support this) > >As far as i know, h

Re: a class variable question

2006-06-28 Thread Pierre Quentel
Erik Max Francis wrote: > Note this only changes the attribute in the instance. If he wants it to > be changed for all other instances, he needs to change it in the class > with:: A._var1 = 1 Yes, but in the OP's code func1() is called by __init__ for every instance - which in fact makes declari

Re: to py or not to py ?

2006-06-28 Thread Chandrashekhar kaushik
okay so much for a few spelling errors and abbreviations used by me !!we are losing the main point !i had a look at mercurial . It deals with SCM . I am typically looking at an application thats to deal with geometry data ( tetras ) , process millions of them and may be process them repeatedly ( i

Immutability

2006-06-28 Thread Nick Maclaren
The way that I read it, Python allows only values (and hence types) to be immutable, and not class members. The nearest approach to the latter is to use the name hiding conventions. Is that correct? Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

documentation for the change of Python 2.5

2006-06-28 Thread bussiere
I've read thsi documentation n: http://docs.python.org/dev/whatsnew/whatsnew25.html is there a way to have it in a more printable form ? Regards Bussiere -- http://mail.python.org/mailman/listinfo/python-list

Re: global name is not defined - error - but for array

2006-06-28 Thread Fredrik Lundh
"a" <[EMAIL PROTECTED]> wrote: > def fn(): > for i in range(l) > global count > count[i]= > > how do i declare count to be global if it is an array a couple of notes: 1) global statements should be placed at the top of the function 2) objects don't appear out of now

Re: to py or not to py ?

2006-06-28 Thread Robert Kern
Chandrashekhar kaushik wrote: > pyton does allow this using cPickle , but it bloats the data like > anythin !!! > for example a class containing 2 integers which i expect will be 8 bytes > long .. > cPickle.dumps returns a string thats 86 bytes wide ( this is the > binary version protocol 1

How to measure execution time of a program

2006-06-28 Thread Girish Sahani
Hi all, Can anyone tell me the simplest way to do it (some code snippet that could be included in the program's main function) ?? Thanks, girish -- http://mail.python.org/mailman/listinfo/python-list

Re: Immutability

2006-06-28 Thread Robert Kern
Nick Maclaren wrote: > The way that I read it, Python allows only values (and hence types) > to be immutable, and not class members. The nearest approach to the > latter is to use the name hiding conventions. > > Is that correct? You can also make properties that don't allow writing. class Foo(

Re: How to measure execution time of a program

2006-06-28 Thread Fredrik Lundh
Girish Sahani wrote: > Can anyone tell me the simplest way to do it (some code snippet that > could be included in the program's main function) ?? simplest way: t0 = time.time() main() print time.time() - t0, "seconds" (assuming that you want to measure wall time, and that your prog

Re: How to measure execution time of a program

2006-06-28 Thread Girish Sahani
Sorry for spamming again, but please also enlighten me with some way to time a function i.e. to find out how much time each function takes for execution in a big program. > Hi all, > > Can anyone tell me the simplest way to do it (some code snippet that > could be included in the program's main f

Re: Problem with sets and Unicode strings

2006-06-28 Thread Laurent Pointal
Dennis Benzinger a écrit : > No, byte strings contain characters which are at least 8-bit wide > . But I don't understand what > Python is trying to decode and why the exception says something about > the ASCII codec, because my file is encoded with UTF-8. [a

Re: Function to prune dictionary keys not working

2006-06-28 Thread Steve Holden
Girish Sahani wrote: > hi ppl, > Here is a simple function to remove those keys of a dictionary whose > values are less than some specified value. But it isnt working. Please > help. > Besides all the good advice you've been given about not expecting string/float comparisons to be meaningful, re

Re: to py or not to py ?

2006-06-28 Thread Robert Kern
Chandrashekhar kaushik wrote: > okay > so much for a few spelling errors and abbreviations used by me !! > we are losing the main point ! > i had a look at mercurial . It deals with SCM . I am typically > looking at an application thats to deal with geometry data ( tetras ) , > process millions of

Re: error in ConfigParser

2006-06-28 Thread Steve Holden
pipehappy wrote: > Hello everyone: > > I came across the module ConfigParser and can use it correctly. > > import ConfigParser > fp = open('test.cfg','w+') > config = ConfigParser.ConfigParser() > config.readfp(fp) > config.add_section('test') > config.set('test', 'haha', 'hehe') > print config.s

Beginner question? Classes, variables, ...

2006-06-28 Thread Ángel Gutiérrez Rodríguez
The problem: I have two classes: class X: def __init__(self): pass class Y: def __init__(self): self.a=1 self.b=X() and I would like to make 'a' visible inside 'x'. Is there a way to refer to the Y class from the X? To make things easier :), each class is in a different file, s

Re: a class variable question

2006-06-28 Thread Steve Holden
Erik Max Francis wrote: [...] > All you're doing in your example is setting a local variable inside the > func1 method, which has no effect. > I think EMF was thinking, but failed to write, "outside the function" at the end of that sentence ;-) regards Steve -- Steve Holden +44 150 684

Re: Immutability

2006-06-28 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, Robert Kern <[EMAIL PROTECTED]> writes: |> Nick Maclaren wrote: |> > The way that I read it, Python allows only values (and hence types) |> > to be immutable, and not class members. The nearest approach to the |> > latter is to use the name hiding conventions. |> >

Re: global name is not defined - error - but for array

2006-06-28 Thread Steve Holden
a wrote: > def fn(): > for i in range(l) >global count >count[i]= > > how do i declare count to be global if it is an array > > subsequently i should access or define count as an array > > error: > global name 'count' is not defined > The questions you are aski

Re: How to measure execution time of a program

2006-06-28 Thread Pete Forman
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > simplest way: > > t0 = time.time() You can get better resolution by using time.clock() instead of time.time(). -- Pete Forman-./\.- Disclaimer: This post is originated WesternGeco -./\.- by myself and does no

Re: How to measure execution time of a program

2006-06-28 Thread Fredrik Lundh
Pete Forman wrote: > > t0 = time.time() > > You can get better resolution by using time.clock() instead of > time.time(). depends on the platform, and whether you want wall time or process time. -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner question? Classes, variables, ...

2006-06-28 Thread Diez B. Roggisch
Ángel Gutiérrez Rodríguez wrote: > The problem: > > I have two classes: > > class X: > def __init__(self): > pass > > class Y: > def __init__(self): > self.a=1 > self.b=X() > > and I would like to make 'a' visible inside 'x'. Is there a way to refer > to the Y class from the X

Re: Immutability

2006-06-28 Thread Georg Brandl
Nick Maclaren wrote: > In article <[EMAIL PROTECTED]>, > Robert Kern <[EMAIL PROTECTED]> writes: > |> Nick Maclaren wrote: > |> > The way that I read it, Python allows only values (and hence types) > |> > to be immutable, and not class members. The nearest approach to the > |> > latter is to use t

Re: Questions about OSS projects.

2006-06-28 Thread Daniel Dittmar
bio_enthusiast wrote: > I was wondering how to go about starting an open source project for > doing routine biological problems? There is a plethora of scripts and > a fairly large biopython project to back up anyone who tried, these > however cater to the bioinformatics community and it loses the

Re: How to disable tk inclusion in py build

2006-06-28 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: >> since _tkinter.so is only built if it's found by the setup script, >> and if built, it's only loaded if you actually use it, why bother >> "disabling" it ? > > I don't want it to build tk into the py dist, even if it finds it on > the build box - its not needed in the d

Re: Beginner question? Classes, variables, ...

2006-06-28 Thread Diez B. Roggisch
Dennis Lee Bieber wrote: > On Wed, 28 Jun 2006 10:35:10 +0200, "Diez B. Roggisch" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > >> class X: >> def __init__(self, my_y): >> self.my_y > self.my_y = my_y *argl* Thanks :) No tea so far... Diez -- http://mail.python.o

Re: How to measure execution time of a program

2006-06-28 Thread Wolfram Kraus
On 28.06.2006 10:01, Girish Sahani wrote: > Sorry for spamming again, but please also enlighten me with some way to > time a function i.e. to find out how much time each function takes for > execution in a big program. >> Hi all, >> >> Can anyone tell me the simplest way to do it (some code snipp

Re: Help Installing smartypants.py

2006-06-28 Thread Paul McGuire
"Scott McCracken" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I just got Python 2.4 setup locally (Mac OS X) and am trying to extend > it by installing both the markdown and smartypants plugins. Ultimately > I'd like to be able use both in a custom CMS I'm building with Django. >

Re: Immutability

2006-06-28 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, Georg Brandl <[EMAIL PROTECTED]> writes: |> > |> > Thanks very much. And, what's more, I have even found its documentation! |> > Whatsnew2.2. The 2.4.2 reference is, er, unhelpful. |> |> Is it? |> |> http://docs.python.org/lib/built-in-funcs.html |> |> documen

Re: documentation for the change of Python 2.5

2006-06-28 Thread Serge Orlov
On 6/28/06, bussiere <[EMAIL PROTECTED]> wrote: > I've read thsi documentation n: > http://docs.python.org/dev/whatsnew/whatsnew25.html > is there a way to have it in a more printable form ? Yep: http://www.python.org/ftp/python/doc/2.5b1/ -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-28 Thread Joachim Durchholz
Paul Rubin schrieb: > It starts to look like sufficiently powerful static type systems are > confusing enough, that programming with them is at least as bug-prone > as imperative programming in dynamically typed languages. The static > type checker can spot type mismatches at compile time, but the

Re: languages with full unicode support

2006-06-28 Thread Joachim Durchholz
Tim Roberts schrieb: > "Xah Lee" <[EMAIL PROTECTED]> wrote: >> C ? No. > > This is implementation-defined in C. A compiler is allowed to accept > variable names with alphabetic Unicode characters outside of ASCII. Hmm... that could would be nonportable, so C support for Unicode is half-baked at

Re: What is Expressiveness in a Computer Language [correction]

2006-06-28 Thread Andreas Rossberg
David Hopwood wrote: >> >>>(defun blackhole (argument) >>> (declare (ignore argument)) >>> #'blackhole) > I believe this example requires recursive types. It can also be expressed > in a gradual typing system, but possibly only using an unknown ('?') type. > > ISTR that O'Caml at one point (befor

Re: Questions about OSS projects.

2006-06-28 Thread Paul McGuire
"Daniel Dittmar" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > If you've written a few small scripts that might be of use to others and > that you assume that there are others who do the same, you might start > with a wiki or something like the Python Cookbook > (http://aspn.actives

Re: Immutability

2006-06-28 Thread Diez B. Roggisch
> Sigh. No. It's terrible. What it documents is the use of the property > FUNCTION. It does not document what properties ARE, and how they interact > with the rest of the language. Until you know that, it is so ambiguous > as to be almost totally useless - and it is THAT information that needs

Re: [Pyrex] pyrex functions to replace a method (Re: replace a method in class: how?)

2006-06-28 Thread Bruno Desthuilliers
Greg Ewing wrote: > Brian Blais wrote: > >> I have found a very similar problem trying to replace a method using a >> function defined in pyrex. > > > Functions defined in Pyrex are C-implemented functions, > which don't trigger the method binding magic when you > access them through a class. Th

Re: global name is not defined - error

2006-06-28 Thread Bruno Desthuilliers
a wrote: > What I want > --- > I want to create a list of items from a function operating on an array > of strings def func(s): return s.upper() arrayOfStrings = ['bicycle', 'repair', 'man'] print "solution 1: with map()" print map(func, arrayOfStrings) print "solution 2: with list

Re: how do i make an array global

2006-06-28 Thread Bruno Desthuilliers
a wrote: > def fn(): > for i in range(l) l is not defined - you should have an error here. >global count >count[i]= > > how do i declare count to be global if it is an array Just like it was an integer > subsequently i should access or define count as an array

Re: a class variable question

2006-06-28 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: > hi > i have define a class like this > # class A: class A(object): > _var1 = 0 > def __init__(self): > ## some initialization > self.func1() > # def func1(): def func1(self): > .

Re: Immutability

2006-06-28 Thread Bruno Desthuilliers
Nick Maclaren wrote: > The way that I read it, Python allows only values (and hence types) > to be immutable, I don't understand this sentence. Some types are immutable, some are not. This has nothing to do with "values" (FWIW, everything in Python is an object, there's no 'primitive type' vs 'obj

Re: Immutability

2006-06-28 Thread Sion Arrowsmith
Nick Maclaren <[EMAIL PROTECTED]> wrote: >Georg Brandl <[EMAIL PROTECTED]> writes: >|> [ attributions lost ] >|> > Thanks very much. And, what's more, I have even found its documentation! >|> > Whatsnew2.2. The 2.4.2 reference is, er, unhelpful. >|> Is it? >|> http://docs.python.org/lib/built-in-

Re: [Pyrex] pyrex functions to replace a method (Re: replace a method in class: how?)

2006-06-28 Thread Brian Blais
Greg Ewing wrote: > Brian Blais wrote: >> I have found a very similar problem trying to replace a method using a >> function defined in pyrex. > > > What *should* work is to define the method inside a > class in Pyrex (plain class, not extension type) and > extract it out of the class's __dict__

Re: languages with full unicode support

2006-06-28 Thread David Hopwood
Tim Roberts wrote: > "Xah Lee" <[EMAIL PROTECTED]> wrote: > >>Languages with Full Unicode Support >> >>As far as i know, Java and JavaScript are languages with full, complete >>unicode support. That is, they allow names to be defined using unicode. >>(the JavaScript engine used by FireFox support

Re: What is Expressiveness in a Computer Language

2006-06-28 Thread David Hopwood
Paul Rubin wrote: > David Hopwood <[EMAIL PROTECTED]> writes: > >>Note that I'm not claiming that you can check any desirable property of >>a program (that would contradict Rice's Theorem), only that you can >>express any dynamically typed program in a statically typed language -- >>with static ch

Re: Immutability

2006-06-28 Thread Steve Holden
Georg Brandl wrote: > Nick Maclaren wrote: > >>In article <[EMAIL PROTECTED]>, >>Robert Kern <[EMAIL PROTECTED]> writes: >>|> Nick Maclaren wrote: >>|> > The way that I read it, Python allows only values (and hence types) >>|> > to be immutable, and not class members. The nearest approach to the

Re: Immutability

2006-06-28 Thread Gerard Flanagan
Nick Maclaren wrote: > In article <[EMAIL PROTECTED]>, > Georg Brandl <[EMAIL PROTECTED]> writes: > |> > > |> > Thanks very much. And, what's more, I have even found its documentation! > |> > Whatsnew2.2. The 2.4.2 reference is, er, unhelpful. > |> > |> Is it? > |> > |> http://docs.python.org/li

Re: global name is not defined - error

2006-06-28 Thread a
i changed it to append and it started working but once in a while i m getting l_code.append( len(d_list_code[i]['entries']) ) IndexError: list index out of range but it is not permanent if i refresh, it goes away! Marco Wahl wrote: > "a" <[EMAIL PROTECTED]> writes: > > > What I want > > --

Re: Immutability

2006-06-28 Thread Fredrik Lundh
Sion Arrowsmith wrote: > What I've not seen documented anywhere is the: >@property >def fset(self, value): >... > idiom. It's not obvious from the documentation of the property > function that it can be used as a decorator like this. probably because it cannot be used

Re: languages with full unicode support

2006-06-28 Thread Chris Uppal
Joachim Durchholz wrote: > > This is implementation-defined in C. A compiler is allowed to accept > > variable names with alphabetic Unicode characters outside of ASCII. > > Hmm... that could would be nonportable, so C support for Unicode is > half-baked at best. Since the interpretation of char

Re: Beginner question? Classes, variables, ...

2006-06-28 Thread Ángel Gutiérrez Rodríguez
That wa sneat! Thanks! -- Ángel Gutiérrez Rodríguez - [EMAIL PROTECTED] Instituto de Ciencia de los Materiales de Madrid - CSIC SpLine - European Syncrothorn Radiation Facility - Grenoble - France Postal adress: Departamento de Química Física y Analítica Universidad de Oviedo - c/Julián Claverí

Re: [Pyrex] pyrex functions to replace a method (Re: replace a method in class: how?)

2006-06-28 Thread Stefan Behnel
Hi Brian, Brian Blais wrote: > import module_py # import a function from a python module > import module_pyrex # import a function from a pyrex extension module > > class This(object): > > def update1(self,val): > print val > > def update2(self,val): > print "2",va

Re: [Pyrex] pyrex functions to replace a method (Re: replace a method in class: how?)

2006-06-28 Thread Stefan Behnel
Brian Blais wrote: > Greg Ewing wrote: >> Brian Blais wrote: >>> I have found a very similar problem trying to replace a method using a >>> function defined in pyrex. >> >> What *should* work is to define the method inside a >> class in Pyrex (plain class, not extension type) and >> extract it o

Re: to py or not to py ?

2006-06-28 Thread Chandrashekhar kaushik
> it is going to be multi-threaded.> >... because?one thread listens for incoming requests . as soon as a request arrives ( a connection is made ) the thread verifies the request and starts another thread where the request is processed ( typically  some algorithm is run on the data ).The first thre

Re: What is Expressiveness in a Computer Language

2006-06-28 Thread Pascal Costanza
David Hopwood wrote: > Pascal Costanza wrote: >> David Hopwood wrote: >>> Marshall wrote: >>> The real question is, are there some programs that we can't write *at all* in a statically typed language, because they'll *never* be typable? >>> In a statically typed language that has a "

MySQLdb not updating rows

2006-06-28 Thread Bowen
import md5 import string import MySQLdb tc = raw_input("Teacher Code: ") p = raw_input("New Password: ") print tc hash = md5.new() hash.update(p) print p print hash.hexdigest() h = hash.hexdigest() boo = raw_input("Sure you want to update password with above details? Y or N: ") if boo == 'y':

Re: MySQLdb not updating rows

2006-06-28 Thread Fredrik Lundh
"Bowen" <[EMAIL PROTECTED]> wrote: > boo = raw_input("Sure you want to update password with above details? Y or N: > ") > > if boo == 'y': if you're asking for Y or N, maybe you should check for Y or N ? or better, use something like: if boo.lower() == 'y': ... or even if boo

Re: documentation for the change of Python 2.5

2006-06-28 Thread Martin v. Löwis
bussiere wrote: > I've read thsi documentation n: > http://docs.python.org/dev/whatsnew/whatsnew25.html > is there a way to have it in a more printable form ? Yes. Download http://www.python.org/ftp/python/doc/2.5b1/pdf-a4-2.5b1.tar.bz2 and extract whatsnew25.pdf. Regards, Martin -- http://mai

compiling python (or ironpython) to .exe or .dll for or not for .NET

2006-06-28 Thread per9000
Hi python people, I am working with .NET (in C++/CLI and C#) but since I really love python I'd like to do things for .NET (or whatever) from python. Has anyone tried it? What (costless) compilers are good? Are there any (costless) editors like MS Visual Express you have tried? Is the newest I

Re: MySQLdb not updating rows

2006-06-28 Thread Bowen
Thanks for that, it appears it was the db.commit() that sorted it out.lesson learnt :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Immutability

2006-06-28 Thread Georg Brandl
Steve Holden wrote: >>>Thanks very much. And, what's more, I have even found its documentation! >>>Whatsnew2.2. The 2.4.2 reference is, er, unhelpful. >> >> >> Is it? >> >> http://docs.python.org/lib/built-in-funcs.html >> >> documents "property" quite well. >> > I can't really agree that "

Re: how do i make an array global

2006-06-28 Thread Georg Brandl
Erik Max Francis wrote: > a wrote: > >> def fn(): >> for i in range(l) >>global count >>count[i]= >> >> how do i declare count to be global if it is an array > > count = [...] > > def fn(): > global count > for i in range(l): >

Re: how do i make an array global

2006-06-28 Thread Georg Brandl
Bruno Desthuilliers wrote: > a wrote: >> def fn(): >> for i in range(l) > > l is not defined - you should have an error here. > >>global count >>count[i]= >> >> how do i declare count to be global if it is an array > > Just like it was an integer No. If he's on

Java identifiers (was: languages with full unicode support)

2006-06-28 Thread David Hopwood
Note Followup-To: comp.lang.java.programmer Chris Uppal wrote: > Since the interpretation of characters which are yet to be added to > Unicode is undefined (will they be digits, "letters", operators, symbol, > punctuation ?), there doesn't seem to be any sane way that a language > could > all

Re: Immutability

2006-06-28 Thread Sion Arrowsmith
Fredrik Lundh <[EMAIL PROTECTED]> wrote: >Sion Arrowsmith wrote: >> What I've not seen documented anywhere is the: >>@property >>def fset(self, value): >>... >> idiom. It's not obvious from the documentation of the property >> function that it can be used as a decorator

Re: MySQLdb not updating rows

2006-06-28 Thread Douglas Andrade
Hello Simon,Take a look at this link: http://python.codezoo.com/pub/component/3583 May autocommit (or commit, as Fredrik pointed out) be the solution.On 28 Jun 2006 06:46:54 -0700, Bowen <[EMAIL PROTECTED] > wrote:Thanks for that, it appears it was the db.commit() that sorted itout.lesson learn

Re: MySQLdb not updating rows

2006-06-28 Thread Benjamin Niemann
Bowen wrote: > import md5 > import string > import MySQLdb > > tc = raw_input("Teacher Code: ") > p = raw_input("New Password: ") > > print tc > hash = md5.new() > hash.update(p) > print p > print hash.hexdigest() > h = hash.hexdigest() > > boo = raw_input("Sure you want to update password with

Re: What is Expressiveness in a Computer Language

2006-06-28 Thread David Hopwood
Pascal Costanza wrote: > David Hopwood wrote: >> Pascal Costanza wrote: >>> David Hopwood wrote: Marshall wrote: > The real question is, are there some programs that we > can't write *at all* in a statically typed language, because > they'll *never* be typable? In a

Re: compiling python (or ironpython) to .exe or .dll for or not for .NET

2006-06-28 Thread Alan Franzoni
Il 28 Jun 2006 06:29:58 -0700, per9000 ha scritto: > Is the newest Ironpython really as old as from 2004 July 28 (as stated > on http://www.ironpython.com/)? Ironpython homepage seems long to have been abandoned. Try this: http://www.gotdotnet.com/Workspaces/Workspace.aspx?id=ad7acff7-ab1e-4bcb

Re: compiling python (or ironpython) to .exe or .dll for or not for .NET

2006-06-28 Thread Alan Franzoni
Il 28 Jun 2006 06:29:58 -0700, per9000 ha scritto: > Is the newest Ironpython really as old as from 2004 July 28 (as stated > on http://www.ironpython.com/)? Sorry again, the up to date page is the following one: http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython -- Alan Franzoni <[E

Re: What is Expressiveness in a Computer Language

2006-06-28 Thread Pascal Costanza
David Hopwood wrote: > Pascal Costanza wrote: >> David Hopwood wrote: >>> Pascal Costanza wrote: David Hopwood wrote: > Marshall wrote: > >> The real question is, are there some programs that we >> can't write *at all* in a statically typed language, because >> they'll *nev

Re: How to measure execution time of a program

2006-06-28 Thread Grant Edwards
On 2006-06-28, Pete Forman <[EMAIL PROTECTED]> wrote: > "Fredrik Lundh" <[EMAIL PROTECTED]> writes: > > simplest way: > > > > t0 = time.time() > > You can get better resolution by using time.clock() instead of > time.time(). Oh really? When I do it, time.clock() is worse: ---

Re: MySQLdb not updating rows

2006-06-28 Thread Bowen
Thanks for that tip, it's a simple script that I am experimenting on, planning to build a custon gui for my database. It is definately something for me to note in the future. Thanks again. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-28 Thread Matthias Blume
Pascal Costanza <[EMAIL PROTECTED]> writes: > Whether you consider something you cannot do with statically typed > languages a bad idea or not is irrelevant. You were asking for things > that you cannot do with statically typed languages. The whole point of static type systems is to make sure tha

handling unicode data

2006-06-28 Thread Filipe
Hi all, I'm starting to learn python but am having some difficulties with how it handles the encoding of data I'm reading from a database. I'm using pymssql to access data stored in a SqlServer database, and the following is the script I'm using for testing purposes. -

Re: What is Expressiveness in a Computer Language

2006-06-28 Thread Andreas Rossberg
David Hopwood wrote: > > (In the case of eval, OTOH, > the erroneous code may cause visible side effects before any run-time > error occurs.) Not necessarily. You can replace the primitive eval by compile, which delivers a function encapsulating the program, so you can check the type of the fun

Re: Arrghh... Problems building Python from source on OS X --

2006-06-28 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, "J. Jeffrey Close" <[EMAIL PROTECTED]> wrote: > Hi all, > > I have been trying for some time to build Python 2.4.x > from source on OS X 10.4.6. I've found *numerous* > postings on various mailing lists and web pages > documenting the apparently well-known proble

SimpleXMLRPCServer and client IP address

2006-06-28 Thread Jeremy Monnet
Hello, I've started python a few weeks ago, and to now everything went fine with my cookbook and a learning book. Now, I've tried the SimpleXMLRPCServer, and it worked OK untill I tried to get the client IP address. I have searched a long time the Internet but couldn't find a _simple_ solution :-

Re: How to measure execution time of a program

2006-06-28 Thread Fredrik Lundh
Grant Edwards wrote: >> You can get better resolution by using time.clock() instead of >> time.time(). > > Oh really? When I do it, time.clock() is worse: on Unix, time.clock() is a tick counter; if your process is running when the tick interrupt arrives, the internal counter value is increment

RE: How do you use this list ?

2006-06-28 Thread Michael . Coll-Barth
-Original Message- From: Grant Edwards >>> Actually having mailing lists send you mail is insane. Once upon a time, I would have agreed. However, it is becoming increasingly difficuilt to get to the newgroups directly from the workplace. The only recourse is to use the mailing lists

Re: Immutability

2006-06-28 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, "Gerard Flanagan" <[EMAIL PROTECTED]> writes: |> |> There are (unofficial) documentation wikis here: |> |> pytut.infogami.com |> pyref.infogami.com |> pyfaq.infogami.com Thanks very much. |> You might like to consider adding the information you perce

Re: handling unicode data

2006-06-28 Thread Fredrik Lundh
Filipe wrote: > In the console output, for a record where I expected to see "França" > I'm getting the following: > > "" -When I print the type (print type(row[1])) > "Fran+a" -When I print the "term" variable (print term) > "Fran\xd8a" -When I print all the query results

Re: Immutability

2006-06-28 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, Sion Arrowsmith <[EMAIL PROTECTED]> writes: |> |> Actually, there's an almost throw-away mention in |> http://docs.python.org/ref/descriptor-invocation.html |> which gives you what you need (although not, I have to say, in an |> easily digestible form). Thanks ver

Re: SimpleXMLRPCServer and client IP address

2006-06-28 Thread Fredrik Lundh
Jeremy Monnet wrote: > Tips I've found were : > - use the requestHandler and its method address_string(), but I didn't > an easy to understand example > - http://mail.python.org/pipermail/python-list/2006-May/340266.html > but this thread seems not to have been finished :-( maybe the explanation

Re: Immutability

2006-06-28 Thread Fredrik Lundh
Nick Maclaren wrote: > class fred : >@property >def joe (self) : >print "Inside /joe\n" > > a = fred() > a.joe() > > Traceback (most recent call last): > File "crap.py", line 14, in >a.joe() > TypeError: 'NoneType' object is not callable > > VERY weird - I could understand it

String Question

2006-06-28 Thread diffuser78
mac_string = '001485e55503' (This is the mac address of a computer.) I am using wake on LAN python script to start computer remote.It uses format like this s.sendto('\xff'*6 + '\x00\x014\x85\xe5\x55\x03'*16, ('192.168.1.255', 80)) where '\x00\x14\x85\xe5\x55\x03' is the MAC address to be u

Re: String Question

2006-06-28 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > mac_string = '001485e55503' (This is the mac address of a computer.) > > I am using wake on LAN python script to start computer remote.It uses > format like this > > s.sendto('\xff'*6 + '\x00\x014\x85\xe5\x55\x03'*16, ('192.168.1.255', > 80)) > > where '\x00\x14\x8

Re: String Question

2006-06-28 Thread Iain King
[EMAIL PROTECTED] wrote: > mac_string = '001485e55503' (This is the mac address of a computer.) > > I am using wake on LAN python script to start computer remote.It uses > format like this > > s.sendto('\xff'*6 + '\x00\x014\x85\xe5\x55\x03'*16, ('192.168.1.255', > 80)) > > where '\x00\x14\x8

Re: SimpleXMLRPCServer and client IP address

2006-06-28 Thread Jeremy Monnet
Thanks for your answer ! On 6/28/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > maybe the explanation in that message was good enough for the poster ? I think so ... unfortunately not for me ... yet ! :-) > > Your handler object should be getting set up with the client_address > property. >

Re: how do i make an array global

2006-06-28 Thread Bruno Desthuilliers
Georg Brandl wrote: > Bruno Desthuilliers wrote: > >>a wrote: >> >>>def fn(): >>> for i in range(l) >> >>l is not defined - you should have an error here. >> >> >>> global count >>> count[i]= >>> >>>how do i declare count to be global if it is an array >> >>Just like i

Re: String Question

2006-06-28 Thread diffuser78
Many Thanks!! It worked like a charm. Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > mac_string = '001485e55503' (This is the mac address of a computer.) > > > > I am using wake on LAN python script to start computer remote.It uses > > format like this > > > > s.sendto('\xff'*6 + '\x0

Re: Immutability

2006-06-28 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, "Fredrik Lundh" <[EMAIL PROTECTED]> writes: |> |> a property looks like an attribute, not a method, so you're trying to call whatever |> your "joe()" method returns. Well, yes, that was pretty obvious - but what was NOT obvious is why it should do that for one of

Re: String Question

2006-06-28 Thread diffuser78
I will try this one too...thanks for your response. Iain King wrote: > [EMAIL PROTECTED] wrote: > > mac_string = '001485e55503' (This is the mac address of a computer.) > > > > I am using wake on LAN python script to start computer remote.It uses > > format like this > > > > s.sendto('\xff'*6

Numeric help!

2006-06-28 Thread Sheldon
Hi, I have the following loop that I think can be written to run faster in Numeric. I am currently using Numeric. range_va = [60,61,62,63,64,65,66,67,68,69,70,71,72] main.xsize= 600 main.ysize= 600 #msgva is an (600x600) Numeric array with mutiple occurrences of the values in range_va #sat_id is a

Re: Immutability

2006-06-28 Thread Bruno Desthuilliers
Nick Maclaren wrote: > In article <[EMAIL PROTECTED]>, > Sion Arrowsmith <[EMAIL PROTECTED]> writes: > |> > |> Actually, there's an almost throw-away mention in > |> http://docs.python.org/ref/descriptor-invocation.html > |> which gives you what you need (although not, I have to say, in an > |> ea

Re: Immutability

2006-06-28 Thread Fredrik Lundh
Nick Maclaren wrote: > |> a property looks like an attribute, not a method, so you're trying to call > whatever > |> your "joe()" method returns. > > Well, yes, that was pretty obvious - but what was NOT obvious is why it > should do that for one of two identical methods. identical? you only ap

Re: What is Expressiveness in a Computer Language

2006-06-28 Thread Pascal Costanza
Matthias Blume wrote: > Pascal Costanza <[EMAIL PROTECTED]> writes: > >> Whether you consider something you cannot do with statically typed >> languages a bad idea or not is irrelevant. You were asking for things >> that you cannot do with statically typed languages. > > The whole point of static

Re: Immutability

2006-06-28 Thread Fredrik Lundh
Bruno Desthuilliers wrote: >> class fred : >> @property >> def joe (self) : >> print "Inside /joe\n" > > > properties dont work properly on old-style classes (lookup 'new-style > classes' on python.org, in the documentation menu), hence the strange > behaviour you observe. propert

  1   2   3   >