Re: Microsoft's Dynamic Languages Runtime (DLR)

2007-05-03 Thread Stefan Scholl
In comp.lang.lisp sturlamolden <[EMAIL PROTECTED]> wrote: > I am curious to know how it performs in comparison to CPython and an > efficient compiled Lisp like CMUCL. Speed is a major problem with You are not allowed to publish .NET benchmarks. :-) -- Web (en): http://www.no-spoon.de/ -*- Web (

Re: Microsoft's Dynamic Languages Runtime (DLR)

2007-05-03 Thread Edi Weitz
On Thu, 3 May 2007 09:20:22 +0200, Stefan Scholl <[EMAIL PROTECTED]> wrote: > You are not allowed to publish .NET benchmarks. :-) I'm pretty sure that only applied to their beta releases. -- Lisp is not dead, it just smells funny. Real email: (replace (subseq "[EMAIL PROTECTED]" 5) "edi") --

Re: pack/unpack zero terminated string

2007-05-03 Thread tmp123
On May 2, 11:13 pm, John Machin <[EMAIL PROTECTED]> wrote: > On May 3, 12:01 am, Laurent Pointal <[EMAIL PROTECTED]> wrote: > > > > > > > > >tmp123a écrit : > > > > Hello, > > > > Thanks for your time. > > > > After review the "struct" documentation, it seems there are no option > > > to pack/unpac

Re: test

2007-05-03 Thread per9000
On 2 Maj, 05:19, "Robert Rawlins - Think Blue" <[EMAIL PROTECTED]> wrote: [...] I like comp.lang.python - it is a friendly place. See this post on the C-list and compare: http://groups.google.se/group/comp.lang.c/browse_thread/thread/0a4e2e194a6da45b [:)]-|--< /Per -- Per Erik Strandberg .NET

Re: FInd files with .so extension

2007-05-03 Thread mailme . gurpreet
On May 3, 9:58 am, pradeep nair <[EMAIL PROTECTED]> wrote: > HI, > > How do i find files with .so extension using python . Hi pradeep This piece of code should help you import os,re def findfile(filepattern, base = '.'): regex = re.compile(filepattern) matches = [] for root,d

Searching for a piece of string

2007-05-03 Thread saif . shakeel
Hi, How can i match a part of string and branch to some part of code. Ex If there is a string like "Timeout" and i want to search only whether the word "Time" is present in it(which is valid in this case).so if i have "CastinTime",still this should hold. I need to use this in a "if" statemen

Re: Searching for a piece of string

2007-05-03 Thread Ant
On May 3, 8:35 am, [EMAIL PROTECTED] wrote: > Hi, > How can i match a part of string and branch to some part of code. > Ex If there is a string like "Timeout" and i want to search only > whether the word "Time" is present in it(which is valid in this > case).so if i have "CastinTime",still this

Re: Searching for a piece of string

2007-05-03 Thread rishi pathak
s="CastinTime" if s.find("Time") != -1: print "found" else: print "not found" On 3 May 2007 00:35:57 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi, How can i match a part of string and branch to some part of code. Ex If there is a string like "Timeout" and i want to search on

passing an array of variant in vb to a python COM object = win32com bug ?

2007-05-03 Thread vml
I have a python com object which contains a method to inverse an array in vb 6 the definition of the class is : class Fop: _public_methods_ = [ 'SqVal' ] def SqVal(self,*val): #vol=(val[0][0],val[0][1]) #mat1=mat((vol)) #up=linalg.inv(mat1) return str(val)#u

Re: python,win32com,scipy and vb 6 : no module named scipy

2007-05-03 Thread vml
On 3 mai, 03:30, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > scipy is a 3rd party package which I believe you get from the same place, > more or less, as numpy. the bug was between the chair and the keyboard;) -- http://mail.python.org/mailman/listinfo/python-list

Re: Responding to Trolls [was Re: ignorance and intolerance in computing communties]

2007-05-03 Thread Michele Dondi
On Thu, 03 May 2007 14:54:21 +1000, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >Subject: Responding to Trolls [was Re: ignorance and intolerance in computing >communties] Nope. No way. Michele -- {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr (($a||=join'',map--$|x$_,(unpack'w',u

Re: Video: Professor of Physics, Phd at Cal Tech says: 911 Inside Job

2007-05-03 Thread SuperM
On 2 May 2007 22:26:07 -0700, [EMAIL PROTECTED] Gave us: >> >> >http://www.911blogger.com/node/8101 >> What a lard ass... no wonder the Navy got rid of him. And he isn't from cal tech, he "teaches" in Iowa. Also, being a physicist, does NOT make him, in any way shape or form, a structural e

Re: how to use Dispatch to open an application in win32com.client

2007-05-03 Thread Peter Fischer
Hello Tim, Thank you for your answer. I just tried, but it didn't work. The reason seems to be that Google Earth prevents a second instance to run on the same machine. Maybe for licensing reasons (do you know whether it is legal to bypass this and how to do this?). So that is no python/COM problem

Re: Microsoft's Dynamic Languages Runtime (DLR)

2007-05-03 Thread Duncan Booth
Pascal Costanza <[EMAIL PROTECTED]> wrote: > That still doesn't explain what DLR actually does. You can implement > these languages on top of the JVM as well. You could implement them on > any Turing-complete language, for that matter. The interesting question > how well integrated such an impl

Re: Slicing Arrays in this way

2007-05-03 Thread Michael Hoffman
John Machin wrote: > On May 3, 10:21 am, Michael Hoffman <[EMAIL PROTECTED]> wrote: >> Tobiah wrote: >> >>> >>> elegant_solution([1,2,3,4,5,6,7,8,9,10]) >>> [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]] >> That's not an array, it's a list. See the array module for arrays >> (fixed-length, unlike varia

Re: Lazy evaluation: overloading the assignment operator?

2007-05-03 Thread Antoon Pardon
On 2007-05-03, Terry Reedy <[EMAIL PROTECTED]> wrote: > > "sturlamolden" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >| >| Python allows the binding behaviour to be defined for descriptors, >| using the __set__ and __get__ methods. I think it would be a major >| advantage if this

Re: Refreshing imported modules

2007-05-03 Thread sykora
On May 2, 7:24 pm, [EMAIL PROTECTED] wrote: > I have the python interperter opened while editing a module. The > problem is that when I make changes, the module is not refreshed > whenever I import it again. I have to re-launch the interpreter, is > there a way to shortcut this? I believe you can

Re: how to use Dispatch to open an application in win32com.client

2007-05-03 Thread Tim Golden
Peter Fischer wrote: > Thank you for your answer. I just tried, but it didn't work. The reason seems > to > be that Google Earth prevents a second instance to run on the same machine. > Maybe for licensing reasons (do you know whether it is legal to bypass this > and how to do this?). Don't know

problem with meteo datas

2007-05-03 Thread [EMAIL PROTECTED]
Messaggio originale Da: [EMAIL PROTECTED] Data: 3-mag-2007 10.02 A: Ogg: problem with meteo datas Hello, I'm Peter and I'm new in python codying and I'm using parsying to extract data from one meteo Arpege file. This file is long file and it's composed by word and number arguments l

assigning to __class__ for an extension type: Is it still possible?

2007-05-03 Thread gregory . lielens
Hello, We are currently writing python bindings to an existing C++ library, and we encountered a problem that some of you may have solved (or that has found unsolvable :( ): A C++ class (let's call it CClass) is binded using classical Python extension API to _PClass, which is accesible through py

32 OS on 64-bit machine

2007-05-03 Thread SamG
If anyone has a x86_64 machine and is running a 32bit OS on top of that could you tell me what output would you get for the following program #== import platform print platform.processor() print platform.architecture() #== Thanks in advance : )~ -- ht

Using Bessel Functions

2007-05-03 Thread amit soni
Hi, I want to use Bessel functions in Python. I found on internet that package Scipy has a function jn(x), but I'm not able to use it. I am importing scipy and numpy for using it. But i'm getting an error "NameError: name 'j1' is not defined". Can anyone tell me what is the exact syntax for to us

Re: Lazy evaluation: overloading the assignment operator?

2007-05-03 Thread sturlamolden
On May 3, 6:22 am, Charles Sanders <[EMAIL PROTECTED]> wrote: > y = a*b+c*d # Returns a proxy object > > x = y[4] # Computes x = a[4]*b[4] + c[4]*d[4] > > v = y.eval() # Evaluates all elements, returning Xarray > > z = ((a+b)*(c+d)).eval() # Also evaluates

Re: Why are functions atomic?

2007-05-03 Thread Duncan Booth
[EMAIL PROTECTED] (Alex Martelli) wrote: >> Is there a reason for using the closure here? Using function >> defaults seems to give better performance: > > What measurements show you that...? > ... > > brain:~ alex$ python -mtimeit -s'import powi; p=powi.powerfactory1(3)' > 'p(27)' > 100 lo

Re: 32 OS on 64-bit machine

2007-05-03 Thread Harald Karner
SamG wrote: > If anyone has a x86_64 machine and is running a 32bit OS on top of > that could you tell me what output would you get for the following > program > > #== > import platform > print platform.processor() > print platform.architecture() > #== >

Re: Using Bessel Functions

2007-05-03 Thread Dave
amit soni gmail.com> writes: > Can anyone tell me what is the exact syntax for to use it. > Thank you,Amit > For example evaluating j1 @ 0 from scipy import special print special.j1(0) HTH, Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: 32 OS on 64-bit machine

2007-05-03 Thread SamG
On May 3, 2:58 pm, Harald Karner <[EMAIL PROTECTED]> wrote: > SamG wrote: > > If anyone has a x86_64 machine and is running a 32bit OS on top of > > that could you tell me what output would you get for the following > > program > > > #== > > import platform > > print platfor

Re: 32 OS on 64-bit machine

2007-05-03 Thread king kikapu
I have at home an AMD Turion 64 and using Ubuntu. You may be interested on this, i will post here the results when i get back home! -- http://mail.python.org/mailman/listinfo/python-list

Re: ignorance and intolerance in computing communties

2007-05-03 Thread fireblade
> As i have indicated in my post, it is non-trivial to implement a > function that returns the positive angle of a vector. For example, it > can be done with sign checking of the coordinate components (in total > 4 cases, which can be done as 2 levels of nesting if, or simply 4 > if.), and or the

Re: 32 OS on 64-bit machine

2007-05-03 Thread Mattia Gentilini (CNAF)
SamG ha scritto: > If anyone has a x86_64 machine and is running a 32bit OS on top of > that could you tell me what output would you get for the following > program I have a Athlon64 X2 with Debian unstable i386: [EMAIL PROTECTED] pts/0 ~]$ python Python 2.4.4 (#2, Apr 26 2007, 00:02:45) [GCC 4

Re: How to check if a string is empty in python?

2007-05-03 Thread Dustan
On May 2, 5:50 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Wed, 02 May 2007 13:35:47 -0700, noagbodjivictor wrote: > > How to check if a string is empty in python? > > if(s == "") ?? > > In no particular order, all of these methods will work: > > # test s is equal to another empty string >

Re: ascii to unicode line endings

2007-05-03 Thread fidtz
On 2 May, 17:29, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On 2 May 2007 09:19:25 -0700, [EMAIL PROTECTED] wrote: > > > > >The code: > > >import codecs > > >udlASCII = file("c:\\temp\\CSVDB.udl",'r') > >udlUNI = codecs.open("c:\\temp\\CSVDB2.udl",'w',"utf_16") > > >udlUNI.write(udlASCII.read

Re: win32com.client Excel Color Porblem

2007-05-03 Thread Ray
Thanks a lot!! ici wrote: > My Excel Template :) + Rows > > # -*- encoding:utf-8 -*- > import win32com.client > > try: import psyco; psyco.full() > except ImportError: pass > > try: > app = win32com.client.Dispatch("Excel.Application.11") # Excel > 2003 > except com_error: > try: >

Re: assigning to __class__ for an extension type: Is it still possible?

2007-05-03 Thread gregory . lielens
> We have then added the Py_TPFLAGS_HEAPTYPE tp_flag, which turn _PClass > into a heap > class and should make this class assignment possible... A precision: it seems that just addind Py_TPFLAGS_HEAPTYPE flag in the PyTypeObject tp_flags is not all you have to do to turn a static type into a heap

Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?

2007-05-03 Thread Peter Webb
> Ask yourself WHY havn't I seen this footage before? > > OK, why haven't you seen this footage before? -- http://mail.python.org/mailman/listinfo/python-list

Re: Microsoft's Dynamic Languages Runtime (DLR)

2007-05-03 Thread antoanjamison
On May 2, 8:22 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > On Monday Microsoft announced a new runtime for dynamic languages, > which they call "DLR". It sits on top of the conventional .NET runtime > (CLR) and provides services for dynamically typed languages like > Python or Lisp (thus the cro

Re: ascii to unicode line endings

2007-05-03 Thread Jean-Paul Calderone
On 3 May 2007 04:30:37 -0700, [EMAIL PROTECTED] wrote: >On 2 May, 17:29, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> On 2 May 2007 09:19:25 -0700, [EMAIL PROTECTED] wrote: >> >> >> >> >The code: >> >> >import codecs >> >> >udlASCII = file("c:\\temp\\CSVDB.udl",'r') >> >udlUNI = codecs.open("c

Re: Microsoft's Dynamic Languages Runtime (DLR)

2007-05-03 Thread Duncan Booth
sturlamolden <[EMAIL PROTECTED]> wrote: > I am curious to know how it performs in comparison to CPython and an > efficient compiled Lisp like CMUCL. Speed is a major problem with > CPython but not with .NET or CMUCL, so it will be interesting to see > how the DLR performs in comparison. It would b

Re: Comparing bitmap images for differences?

2007-05-03 Thread Dave Johnston
On May 2, 10:36 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Thanks for the tip for an algorithm - I can see how that could work > really nicely (and it gives me some ideas for other things, too!) > Thanks also for the link to the OpenCV bindings. I'll give 'em a try > and see what happens

Re: passing an array of variant in vb to a python COM object = win32com bug ?

2007-05-03 Thread Gabriel Genellina
En Thu, 03 May 2007 04:54:43 -0300, vml <[EMAIL PROTECTED]> escribió: > I have a python com object which contains a method to inverse an array > in vb 6 the definition of the class is : > > class Fop: > _public_methods_ = [ 'SqVal' ] > def SqVal(self,*val): > #vol=(val[0][0],val[0]

Re: ascii to unicode line endings

2007-05-03 Thread Jerry Hill
On 2 May 2007 09:19:25 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > The code: > > import codecs > > udlASCII = file("c:\\temp\\CSVDB.udl",'r') > udlUNI = codecs.open("c:\\temp\\CSVDB2.udl",'w',"utf_16") > udlUNI.write(udlASCII.read()) > udlUNI.close() > udlASCII.close() > > This doesn't se

Re: Firefighters at the site of WTC7 "Move away the building is going to blow up, get back the building is going to blow up."

2007-05-03 Thread default
On 2 May 2007 20:10:20 -0700, Midex <[EMAIL PROTECTED]> wrote: >LIES LIES LIES LIES LIES Trying to understand the World Trade Center events is like waking up to act fifteen of a long Greek Tragedy. It needs a complex fabric of description to give a full picture. In explaining this crisis, we will

file Error

2007-05-03 Thread saif . shakeel
Hi, I am parsing an xml file,and using raw_input command to ask the user to enter the file name.Ex >>> Enter The ODX File Path: Suppose my code does not work properly,then in the python idle window it shows something like this: >>> C:\Projects\ODX Import\Sample Files\MiscFiles \CIM_A3300_diag

Re: How to check if a string is empty in python?

2007-05-03 Thread Ant
On May 3, 5:59 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > > On Wed, 02 May 2007 21:19:54 -0400, Roy Smith wrote: > > > > for c in s: > > >raise "it's not empty" > > > String exceptions are depreciated and shouldn't be used. > > >http://docs.pytho

Re: Microsoft's Dynamic Languages Runtime (DLR)

2007-05-03 Thread Jean-Paul Calderone
On 3 May 2007 12:13:49 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote: >sturlamolden <[EMAIL PROTECTED]> wrote: > >> I am curious to know how it performs in comparison to CPython and an >> efficient compiled Lisp like CMUCL. Speed is a major problem with >> CPython but not with .NET or CMUCL, so it wi

Re: Lazy evaluation: overloading the assignment operator?

2007-05-03 Thread Antoon Pardon
On 2007-05-03, sturlamolden <[EMAIL PROTECTED]> wrote: > On May 3, 6:22 am, Charles Sanders <[EMAIL PROTECTED]> > wrote: > >> y = a*b+c*d # Returns a proxy object >> >> x = y[4] # Computes x = a[4]*b[4] + c[4]*d[4] >> >> v = y.eval() # Evaluates all elements, returni

Re: passing an array of variant in vb to a python COM object = win32com bug ?

2007-05-03 Thread vml
On 3 mai, 14:20, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 03 May 2007 04:54:43 -0300, vml <[EMAIL PROTECTED]> escribió: > > > > > I have a python com object which contains a method to inverse an array > > in vb 6 the definition of the class is : > > > class Fop: > > _public_meth

Re: ascii to unicode line endings

2007-05-03 Thread fidtz
On 3 May, 13:00, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On 3 May 2007 04:30:37 -0700, [EMAIL PROTECTED] wrote: > > > > >On 2 May, 17:29, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > >> On 2 May 2007 09:19:25 -0700, [EMAIL PROTECTED] wrote: > > >> >The code: > > >> >import codecs > > >

Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?

2007-05-03 Thread Eeyore
Peter Webb wrote: > > Ask yourself WHY havn't I seen this footage before? > > > > > > OK, why haven't you seen this footage before? Nice response ! Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: ascii to unicode line endings

2007-05-03 Thread fidtz
On 3 May, 13:39, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On 2 May 2007 09:19:25 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > The code: > > > import codecs > > > udlASCII = file("c:\\temp\\CSVDB.udl",'r') > > udlUNI = codecs.open("c:\\temp\\CSVDB2.udl",'w',"utf_16") > > udlUNI.write(u

Re: hp 11.11 64 bit python 2.5 build gets error "import site failed"

2007-05-03 Thread bhochstetler
On May 2, 5:09 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > "import site failed" > > OverflowError: signed integer is greater than the maximum. > > > This is happening in the convertsimple() routine when it tries to > > return a signed int: > > > ival = PyInt_AsLong(arg) > > > the ival is l

Re: file Error

2007-05-03 Thread Gabriel Genellina
En Thu, 03 May 2007 09:39:37 -0300, <[EMAIL PROTECTED]> escribió: > Hi, > I am parsing an xml file,and using raw_input command to ask the > user to enter the file name.Ex > > Enter The ODX File Path: > > Suppose my code does not work properly,then in the python idle window > it shows some

Re: Handling Infinite Loops on Server Applications

2007-05-03 Thread Gabriel Genellina
En Wed, 02 May 2007 21:38:52 -0300, Paul Kozik <[EMAIL PROTECTED]> escribió: > I'm working with a small server program I'm writing for a small video > game. The main class constructor starts a thread that handles socket > connections, which itself starts new threads for each user connection. And

Re: file Error

2007-05-03 Thread saif . shakeel
On May 3, 6:09 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 03 May 2007 09:39:37 -0300, <[EMAIL PROTECTED]> escribió: > > > Hi, > > I am parsing an xml file,and using raw_input command to ask the > > user to enter the file name.Ex > > > Enter The ODX File Path: > > > Suppose my

SQLObject 0.7.6

2007-05-03 Thread Oleg Broytmann
Hello! I'm pleased to announce the 0.7.6 release of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started wit

Re: passing an array of variant in vb to a python COM object = win32com bug ?

2007-05-03 Thread Larry Bates
vml wrote: > On 3 mai, 14:20, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >> En Thu, 03 May 2007 04:54:43 -0300, vml <[EMAIL PROTECTED]> escribió: >> >> >> >>> I have a python com object which contains a method to inverse an array >>> in vb 6 the definition of the class is : >>> class Fop: >>>

Re: How to check if a string is empty in python?

2007-05-03 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Ant <[EMAIL PROTECTED]> wrote: > On May 3, 5:59 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > > > On Wed, 02 May 2007 21:19:54 -0400, Roy Smith wrote: > > > > > > for c in s: > > > >raise "it's not empty" > > > >

SQLObject 0.8.3

2007-05-03 Thread Oleg Broytmann
Hello! I'm pleased to announce the 0.8.3 release of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started wi

Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?

2007-05-03 Thread MooseFET
On May 2, 10:24 pm, Major Quaternion Dirt Quantum <[EMAIL PROTECTED]> wrote: > maybe, "pulled" is just a firefighteresque synonym > for gravity doing its thing -- still not subsumed > in the Standard Model of physicists, so, There. y'know, > sort of like, how it is, pilots refer to going "out" and

Re: My Python annoyances

2007-05-03 Thread Ben Collver
I rewrote my code in Python and I found myself running into many of the same hassles that I run into with other languages: inaccurate and incomplete documentation, a maze of little platform-specific quirks to work around in the base classes, and a macho community of users. The python web site r

Re: Python user group in Portland, OR?

2007-05-03 Thread Ben Collver
bradallen wrote: > I would be happy to meet with you and any other Portland Python > programmers to talk about ideas for organizing a user group. > There is also some good discussion about it on the Python Advocacy > the mailing list, because PSF has begun an effort to foster and > promote > user g

Sybase module 0.38 released

2007-05-03 Thread Sébastien Sablé
WHAT IS IT: The Sybase module provides a Python interface to the Sybase relational database system. It supports all of the Python Database API, version 2.0 with extensions. The module is available here: http://downloads.sourceforge.net/python-sybase/python-sybase-0.38.tar.gz The module home p

pyscripter to slow

2007-05-03 Thread Gigs_
I have some problem with pyscripter. Sometimes when I type pyscripter get to slow (i type 10 chars and pyscripter needs 5 seconds to complete this). This happens mostly on deleting some chars. It is very frustrating. Does someone have same situation? btw My comp is amd athlon x2 4000 2mb cache

newbie: copy base class fields

2007-05-03 Thread tmp123
Hello, Thanks for your time. The following small program gives an error: #!/usr/bin/python # class A: def __init__(self): self.v1=1 def __repr__(self): return "v1=%d\n" % self.v1 class B(A): def __init__(self,a): self=a self.v2=2 def __repr__(self): return A.__r

Re: SQLObject 0.8.3

2007-05-03 Thread Jorge Godoy
Oleg Broytmann <[EMAIL PROTECTED]> writes: > * Fixed sqlbuilder - .startswith(), .endswith() and .contains() assumed > their parameter must be a string; now you can pass an SQLExpression: > Table.q.name.contains(func.upper('a')), for example. Oleg, this made me think: is it possible to call

Re: My Python annoyances

2007-05-03 Thread Paul Boddie
On 3 Mai, 15:49, Ben Collver <[EMAIL PROTECTED]> wrote: > I rewrote my code in Python and I found myself running into many of the > same hassles that I run into with other languages: inaccurate and > incomplete documentation, a maze of little platform-specific quirks to > work around in the base cl

How to replace the last (and only last) character in a string?

2007-05-03 Thread Johny
Let's suppose s='12345 4343 454' How can I replace the last '4' character? I tried string.replace(s,s[len(s)-1],'r') where 'r' should replace the last '4'. But it doesn't work. Can anyone explain why? Thanks L. -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie: copy base class fields

2007-05-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, tmp123 wrote: > The following small program gives an error: > > #!/usr/bin/python > # > > class A: > def __init__(self): > self.v1=1 > > def __repr__(self): > return "v1=%d\n" % self.v1 > > class B(A): > def __init__(self,a): > self=a > self.v2=2

Re: sqlite for mac?

2007-05-03 Thread Daniel Nogradi
> > >> Does sqlite come in a mac version? > > > > > The interface (pysqlite) is part of the python 2.5 standard library > > > but you need to install sqlite itself separately (as far as I > > > remember) fromwww.sqlite.org > > > > http://developer.apple.com/documentation/MacOSX/Conceptual/OSX_Techn

Re: ascii to unicode line endings

2007-05-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, fidtz wrote: import codecs testASCII = file("c:\\temp\\test1.txt",'w') testASCII.write("\n") testASCII.close() testASCII = file("c:\\temp\\test1.txt",'r') testASCII.read() > '\n' > Bit pattern on disk : \0x0D\0x0A testASCII.seek(0) te

Re: How to replace the last (and only last) character in a string?

2007-05-03 Thread kyosohma
On May 3, 9:27 am, Johny <[EMAIL PROTECTED]> wrote: > Let's suppose > s='12345 4343 454' > How can I replace the last '4' character? > I tried > string.replace(s,s[len(s)-1],'r') > where 'r' should replace the last '4'. > But it doesn't work. > Can anyone explain why? > > Thanks > L. I think the

getmtime in 2.5 reports GMT instead of local time

2007-05-03 Thread Josef Dalcolmo
Hello, I have tried this only on Windows XP. in Python 2.4 os.path.getmtime() used to return an integer representing the local time. in Python 2.5 os.path.getmtime() reports a float representing the GMT of the file's modification time. Since I could not find any documentation to this behavioura

Library Naming

2007-05-03 Thread Trans
I'm taking a pole on how best to name programming library packages. If you have a second, please have a look. http://7ranscode.blogspot.com/2007/05/library-poll.html Thanks, T. -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie: copy base class fields

2007-05-03 Thread tmp123
On May 3, 4:29 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > > #!/usr/bin/python > > # > > > class A: > > def __init__(self): > > self.v1=1 > > > def __repr__(self): > > return "v1=%d\n" % self.v1 > > > class B(A): > > def __init__(self,a): > > self=a > > self.v

Re: How to replace the last (and only last) character in a string?

2007-05-03 Thread Johny
On May 3, 4:37 pm, [EMAIL PROTECTED] wrote: > On May 3, 9:27 am, Johny <[EMAIL PROTECTED]> wrote: > > > Let's suppose > > s='12345 4343 454' > > How can I replace the last '4' character? > > I tried > > string.replace(s,s[len(s)-1],'r') > > where 'r' should replace the last '4'. > > But it doesn't

Re: How to replace the last (and only last) character in a string?

2007-05-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Johny wrote: > Let's suppose > s='12345 4343 454' > How can I replace the last '4' character? > I tried > string.replace(s,s[len(s)-1],'r') > where 'r' should replace the last '4'. > But it doesn't work. > Can anyone explain why? Because you can't change strings. Any fun

Re: How to replace the last (and only last) character in a string?

2007-05-03 Thread jay graves
On May 3, 9:27 am, Johny <[EMAIL PROTECTED]> wrote: > Let's suppose > s='12345 4343 454' > How can I replace the last '4' character? > I tried > string.replace(s,s[len(s)-1],'r') > where 'r' should replace the last '4'. > But it doesn't work. > Can anyone explain why? Instead of doing it that way

Re: ignorance and intolerance in computing communties

2007-05-03 Thread Xah Lee
Xah Lee wrote: « ... “Ignorance And Intolerance In Online Computing Communities” http://xahlee.org/Netiquette_dir/ignorance_intolerance.html ... As i have indicated in my post, it is non-trivial to implement a function that returns the positive angle of a vector » I have now coded this. I th

Re: newbie: copy base class fields

2007-05-03 Thread Alex Martelli
tmp123 <[EMAIL PROTECTED]> wrote: ... > It seems that the statement "self=a" is not the correct way to copy > all the fields of the base class from the __init__ argument to the new > object. Indeed, it isn't. Assigning to self just rebinds the name 'self' as a local variable of method B.__init

Re: How to replace the last (and only last) character in a string?

2007-05-03 Thread Matimus
On May 3, 7:44 am, Johny <[EMAIL PROTECTED]> wrote: > On May 3, 4:37 pm, [EMAIL PROTECTED] wrote: > > > > > On May 3, 9:27 am, Johny <[EMAIL PROTECTED]> wrote: > > > > Let's suppose > > > s='12345 4343 454' > > > How can I replace the last '4' character? > > > I tried > > > string.replace(s,s[len(s

Re: Can I use Python instead of Joomla?

2007-05-03 Thread walterbyrd
On May 2, 5:38 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > You're mixing apples, fishes, and cars here. Joomla is a content > management system, Django a framework and Python a language. Yes, I know, but they are all ways to create a website. If I wanted a site which included galleries,

Re: newbie: copy base class fields

2007-05-03 Thread Jerry Hill
On 3 May 2007 07:14:04 -0700, tmp123 <[EMAIL PROTECTED]> wrote: > Of course, it is not an option to copy one by one all the fields of > class A inside the __init__ of B. Is it okay to copy them all at once? Like this: class B(A): def __init__(self, a): self.__dict__.update(a.__dict__

Re: 32 OS on 64-bit machine

2007-05-03 Thread MrJean1
$ python Python 2.5c1 (r25c1:51305, Sep 12 2006, 08:39:50) [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-54)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import platform >>> print platform.processor() x86_64 >>> print platform.architecture() ('64bit', 'ELF') >>>

Re: ignorance and intolerance in computing communties

2007-05-03 Thread Ignoramus12143
It is not that difficult to those of us who know math. Obvious analogy to the function below exists in 'perl'. double vectorAngle( double x, double y ) { double r2 = x*x+y*y; if( r2 == 0 ) return -10; // error case int quadrant = x > 0 ? (y >= 0 : 0 : 3) : (y > 0 ? 1 : 2); return pi/2

Re: Microsoft's Dynamic Languages Runtime (DLR)

2007-05-03 Thread Alex Martelli
Duncan Booth <[EMAIL PROTECTED]> wrote: > means in pure Python code the string has python methods, but in Python > using the CLR it gains the CLR methods. Presumably in Ruby code it looks > like a Ruby string and so on, but (and this is what's new) it is the same > object, not a bunch of language

_csv.Error: string with NUL bytes

2007-05-03 Thread fscked
Anyone have an idea of what I might do to fix this? I have googled adn can only find some random conversations about it that doesn't make sense to me. I am basically reading in a csv file to create an xml and get this error. I don't see any empty values in any fields or anything... -- http://ma

Re: My Python annoyances

2007-05-03 Thread kyosohma
On May 3, 9:27 am, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 3 Mai, 15:49, Ben Collver <[EMAIL PROTECTED]> wrote: > > > I rewrote my code in Python and I found myself running into many of the > > same hassles that I run into with other languages: inaccurate and > > incomplete documentation, a maz

Re: How to replace the last (and only last) character in a string?

2007-05-03 Thread Grant Edwards
On 2007-05-03, Johny <[EMAIL PROTECTED]> wrote: > Let's suppose > s='12345 4343 454' > How can I replace the last '4' character? >>> s = '12345 4343 454' >>> s = s[:-1] + 'X' >>> s '12345 4343 45X' -- Grant Edwards grante Yow! Where's th' DAFFY

Re: problem with meteo datas

2007-05-03 Thread Paul McGuire
On May 3, 4:08 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Messaggio originale > Da: [EMAIL PROTECTED] > Data: 3-mag-2007 > 10.02 > A: <[EMAIL PROTECTED]> > Ogg: problem with meteo datas > > Hello, > I'm Peter and I'm new in python codying and I'm using parsying > to > extract data

Article on wxPython ToolKit for Mac OS X

2007-05-03 Thread miah_gbg
Hi there! Just wanted to let people know in this group that I have recently (April 24th) published an introductory article on wxPython and Mac OS X. It is available here: http://www.macdevcenter.com/ Hope someone finds it useful. Regards, Jeremiah -- http://mail.python.org/mailman/listinf

Re: ignorance and intolerance in computing communties

2007-05-03 Thread Frank Buss
Xah Lee wrote: > I'm still interested, if someone would show the source code, of how > Perl, Python, or Lisp or Java, implement the function that finds the > angle of a complex number. So you have forgotten to cross-post to comp.lang.java :-) I think at least for strict floating-point Java uses

Re: Any way to refactor this?

2007-05-03 Thread John Salerno
Steven D'Aprano wrote: > Bruno's code has two micro-optimizations. The first is to avoid > looking up visual.cylinder each time (six times the number of loops) and > instead only look it up once. Oh I see. I was thinking the optimization had something to do with *calling* the function less often

Organizing code - import question

2007-05-03 Thread Brian Blais
Hello, I am trying to organize some of my code, and am having a little trouble with the import logic. I find I often have something like: MyPackage/ Part1/ # wants to use functions in Common/ __init__.py # does "from MyClass1 import MyClass1", etc,... MyClass1.py MyClass

New York City Python Users Group Meeting - Tuesday May 8th

2007-05-03 Thread John Clark
Greetings! The next New York City Python Users Group meeting is this Tuesday, May 8th, 6:30pm at at the Millennium Partners office at 666 Fifth Avenue (53rd St. and 5th Ave.) on the 8th Floor. We welcome all those in the NYC area who are interested in Python to attend. However, we need a list of f

Re: Firefighters at the site of WTC7 "Move away the building is going to blow up, get back the building is going to blow up."

2007-05-03 Thread malibu
On May 3, 12:18 am, Eric Gisse <[EMAIL PROTECTED]> wrote: > On May 2, 10:14 pm, malibu <[EMAIL PROTECTED]> wrote: > > > On May 2, 9:46 pm, Eric Gisse <[EMAIL PROTECTED]> wrote: > > > > On May 2, 7:10 pm, Midex <[EMAIL PROTECTED]> wrote: > > > > [...] > > > > I guess the explanation that people were

Re: Organizing code - import question

2007-05-03 Thread Carlos Hanson
On May 3, 8:41 am, Brian Blais <[EMAIL PROTECTED]> wrote: > Hello, > > I am trying to organize some of my code, and am having a little trouble with > the > import logic. I find I often have something like: > > MyPackage/ > Part1/ # wants to use functions in Common/ > __init__.py # does

Re: ignorance and intolerance in computing communties

2007-05-03 Thread Roel Schroeven
Xah Lee schreef: > Xah Lee wrote: > « > ... > “Ignorance And Intolerance In Online Computing Communities” > http://xahlee.org/Netiquette_dir/ignorance_intolerance.html > > ... As i have indicated in my post, it is non-trivial to implement a > function that returns the positive angle of a vector..

Re: pyscripter to slow

2007-05-03 Thread Larry Bates
Gigs_ wrote: > I have some problem with pyscripter. > Sometimes when I type pyscripter get to slow (i type 10 chars and > pyscripter needs 5 seconds to complete this). This happens mostly on > deleting some chars. > > It is very frustrating. > > Does someone have same situation? > > btw > My com

Re: _csv.Error: string with NUL bytes

2007-05-03 Thread Larry Bates
fscked wrote: > Anyone have an idea of what I might do to fix this? I have googled adn > can only find some random conversations about it that doesn't make > sense to me. > > I am basically reading in a csv file to create an xml and get this > error. > > I don't see any empty values in any fields

Re: _csv.Error: string with NUL bytes

2007-05-03 Thread fscked
On May 3, 9:11 am, Larry Bates <[EMAIL PROTECTED]> wrote: > fscked wrote: > > Anyone have an idea of what I might do to fix this? I have googled adn > > can only find some random conversations about it that doesn't make > > sense to me. > > > I am basically reading in a csv file to create an xml an

  1   2   3   >