Re: code is data

2006-06-20 Thread Fredrik Lundh
Kay Schluehr wrote: > If it is just a different kind of representation of common data > structures but how do you know ? -- http://mail.python.org/mailman/listinfo/python-list

Bus error in PyGILState_Release (callbacks from other threads)

2006-06-20 Thread geoffschmidt
[Note: I don't check the mailbox in the header. Please send any correspondence to the address listed below.] 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 callbac

Tail recursion Re: list of polynomial functions

2006-06-20 Thread Pekka Karjalainen
In article <[EMAIL PROTECTED]>, Matteo wrote: >This last approach could, at least theoretically, create an arbitrarily >long list of polys, without overflowing any kind of stack. In practice, >python does not seem to perform tail recursion optimizations, and conks >out after makepolys(997) on my m

Re: [OT] code is data

2006-06-20 Thread Laurent Pointal
Fredrik Lundh a écrit : > Laurent Pointal wrote: > The idea is to have a way to transform a Python (.py) module into XML and then do source code manipulations in XML-space using ElementTree. >>> >>> My my my... I'm not against the idea of dynamic source code >>> transformation, but for h

Re: Function definition

2006-06-20 Thread Duncan Booth
aarondesk wrote: > I have a little .py file that has the format: > > > def fxn(a): > do stuff > > other stuff > ... > r = fxn(a) > > > > Now I've tried putting the function declaration after the call but the > program wouldn't work. Is there anyway to put function declarations at > t

difference between import from mod.func() and x=mod.func()

2006-06-20 Thread Hari Sekhon
What is the difference in terms of efficiency and speed between from os import path and import os path=os.path I would think that the import from would be better, just curious since I read somewhere on the web, some guy's code tutorial where he did the latter and said it was for efficiency/s

Re: crawlers in python with graphing?

2006-06-20 Thread bryan rasmussen
Hi, Sorry, was imprecise, I meant not save the downloaded page locally. There probably isn't one though, so I should build one myself. Probably just need a good crawler that can be set to dump all links into dataset that I can analyse with R. Cheers, Bryan Rasmussen On 6/19/06, Marc 'BlackJack'

Re: Missing fpconst?

2006-06-20 Thread jdec
Hi, I was just looking for fpconst too. I found it on : http://www.warnes.net/rwndown/projects/RStatServer/fpconst Jerome -- http://mail.python.org/mailman/listinfo/python-list

Re: difference between import from mod.func() and x=mod.func()

2006-06-20 Thread Fredrik Lundh
Hari Sekhon wrote: > What is the difference in terms of efficiency and speed between > > from os import path > > and > > import os > path=os.path the only difference is that the former only sets the "path" variable, while the latter leaves both "os" and "path" in your namespace. > I would think

Re: Function definition

2006-06-20 Thread bruno at modulix
faulkner wrote: (pelase don't top-post - fixed) > aarondesk wrote: > (snip) >>Now I've tried putting the function declaration after the call but the >>program wouldn't work. Is there anyway to put function declarations at >>the end of the program, rather than putting them at the beginning, >>which

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

2006-06-20 Thread [EMAIL PROTECTED]
K P S wrote: > Thanks everyone. > routines to list all the files in a zip archive, but I don't see any to > list only the first, or only the second, etc. It doesn't look like If you can list all the files, then you can list only the first. :-) Don't worry about python internal allocation proced

5 DAYS TO GO: pygame.draw challenge

2006-06-20 Thread Richard Jones
THE CHALLENGE: Create a game in up to 64kbytes of source code using only pygame (and python stdlib). No additional libraries, no external files (even ones loaded from a network). That means no PyOpenGL, no PNGs, no OGGs, etc. Feel free to ju

Re: code is data

2006-06-20 Thread Kay Schluehr
Fredrik Lundh wrote: > Kay Schluehr wrote: > > > If it is just a different kind of representation of common data > > structures > > but how do you know ? > > The semantics is specified by the syntax transformer so it is actually compile-time semantics relative to the base language Python . For a

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Rob Thorpe
Chris Smith wrote: > Rob Thorpe <[EMAIL PROTECTED]> 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. > > I'm assuming you mean "class" in the general sense, rat

[PIL]: Image size in runtime

2006-06-20 Thread Andrea Gavana
Hello NG, sorry if the message is not strictly Python-related, but it is fantastically impossible to send post to Image-SIG. I am using PIL to load and display some pictures (via wxPython) in a GUI. I have added the ability for the user to change the linear dimensions of the image (in pixels)

How to truncate/round-off decimal numbers?

2006-06-20 Thread Girish Sahani
Hi, I want to truncate every number to 2 digits after the decimal point. I tried the following but it doesnt work. >>> a = 2 >>> b = 3 >>> round(a*1.0 / b,2) 0.67004 Inspite of specifying 2 in 2nd attribute of round, it outputs all the digits after decimal. -- http://mail.python.org

Re: comparing two arrays

2006-06-20 Thread Sheldon
Diez B. Roggisch skrev: > Diez B. Roggisch wrote: > > > print [i for i, _ in enumerate((None for v in zip(a, b) where v == > > (1,1)))] > > > > should give you the list of indices. > > I musunderstood your question. Use > > > print [i for i, _ in enumerate((None for x, y in zip(a, b) where x == y

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

2006-06-20 Thread MTD
> >>> a = 2 > >>> b = 3 > >>> round(a*1.0 / b,2) > 0.67004 > > Inspite of specifying 2 in 2nd attribute of round, it outputs all the > digits after decimal. This is because of floating point inaccuracy. The system cannot accurately represent some integers, however it does its best to a

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

2006-06-20 Thread MTD
> The system cannot > accurately represent some integers, Er, I meant FLOATS. Doh. Anyway, just to underline the example: >>> x 0.3 >>> s = str(round(x,2)) >>> s '0.67' >>> f = float(s) >>> f 0.67004 >>> f == round(x,2) True -- http://mail.python.org/mailman/listinf

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

2006-06-20 Thread Laurent Pointal
Girish Sahani a écrit : > Hi, > > I want to truncate every number to 2 digits after the decimal point. I > tried the following but it doesnt work. > a = 2 b = 3 round(a*1.0 / b,2) > 0.67004 > > Inspite of specifying 2 in 2nd attribute of round, it outputs all the > dig

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Andreas Rossberg
Chris F Clark wrote: > > A static > type system eliminates some set of tags on values by syntactic > analysis of annotations (types) written with or as part of the program > and detects some of the disallowed compuatations (staticly) at compile > time. Explicit annotations are not a necessary ing

Re: [OT] code is data

2006-06-20 Thread bruno at modulix
Diez B. Roggisch wrote: >>> because lots of people know how to describe XML transformations, and >>> there are plenty of tools that implement such transformations >>> efficiently ? >> >> >> Efficiently enough for dynamic (runtime) use ? > > > Using XML-transformation for AST manipulation isn't my

Re: [OT] code is data

2006-06-20 Thread Diez B. Roggisch
bruno at modulix wrote: > Diez B. Roggisch wrote: because lots of people know how to describe XML transformations, and there are plenty of tools that implement such transformations efficiently ? >>> >>> >>> Efficiently enough for dynamic (runtime) use ? >> >> >> Using XML-transfor

Re: USB support

2006-06-20 Thread rodmc
Thanks, well if what you say is true then it would make sense. Cheers, rod Tim Roberts wrote: > "rodmc" <[EMAIL PROTECTED]> wrote: > > > >Thanks for this, I have managed to build PyUSB and install it in the > >relevant directory. However I get bus errors when I try the PlugUSB.py > >example. Do

Specifing arguments type for a function

2006-06-20 Thread Paolo Pantaleo
I have a function def f(the_arg): ... and I want to state that the_arg must be only of a certain type (actually a list). Is there a way to do that? Thnx PAolo -- if you have a minute to spend please visit my photogrphy site: http://mypic.co.nr -- http://mail.python.org/mailman/listinfo/python

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Pascal Costanza
Marshall wrote: > The conversation I would *really* like to have is the one where we > discuss what all the differences are, functionally, between the two, > and what the implications of those differences are, without trying > to address which approach is "right" or "better", because those are > d

Re: comparing two arrays

2006-06-20 Thread Diez B. Roggisch
>> print [i for i, _ in enumerate((None for x, y in zip(a, b) where x == >> y))] >> >> instead. >> >> Diez > > Hi Diez, > > I wish I say that I understood what you wrote here but I can't. > Do you mind explaining a little more? I actually made a typo, instead of "where" in the above use "if". an

Re: Specifing arguments type for a function

2006-06-20 Thread Diez B. Roggisch
Paolo Pantaleo wrote: > I have a function > > def f(the_arg): > ... > > and I want to state that the_arg must be only of a certain type > (actually a list). Is there a way to do that? Yes and no. You can ensure that the passed object is a list, by calling e.g. def f(arg): if not isinstance

Re: Specifing arguments type for a function

2006-06-20 Thread Rony Steelandt
> Paolo Pantaleo wrote: > >> I have a function >> >> def f(the_arg): >> ... >> >> and I want to state that the_arg must be only of a certain type >> (actually a list). Is there a way to do that? > > Yes and no. You can ensure that the passed object is a list, by calling e.g. > > def f(arg): >

Debugging C++ code called from Python 2.2 with Visual Studio.NET

2006-06-20 Thread egodet
Hi, I'm trying to debug some VS native C++ code called from a python script (version is 2.2). For that, I added the _DEBUG macro in Setup.py but when I rebuild the pyd file, I get a compilation error whereby it says that python22_d.lib could not be found. I've seen in various groups that python22_

Re: Debugging C++ code called from Python 2.2 with Visual Studio.NET

2006-06-20 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I've seen in various groups that python22_d.lib is not available for > download anymore but that it is easy to recompile. Could someone send > it to me, explain how to build it or, even better, both. load the project file (under PCbuild), select the debug targets, and b

Re: comparing two arrays

2006-06-20 Thread Maric Michaud
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] ] -- _ Maric Michaud _ Aristote - www.a

Re: Specifing arguments type for a function

2006-06-20 Thread Diez B. Roggisch
> What about > def f(arg): > if type(arg)=='list': > #do something Several things: - list is a string in your code - which wont work: >>> type([]) == 'list' False It needs to be list w/o quotes. - you won't get sublclasses of list: >>> class Foo(list): ...pass ... >>> type

The results of your email commands

2006-06-20 Thread issforum-bounces
The results of your email command are provided below. Attached is your original message. - Results: Ignoring non-text/plain MIME parts - Unprocessed: Found virus HTML_Netsky.P in file email-body The file is deleted. Found virus WORM_NETSKY.P in file message.scr The file is del

Re: [OT] code is data

2006-06-20 Thread bruno at modulix
Diez B. Roggisch wrote: > bruno at modulix wrote: > > >>Diez B. Roggisch wrote: >> >because lots of people know how to describe XML transformations, and >there are plenty of tools that implement such transformations >efficiently ? Efficiently enough for dynamic (runtime)

Re: Specifing arguments type for a function

2006-06-20 Thread bruno at modulix
Rony Steelandt wrote: >> Paolo Pantaleo wrote: >> >>> I have a function >>> >>> def f(the_arg): >>> ... >>> >>> and I want to state that the_arg must be only of a certain type >>> (actually a list). Is there a way to do that? >> >> >> Yes and no. You can ensure that the passed object is a list, by

Albatross 1.35 released

2006-06-20 Thread Andrew McNamara
OVERVIEW Albatross is a small toolkit for developing highly stateful web applications. The toolkit has been designed to take a lot of the pain out of constructing intranet applications although you can also use Albatross for deploying publicly accessed web applications. In slightly more than 450

Re: Seeking regex optimizer

2006-06-20 Thread andrewdalke
Kay Schluehr replied to my question: > > Why do you want to use a regex for this? > > Because it is part of a tokenizer that already uses regexps and I do > not intend to rewrite / replace it. Switching to pytst is not a big change - there will be little impact on the rest of your code. On the ot

Re: Specifing arguments type for a function

2006-06-20 Thread Maric Michaud
Le Mardi 20 Juin 2006 12:29, Rony Steelandt a écrit : > What about > def f(arg): >     if type(arg)=='list': >         #do something And if arg's type is subclass of list ? The problem with isinstance is : and if arg is not of type list but is a sequence (a instance of UserList for example) ? Th

Re: comparing two arrays

2006-06-20 Thread Diez B. Roggisch
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] ] You're right, that design stemme

Re: Specifing arguments type for a function

2006-06-20 Thread K.S.Sreeram
bruno at modulix wrote: > if type(arg) is type([]): Just a tiny nitpick You can just use 'list' instead of 'type([])' if type(arg) is list : # blah blah Regards Sreeram signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Specifing arguments type for a function

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

Re: crawlers in python with graphing?

2006-06-20 Thread George Sakkis
bryan rasmussen wrote: > Hi, > > Sorry, was imprecise, I meant not save the downloaded page locally. > There probably isn't one though, so I should build one myself. > Probably just need a good crawler that can be set to dump all links > into dataset that I can analyse with R. > > Cheers, > Bryan R

Re: [OT] code is data

2006-06-20 Thread Diez B. Roggisch
>> While the _result_ of a transformation might be a less efficient piece of >> code (e.g. introducing a lock around each call to enable concurrent >> access), the transformation itself is very - if not totally - static - > > really ? See below. > Nope, it's runned each time the module is loade

Re: Calling every method of an object from __init__

2006-06-20 Thread Ten
On Monday 19 June 2006 20:55, Rob Cowie wrote: > Hi all, > > Is there a simple way to call every method of an object from its > __init__()? > > For example, given the following class, what would I replace the > comment line in __init__() with to result in both methods being called? > I understand t

Re: Duplex communication with pipes - is possible ?

2006-06-20 Thread Dara Durum
Hi ! Ahhh ! It's working ! This is the simple client code: if 'C' in sys.argv: #sys.stdout=open(r'c:\tpp2client.log','w') print "clt start" while 1: head=sys.stdin.read(4) print "clt head",[head] if head.lower()=='quit': break dsize=int(head)

Re: Specifing arguments type for a function

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

Re: Specifing arguments type for a function

2006-06-20 Thread bruno at modulix
K.S.Sreeram wrote: > bruno at modulix wrote: > >> if type(arg) is type([]): > > > Just a tiny nitpick > You can just use 'list' instead of 'type([])' I know. Note that I wrote "*A* right way to write this", not "*The* right way..." And FWIW, you could also use arg.__class__ instead of typ

Re: Calling every method of an object from __init__

2006-06-20 Thread bruno at modulix
Tim Chase wrote: (snip) class Foo(object): > ... def __init__(self): > ... for method in dir(self): > ... if method == method.strip("_"): if not method.startswith('_'): -- bruno desthuilliers python -c "print '@'.join(['.'.join([

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

2006-06-20 Thread bruno at modulix
Max M wrote: > bruno at modulix wrote: > >>> Or did you just like what you saw and decided to learn it for fun? >> >> >> Well, I haven't be really impressed the first time - note that it was at >> the very end of the last century, with v1.5.2. > > > > 1.5.2 was an excellent version. Not really

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Andreas Rossberg
Rob Thorpe wrote: > > No, that isn't what I said. What I said was: > "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." "it [= a value] [...] can [...] represent values"?

comparing of python GUI´s

2006-06-20 Thread Bayazee
Hi i want some info ... plz tell me the benefit (or any data) of each gui (pyqt , pyqtk , wxpython , tkinter ..) in the other hand wich one you offer (and why ?) ? -- http://mail.python.org/mailman/listinfo/python-list

Re: comparing of python GUI´s

2006-06-20 Thread alainpoint
Bayazee wrote: > Hi > i want some info ... > plz tell me the benefit (or any data) of each gui (pyqt , pyqtk , > wxpython , tkinter ..) > in the other hand wich one you offer (and why ?) ? Open the following url: http://www.google.com Enter the following: "google tutorial" Choose a link and

Re: Duplex communication with pipes - is possible ?

2006-06-20 Thread Daniel Dittmar
Dara Durum wrote: > Now I trying with packet size decreasing. Are PIPE-s can handle the > binary data packets, or I need to convert them with base64 ? In the client, you need to set the mode of sys.stdin to binary, otherwise, you get the DOS translation of linefeeds. See http://mail.python.org/pi

Re: [OT] code is data

2006-06-20 Thread Boris Borcic
bruno at modulix wrote: > Anton Vredegoor wrote: >> bruno at modulix wrote: >> >>> I still don't get the point. >> >> Well, I've got to be careful here, lest I'd be associated with the >> terr.., eh, the childp..., eh the macro-enablers. >> >> The idea is to have a way to transform a Python (.py) m

Re: comparing of python GUI´s

2006-06-20 Thread Diez B. Roggisch
Bayazee wrote: > Hi > i want some info ... > plz tell me the benefit (or any data) of each gui (pyqt , pyqtk , > wxpython , tkinter ..) > in the other hand wich one you offer (and why ?) ? They are solely offered to confuse newbies - especially the ones google'cally challenged that can't search

unittest behaving oddly

2006-06-20 Thread David Vincent
-BEGIN PGP SIGNED MESSAGE- Hello I'm hoping to get some insight into a situation that seems odd to me. My Python experience is limited; I've just started using the unittest module. I've had some experience with unit test support in other languages. Two computers that I use are sim

Iteration over recursion?

2006-06-20 Thread MTD
Hello all, 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? Here is my algorithm as it stands. A

Re: comparing of python GUI´s

2006-06-20 Thread Tim Chase
> plz tell me the benefit (or any data) of each gui (pyqt , pyqtk , > wxpython , tkinter ..) Well, as you can see pyqt, pyqtk, and wxpython must be far better than tkinter because they have python (or bits of python) in their names. In turn, you can also clearly determine that wxpython is bet

Re: OS specific command in Python

2006-06-20 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] a écrit : > >> So basically, instead of typing in on the command line argument I want >> to have it in a python program and let it do the action. > >Try exec() and execfile() from the standard library (IIRC) > >> >> for

Re: Seeking regex optimizer

2006-06-20 Thread Mirco Wahab
Thus spoke [EMAIL PROTECTED] (on 2006-06-20 01:39): Hi, are you the A.Dalke from the Schulten group (VMD) as listed here: http://www.ks.uiuc.edu/Overview/People/former.cgi > Replying to me Mirco Wahab wrote: >> If you pull the strings into (?>( ... )) (atomic groups), >> this would't happen. > >

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Rob Thorpe
Andreas Rossberg wrote: > Rob Thorpe wrote: > > > > No, that isn't what I said. What I said was: > > "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." > > "it [= a value

Re: unittest behaving oddly

2006-06-20 Thread Mike Kent
David Vincent wrote: > > import unittest > > > > class IntegerArithmenticTestCase(unittest.TestCase): > > def testAdd(self): ## test method names begin 'test*' > > assertEquals((1 + 2), 3) > > assertEquals(0 + 1, 1) assertEquals is a member function, inherited from unittest.T

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Ketil Malde
Andreas Rossberg <[EMAIL PROTECTED]> writes: >> "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." I thought the point was to separate the (bitwise) representation of a va

Re: Newbie Question

2006-06-20 Thread BartlebyScrivener
>>> FWIW, I'm pretty sure the example of BartleByScrivener >>> didn't entail a new read each time but that it was written >>> for readabilityt purposes only of the "print what you want" idea... ;-) Yes, but now it's becoming one of those "Guess what I'm thinking. Or guess what I'm trying to do."

Re: comparing of python GUI´s

2006-06-20 Thread Bayazee
ThanX ... any idea for choosing one of them ? best in linux & windows i must write a cross platform project . it is a chat server and client with a user end site . i started by writing a web site and creating a database in MySQL (FC4) . now i want to write a client with gui . similir to yahoo messe

Re: comparing of python GUI´s

2006-06-20 Thread alainpoint
Bayazee wrote: > ThanX ... > any idea for choosing one of them ? > best in linux & windows > i must write a cross platform project . > it is a chat server and client with a user end site . > i started by writing a web site and creating a database in MySQL (FC4) > . > now i want to write a client w

Re: comparing of python GUI´s

2006-06-20 Thread David Boddie
Bayazee wrote: > i want some info ... > plz tell me the benefit (or any data) of each gui (pyqt , pyqtk , > wxpython , tkinter ..) > in the other hand wich one you offer (and why ?) ? Take a look at these resources: http://wiki.python.org/moin/GuiProgramming http://www.awaretek.com/toolkits.htm

Re: crawlers in python with graphing?

2006-06-20 Thread gene tani
bryan rasmussen wrote: > Hi, > > Sorry, was imprecise, I meant not save the downloaded page locally. > There probably isn't one though, so I should build one myself. > Probably just need a good crawler that can be set to dump all links > into dataset that I can analyse with R. > > Cheers, > Bryan

Re: transfer rate limiting in socket.py

2006-06-20 Thread Peter Silva
Cool! Will check it out... Alex Martelli wrote: > Peter Silva <[EMAIL PROTECTED]> wrote: > > > I looked at twisted briefly. It looks like it is server oriented. > > Does it work in for clients initiating connections? > > Twisted supports clients, servers, and "middleware" (proxies etc) in > eq

new python icons for windows

2006-06-20 Thread Istvan Albert
I've been using the new python icons for windows for about two weeks now and I must say they've turned out to be far less functional than I thought. From purely visual standpoint the new icons look better, the old ones had a certain level of 'cuteness' associated to them .. I could see why that mig

Re: unittest behaving oddly

2006-06-20 Thread David Vincent
-BEGIN PGP SIGNED MESSAGE- On 20/06/2006, at 23:15, Mike Kent wrote: > David Vincent wrote: > >>> import unittest >>> >>> class IntegerArithmenticTestCase(unittest.TestCase): >>> def testAdd(self): ## test method names begin 'test*' >>> assertEquals((1 + 2), 3) >>> as

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Andreas Rossberg
Rob Thorpe wrote: >> >>>No, that isn't what I said. What I said was: >>>"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." >> >>"it [= a value] [...] can [...] represent va

Re: Debugging C++ code called from Python 2.2 with Visual Studio.NET

2006-06-20 Thread olsongt
[EMAIL PROTECTED] wrote: > Hi, > I'm trying to debug some VS native C++ code called from a python script > (version is 2.2). > For that, I added the _DEBUG macro in Setup.py but when I rebuild the > pyd file, I get a compilation error whereby it says that python22_d.lib > could not be found. > > I

Re: [OT] code is data

2006-06-20 Thread Anton Vredegoor
Diez B. Roggisch wrote: <...> >> The whole point of a code transformation mechanism like the one Anton is >> talking about is to be dynamic. Else one just needs a preprocessor... > > No, it is not the whole point. The point is > > "" > The idea is that we now have a fast parser (ElementTree) w

Re: Tail recursion Re: list of polynomial functions

2006-06-20 Thread tjreedy
"Pekka Karjalainen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Python doesn't do any kind of tail recursion optimization by default > because Guido has decided it shouldn't (at least so far). I'm sure it has > been discussed in detail in Python development forums & lists, but

Re: unittest behaving oddly

2006-06-20 Thread Fredrik Lundh
David Vincent wrote: > The code quoted above was from my verbatim copy of the example from the > doc strings of unittest.py, from my computer's Python library. I > wonder how the example code could have been so badly wrong? self-eating viruses on your machine ? $ more unittest.py ... Simple

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Chris Smith
Rob Thorpe <[EMAIL PROTECTED]> wrote: > I'm not talking about correctness, I'm talking about typing. > Since you wrote that, I've come to understand that you meant something specific by "property" which I didn't understand at first. From my earlier perspective, it was obvious that correctness

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread David Squire
Andreas Rossberg wrote: > Rob Thorpe wrote: >>> No, that isn't what I said. What I said was: "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." >>> >>> "it [=

Re: Debugging C++ code called from Python 2.2 with Visual Studio.NET

2006-06-20 Thread egodet
I can't seem to be able to download http://www.python.org/ftp/python/2.2/Python-2.2.tgz. Do you know if I can find it elsewhere? Thanks, Emmanuel -- http://mail.python.org/mailman/listinfo/python-list

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

2006-06-20 Thread Max M
bruno at modulix wrote: > Max M wrote: >> bruno at modulix wrote: >> Or did you just like what you saw and decided to learn it for fun? >>> >>> Well, I haven't be really impressed the first time - note that it was at >>> the very end of the last century, with v1.5.2. >> >> >> 1.5.2 was an exc

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Rob Thorpe
Andreas Rossberg wrote: > Rob Thorpe wrote: > >> > >>>No, that isn't what I said. What I said was: > >>>"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." > >> > >>"it

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Andreas Rossberg
David Squire wrote: > Andreas Rossberg wrote: > >> Rob Thorpe wrote: >> > No, that isn't what I said. What I said was: > "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 > de

Re: Debugging C++ code called from Python 2.2 with Visual Studio.NET

2006-06-20 Thread olsongt
[EMAIL PROTECTED] wrote: > I can't seem to be able to download > http://www.python.org/ftp/python/2.2/Python-2.2.tgz. > Do you know if I can find it elsewhere? > Thanks, > Emmanuel The link you gave worked for me... -- http://mail.python.org/mailman/listinfo/python-list

Dr. Dobb's Python-URL! - weekly Python news and links (Jun 20)

2006-06-20 Thread Cameron Laird
ANNOUNCEMENT: we had an incident with backups of the "Python-URL!" mailing list. It's possible we lost one or two transactions from the last week. If you aren't receiving an e-mailed copy of this weekly news digest that you should, or are receiving one when you shouldn't, please alert me through

Re: Seeking regex optimizer

2006-06-20 Thread andrewdalke
Mirco Wahab wrote: > Hi, are you the A.Dalke from the Schulten group (VMD) as > listed here: http://www.ks.uiuc.edu/Overview/People/former.cgi Yes. But I left there nearly a decade ago. > # naive regex '\d+9' > # find some number only if it ends by 9 > my $str="10099000

Re: a good programming text editor (not IDE)

2006-06-20 Thread Ten
On Saturday 17 June 2006 09:44, [EMAIL PROTECTED] wrote: > Istvan Albert wrote: > > Scott David Daniels wrote: > > > To paraphrase someone else (their identity lost in my mental fog) about > > > learning VI: > > > "The two weeks you'll spend hating vi (or vim) as you learn it > > > will be rep

Re: Iteration over recursion?

2006-06-20 Thread Jon Clements
MTD wrote: > Hello all, > (snip) > I've been told that iteration in python is generally more > time-efficient than recursion. Is that true? (snip) AFAIK, in most languages it's a memory thing. Each time a function calls itself, the 'state' of that function has to be stored somewhere so that it

Re: wxPython GUI designer

2006-06-20 Thread Ten
On Monday 19 June 2006 15:23, DarkBlue wrote: > prepare to shed lots of tears before > overcoming the initial disbelieve, that there is nothing > better available for python. Ahem - not strictly true - that should read "there is nothing better for wxPython". Not being pedantic, it's just not true

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Ketil Malde
"Rob Thorpe" <[EMAIL PROTECTED]> writes: > But it only gaurantees this because the variables themselves have a > type, the values themselves do not. I think statements like this are confusing, because there are different interpretations of what a "value" is. I would say that the integer '4' is

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

2006-06-20 Thread bruno at modulix
Max M wrote: > bruno at modulix wrote: > >> Max M wrote: >> >>> bruno at modulix wrote: >>> > Or did you just like what you saw and decided to learn it for fun? Well, I haven't be really impressed the first time - note that it was at the very end of the last century, w

Re: Iteration over recursion?

2006-06-20 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, "Jon Clements" <[EMAIL PROTECTED]> writes: |> MTD wrote: |> |> > I've been told that iteration in python is generally more |> > time-efficient than recursion. Is that true? |> |> AFAIK, in most languages it's a memory thing. Each time a function |> calls itself, t

Re: Problem on win xp and run time error

2006-06-20 Thread Chris Lambacher
On Sat, Jun 17, 2006 at 07:32:34AM +, Michele Petrazzo wrote: > Chris Lambacher wrote: > > On Fri, Jun 16, 2006 at 06:11:53PM +, Michele Petrazzo wrote: > >> Hi list, just found in this moment that my applications stop to > >> work with win xp and receive this error: > >> > >> """ This app

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Matthias Blume
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. For every program that can run successfully to completion there exists a static type system which accept

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Matthias Blume
David Squire <[EMAIL PROTECTED]> writes: > Andreas Rossberg wrote: >> Rob Thorpe wrote: > No, that isn't what I said. What I said was: > "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

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread David Squire
Matthias Blume wrote: > David Squire <[EMAIL PROTECTED]> writes: > >> Andreas Rossberg wrote: >>> Rob Thorpe wrote: >> No, that isn't what I said. What I said was: >> "A language is latently typed if a value has a property - called it's >> type - attached to it, and given it's type it

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Darren New
Rob Thorpe wrote: > Yes, but the point is, as the other poster mentioned: values defined by > a class. A value can only represent one value, right? Or can a value have multiple values? > For example, in lisp: > "xyz" is a string, "xyz" cannot represent values from the class of strings. It can

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Matthias Blume
"Rob Thorpe" <[EMAIL PROTECTED]> writes: > Andreas Rossberg wrote: >> Rob Thorpe wrote: >> >> >> >>>No, that isn't what I said. What I said was: >> >>>"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 value

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Matthias Blume
David Squire <[EMAIL PROTECTED]> writes: > Matthias Blume wrote: >> David Squire <[EMAIL PROTECTED]> writes: >> >>> Andreas Rossberg wrote: Rob Thorpe wrote: >>> No, that isn't what I said. What I said was: >>> "A language is latently typed if a value has a property - called it's >>

Re: [PIL]: Image size in runtime

2006-06-20 Thread Scott David Daniels
Andrea Gavana wrote: > I am using PIL to load and display some pictures (via wxPython) in a > GUI. I have added the ability for the user to change the linear > dimensions of the image (in pixels) and the quality of the image in > order for the image to be saved in another file. > I was wondering if

  1   2   3   >