Re: complex numbers

2005-01-13 Thread Antoon Pardon
Op 2005-01-12, It's me schreef <[EMAIL PROTECTED]>: > Precisely. One have to convert complex number into vectors, and vector of > complex numbers into vector of vectors, list of complex numbers into list of > vectors, , you get the idea. Wrong. My vector example was an illustration that you

Re: Octal notation: severe deprecation

2005-01-13 Thread Tim Roberts
Stephen Thorne <[EMAIL PROTECTED]> wrote: >On 12 Jan 2005 16:21:29 -0800, PJDM <[EMAIL PROTECTED]> wrote: >> Maybe P3K will have an integer literal like "n_b" for "the integer n in >> base b". > >I would actually like to see pychecker pick up conceptual errors like this: > >import datetime >dateti

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-13 Thread Antoon Pardon
Op 2005-01-12, Steve Holden schreef <[EMAIL PROTECTED]>: > > Given that Guido is on record as saying that expressions aren't > statements because he wants those things to be separate, I don't really > see why there's this consistent pressure to reverse that decision. Well, it seems that Guido is

Re: finding/replacing a long binary pattern in a .bin file

2005-01-13 Thread Bengt Richter
On Thu, 13 Jan 2005 16:51:46 +1000, Stephen Thorne <[EMAIL PROTECTED]> wrote: >On 12 Jan 2005 22:36:54 -0800, yaipa <[EMAIL PROTECTED]> wrote: >> What would be the common sense way of finding a binary pattern in a >> .bin file, say some 200 bytes, and replacing it with an updated pattern >> of the

RE: Why would I get a TypeEror?

2005-01-13 Thread Harper, Gina
Because you can't take the len() of an integer. Try casting a as a str: b=(1,len(str(a)))[isinstance(a,(list,tuple,dict))] -Original Message- From: It's me [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 12:35 PM To: python-list@python.org Subject: Why would I get a TypeEror?

Re: java 5 could like python?

2005-01-13 Thread Olaf Delgado-Friedrichs
Roman Suzi wrote: -Realying on ides is imposible due to python dinamic nature,very litle(next to nothing) assistance can be espected from them. Class browsing and auto-completion are probably the only features I sometime miss. But otherwise what IDEs are for? Refactoring? You got to admit, Bicycle

Re: why are people still using classic classes?

2005-01-13 Thread Tim Roberts
Simon Wittber <[EMAIL PROTECTED]> wrote: >I've noticed that a few ASPN cookbook recipes, which are recent >additions, use classic classes. > >I've also noticed classic classes are used in many places in the >standard library. > >I've been using new-style classes since Python 2.2, and am suprised >

Re: Refactoring; arbitrary expression in lists

2005-01-13 Thread Nick Craig-Wood
Stephen Thorne <[EMAIL PROTECTED]> wrote: > Why not use a regexp based approach. Good idea... You could also use sre.Scanner which is supposed to be fast like this... import re, sre scanner = sre.Scanner([ (r"\.php$", "application/x-php"), (r"\.(cc|cpp)$", "text/x-c++-src"), (r"\.x

Re: property () for Java Programmers ?

2005-01-13 Thread michael . bierenfeld
> Note that I used 'c = C()' instead of 'c = C' as in your code. Hello, thanks that was the problem. *hmpf* :-) Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie q

2005-01-13 Thread Stephen Thorne
On Thu, 13 Jan 2005 17:05:39 +1000, Egor Bolonev <[EMAIL PROTECTED]> wrote: > > "Stephen Thorne" <[EMAIL PROTECTED]> ÑÐÐÐÑÐÐ/ÑÐÐÐÑÐÐÐ Ð > > ÑÐÐÐÑÑÑÐÐ: news:[EMAIL PROTECTED] > On Thu, 13 Jan 2005 15:55:10 +1000, Egor Bolonev <[EMAIL PROTECTED]> wrote: > > how to get rid of 'for' operator

Re: else condition in list comprehension

2005-01-13 Thread Andrey Tatarinov
Steve Holden wrote: Nick Coghlan wrote: Luis M. Gonzalez wrote: Hi there, I'd like to know if there is a way to add and else condition into a list comprehension. I'm sure that I read somewhere an easy way to do it, but I forgot it and now I can't find it... for example: z=[i+2 for i in range(10) if

site.here on python 2.4

2005-01-13 Thread ariza
greetings. it seems that the attribute site.here, of the site module, has vanished in python 2.4. up until python 2.3, site.here seemed (to me at least) a convenient way to get the complete path to the python library on any platform: >>> import site >>> site.here '/System/Library/Frameworks/Pytho

Re: reference or pointer to some object?

2005-01-13 Thread Antoon Pardon
Op 2005-01-12, Jeff Shannon schreef <[EMAIL PROTECTED]>: > Torsten Mohr wrote: > >> I still wonder why a concept like "references" was not >> implemented in Python. I think it is (even if small) >> an overhead to wrap an object in a list or a dictionary. > > Because Python uses a fundamentally dif

Re: site.here on python 2.4

2005-01-13 Thread Fredrik Lundh
"ariza" <[EMAIL PROTECTED]> wrote: > greetings. it seems that the attribute site.here, of the site module, > has vanished in python 2.4. up until python 2.3, site.here seemed (to > me at least) a convenient way to get the complete path to the python > library on any platform. "here" was a tempor

Re: distutils linux script installation broken?

2005-01-13 Thread Cory Davis
Thanks for the help Chris. I tried the -E option, and also installing as root with no change - the scripts in the bin directory still end up with #!None on the first line. Next step is to reinstall Python 2.4, and if that doesn't work I'll just stick with 2.3.4. Cheers, Cory. Christopher De Vr

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-13 Thread Fredrik Lundh
Antoon Pardon wrote: > Well, it seems that Guido is wrong then. The documentation clearly > states that an expression is a statement. no, it says that an expression statement is a statement. if you don't understand the difference, please *plonk* yourself. -- http://mail.python.org/mailman

from __future__ import decorators

2005-01-13 Thread Jacek Generowicz
I have some code, which makes copious use of the @decorator syntax which was introduced in Python2.4. Now I find myself in a situation where I have to run the code under Python 2.3. However, I would like to keep developing the code with the new syntax. How could I best automate the process of maki

[perl-python] 20050112 while statement

2005-01-13 Thread Xah Lee
# here's a while statement in python. a,b = 0,1 while b < 20: print b a,b = b,a+b --- # here's the same code in perl ($a,$b)=(0,1); while ($b<20) { print $b, "\n"; ($a,$b)= ($b, $a+$b); } Xah [EMAIL PROTECTED] http://xahlee.org/PageTwo_dir/more.html -- http://mail.python.org/m

Re: from __future__ import decorators

2005-01-13 Thread Thomas Heller
Jacek Generowicz <[EMAIL PROTECTED]> writes: > I have some code, which makes copious use of the @decorator syntax > which was introduced in Python2.4. Now I find myself in a situation > where I have to run the code under Python 2.3. However, I would like > to keep developing the code with the new

lambda

2005-01-13 Thread Egor Bolonev
why functions created with lambda forms cannot contain statements? how to get unnamed function with statements? -- http://mail.python.org/mailman/listinfo/python-list

Re: site.here on python 2.4

2005-01-13 Thread ariza
i am not sure where i found site.here documented as used prior to 2.4. the issue is that i do not need sys.path, as in the list of all paths that python searches. sys.prefix is close to what i need: >>> sys.prefix '/System/Library/Frameworks/Python.framework/Versions/2.3' but the old site.here

wxPython and CheckListBox

2005-01-13 Thread ncookson
I am trying to add a caption or title to the box drawn around a checklistbox and having no luck. Is there a way to do this? I am using python 2.3.4 and wxPython 2.5 on a windows platform. Noel -- http://mail.python.org/mailman/listinfo/python-list

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-13 Thread Antoon Pardon
Op 2005-01-13, Fredrik Lundh schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: > >> Well, it seems that Guido is wrong then. The documentation clearly >> states that an expression is a statement. > > no, it says that an expression statement is a statement. if you don't > understand the differenc

Re: [perl-python] 20050112 while statement

2005-01-13 Thread Michael Hoffman
Xah Lee wrote: # here's a while statement in python. > [...] > # here's the same code in perl [...] So? -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: java 5 could like python?

2005-01-13 Thread Arthur
On Wed, 12 Jan 2005 11:18:17 -0500, Istvan Albert <[EMAIL PROTECTED]> wrote: >vegetax wrote: > >> previus two python proyects where relatively big,and python didnt feel >> well suited for the task. > >One typical problem that others might talk about in more detail >is that you might be writing ja

Re: lambda

2005-01-13 Thread Tim Leslie
Because if it takes more than a single line it deserves a name. Also, if you have more than one line in this function, how do you plan to reference it if not by name? Tim On Thu, 13 Jan 2005 20:53:09 +1000, Egor Bolonev <[EMAIL PROTECTED]> wrote: > why functions created with lambda forms cannot

Free python server.

2005-01-13 Thread rootshell
Hello. I need an account no free python server. Would somebody help me? I tried to find one no www.python.org [there are few addresses of free hosts] but unfortunately can't manage with the registration. Best Regards Rootshell -- http://mail.python.org/mailman/listinfo/python-list

Re: lambda

2005-01-13 Thread Daniel Dittmar
Egor Bolonev wrote: why functions created with lambda forms cannot contain statements? syntax/technical answer: because lambda is an expression and it is not obvious how the syntax for 'statement inside expression' should be 'Python is perfect' answer: if a function contains more than an express

Unclear On Class Variables

2005-01-13 Thread Tim Daneliuk
I am a bit confused. I was under the impression that: class foo(object): x = 0 y = 1 means that x and y are variables shared by all instances of a class. But when I run this against two instances of foo, and set the values of x and y, they are indeed unique to the *instance* rather

Pickling a class instead of an instance

2005-01-13 Thread Sebastien Boisgerault
Hi, It seems to me that it's not possible with the pickle module to serialize a class rather than an instance, as in >> from pickle import * >> >> class C(object): >> "... doc ..." >> a = 1 >> >> pickstr = dumps(C) I mean, it does *something*, there is no error indeed, but from the str

Re: Free python server.

2005-01-13 Thread Michel Claveau - abstraction méta-galactique non triviale en fuite perpétuelle.
Hi ! Server, web ? Files server ? Web-services server ? XML-RPC server ? Mail-server ? Newsgroups server ? SGBD server ? Object server ? Persistance server ? Restaurant server ? or ALL ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Unclear On Class Variables

2005-01-13 Thread Simon Brunning
On 13 Jan 2005 07:18:26 EST, Tim Daneliuk <[EMAIL PROTECTED]> wrote: > I am a bit confused. I was under the impression that: > > class foo(object): > x = 0 > y = 1 > > means that x and y are variables shared by all instances of a class. > But when I run this against two instances

Re: Unclear On Class Variables

2005-01-13 Thread harold fellermann
Hi Tim, If you have class Foo(object) : x = 0 y = 1 foo = Foo() foo.x # reads either instance or class attribute (class in this case) foo.x = val # sets an instance attribute (because foo is instance not class) Foo.x = val # sets a class attribute foo.__class.__x = val

Re: pyserial and com port interrupts

2005-01-13 Thread Neil Benn
engsol wrote: Has anyone done a script that will rspond to the serial com port(s) receive buffer interrupt, as opposed to polling and timeouts? Win2000 is the main interest right now. Thanks Norm B Hello, I came across this problem as when I first used PySerial, I came from a java bac

Re: Creating text on images

2005-01-13 Thread Roland Heiber
morphex wrote: Hi all, I'm trying to create a script that will superimpose text on an image. I didn't find any great examples out there on how this can be done (I presume using PIL is necessary), do you know of any examples? Thanks, Morten Hi, something like this? ### from PIL import Image, ImageFo

how to stop google from messing Python code

2005-01-13 Thread Xah Lee
i'm using groups-beta.google.com to post python code. Is there a way to stop google from messing with my format? it seems to have eaten the spaces in my python code. thanks. Xah [EMAIL PROTECTED] http://xahlee.org/PageTwo_dir/more.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Pickling a class instead of an instance

2005-01-13 Thread harold fellermann
have a look at the thread "copying classes?" some days ago. what goes for copying goes for pickling also, because the modules use the same interface. - harold - On 13.01.2005, at 13:32, Sebastien Boisgerault wrote: Hi, It seems to me that it's not possible with the pickle module to serialize a clas

Debian says "Warning! you are running an untested version of Python." on 2.3

2005-01-13 Thread Alex Stapleton
Whenever I run python I get "Warning! you are running an untested version of Python." prepended to the start of any output on stdout. This is with Debian and python 2.3 (running the debian 2.1 and 2.2 binaries doesn't have this effect) Does anyone have any idea how to stop this or have even see

Re: how to stop google from messing Python code

2005-01-13 Thread Just
In article <[EMAIL PROTECTED]>, "Xah Lee" <[EMAIL PROTECTED]> wrote: > i'm using groups-beta.google.com to post python code. > > Is there a way to stop google from messing with my format? it seems to > have eaten the spaces in my python code. It does that when you cross-post. Just -- http://m

Re: newbie q

2005-01-13 Thread Will Stuyvesant
I understand you want to do it in an applicative programming style? Not recommended in general. But here goes: .# c.l.p. question: .# "using map, lambda, reduce, filter and List Comprehensions [x for .# x in []] just don't get how to add string to all elements of list" . .## .# A function that re

Re: Free python server.

2005-01-13 Thread rootshell
Hi there. What I need is web sever, where I could put just one python script. Greetings. Rootshell. -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython and CheckListBox

2005-01-13 Thread Ed Leafe
On Jan 13, 2005, at 5:54 AM, [EMAIL PROTECTED] wrote: I am trying to add a caption or title to the box drawn around a checklistbox and having no luck. Is there a way to do this? I am using python 2.3.4 and wxPython 2.5 on a windows platform. I don't think you can do it directly. What you might wan

Re: [perl-python] 20050112 while statement

2005-01-13 Thread brianr
"Xah Lee" <[EMAIL PROTECTED]> writes: > # here's a while statement in python. > > a,b = 0,1 > while b < 20: > print b > a,b = b,a+b > > --- > # here's the same code in perl > > ($a,$b)=(0,1); > while ($b<20) { > print $b, "\n"; > ($a,$b)= ($b, $a+$b); > } That python code produces a s

pyPgSQL giving error!

2005-01-13 Thread Gurpreet Sachdeva
I am using Redhat 9.0/python2.3. I installed pyPgSQL-2.4.tar.gz and it was successfull. Now when I am trying to import that module, I got: Python 2.3.3 (#1, Jan 11 2005, 15:24:09) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more infor

Re: from __future__ import decorators

2005-01-13 Thread Jacek Generowicz
Thomas Heller <[EMAIL PROTECTED]> writes: > Jacek Generowicz <[EMAIL PROTECTED]> writes: > > > I have some code, which makes copious use of the @decorator syntax > > which was introduced in Python2.4. Now I find myself in a situation > > where I have to run the code under Python 2.3. However, I w

Re: Python.org, Website of Satan

2005-01-13 Thread Lucas Raab
Jane wrote: <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] python.org = 194.109.137.226 194 + 109 + 137 + 226 = 666 What is this website with such a demonic name and IP address? What evils are the programmers who use this language up to? Some people have too much time on their hands..

Re: Iteration over two sequences

2005-01-13 Thread Diez B. Roggisch
My example is somewhat flawed because it assigns a and b the values of the iteration - so in the end, b is 'c', and only setting a to [1,2] will show your results. Use c and d for the variables in the for-statments, and things work as expected. -- Regards, Diez B. Roggisch -- http://mail.python

Re: Octal notation: severe deprecation

2005-01-13 Thread Peter Hansen
[EMAIL PROTECTED] wrote: In Mythical Future Python I would like to be able to use any base in integer literals, which would be better. Example random syntax: flags= 2x00011010101001 umask= 8x664 answer= 10x42 addr= 16x0E84 # 16x == 0x gunk= 36x8H6Z9A0X I think I kinda like this idea. Allowing

Re: pyserial and com port interrupts

2005-01-13 Thread Neil Benn
Neil Benn wrote: engsol wrote: Has anyone done a script that will rspond to the serial com port(s) receive buffer interrupt, as opposed to polling and timeouts? Win2000 is the main interest right now. Thanks Norm B Hello, I came across this problem as when I first used PySerial, I cam

module on files & directories

2005-01-13 Thread Sara Fwd
Hi all Can anybody help me find a module or a function that looks in a directory and defines whether the objects in there are files or directories? Thanks, Sara __ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://prom

Re: Debian says "Warning! you are running an untested version of Python." on 2.3

2005-01-13 Thread Gerhard Haering
On Thu, Jan 13, 2005 at 12:56:38PM -, Alex Stapleton wrote: > Whenever I run python I get > > "Warning! you are running an untested version of Python." > > prepended to the start of any output on stdout. [...] ROFL. Are you using testing, sid or experimental? I expect overzealous patching f

Re: Unclear On Class Variables

2005-01-13 Thread Antoon Pardon
Op 2005-01-13, Simon Brunning schreef <[EMAIL PROTECTED]>: > On 13 Jan 2005 07:18:26 EST, Tim Daneliuk <[EMAIL PROTECTED]> wrote: >> I am a bit confused. I was under the impression that: >> >> class foo(object): >> x = 0 >> y = 1 >> >> means that x and y are variables shared by a

Re: py2exe Excludes

2005-01-13 Thread Ed Leafe
On Jan 13, 2005, at 12:04 AM, vincent wehren wrote: Just a guess: What happens if you remove everything that's in the "build" directory before running setup.py? There may still be files around from an earlier build that *did* include the Dabo modules. Ah, that was it! I didn't realize that it wo

Re: module on files & directories

2005-01-13 Thread Simon Brunning
On Thu, 13 Jan 2005 04:51:22 -0800 (PST), Sara Fwd <[EMAIL PROTECTED]> wrote: > Hi all > > Can anybody help me find a module or a function that > looks in a directory and defines whether the objects > in there are files or directories? See os.path.isfile() and os.path.isdir() -

Re: pyserial and com port interrupts

2005-01-13 Thread Peter Hansen
engsol wrote: I'm working on a s/w test program using python code. Com1 and com2 play a part. The problem is that the python code has a lot of work to do...and the results from the hardware under test can come from either com1 or com2...at any time. It may be a few milliseconds, or several seconds

Re: Unclear On Class Variables

2005-01-13 Thread Diez B. Roggisch
Tim Daneliuk wrote: > I am a bit confused. I was under the impression that: > > class foo(object): > x = 0 > y = 1 > > means that x and y are variables shared by all instances of a class. > But when I run this against two instances of foo, and set the values > of x and y, they are indeed unique

Re: why not datetime.strptime() ?

2005-01-13 Thread Skip Montanaro
Josh> The datetime is full of these calls. Would it make sense to make Josh> this a separate patch? (Or maybe the PyImport_ImportModule could Josh> implement such a cache :) ?) Hmmm... I wonder why that wasn't done before. Perhaps it just doesn't matter performance-wise. I just che

Re: lambda

2005-01-13 Thread Antoon Pardon
Op 2005-01-13, Tim Leslie schreef <[EMAIL PROTECTED]>: > Because if it takes more than a single line it deserves a name. So if I have a call with an expression that takes more than one line, I should assign the expression to a variable and use the variable in the call? But wait if I do that, peop

Re: Unclear On Class Variables

2005-01-13 Thread Antoon Pardon
Op 2005-01-13, harold fellermann schreef <[EMAIL PROTECTED]>: > Hi Tim, > > If you have > > class Foo(object) : > x = 0 > y = 1 > > foo = Foo() > > foo.x # reads either instance or class attribute (class in this case) > > foo.x = val # sets an instance attribute (because foo is instance

Re: from __future__ import decorators

2005-01-13 Thread Jacek Generowicz
Peter Otten <[EMAIL PROTECTED]> writes: > Have a look at Bill Mill's redecorate utility: > > http://llimllib.f2o.org/files/redecorate.py Heh, this is exactly the sort of thing I wanted do avoid writing, as it would be difficult to get right. Looks like it's author has similar feelings. However,

Re: why are people still using classic classes?

2005-01-13 Thread Peter Hansen
Paul Rubin wrote: Simon Wittber <[EMAIL PROTECTED]> writes: Is there a reason NOT to use them? If a classic class works fine, what incentive is there to switch to new style classes? Perhaps classic classes will eventually disappear? It just means that the formerly "classic" syntax will define a

Re: Octal notation: severe deprecation

2005-01-13 Thread phil_nospam_schmidt
Peter Hansen wrote: > [EMAIL PROTECTED] wrote: > > In Mythical Future Python I would like to be able to use any base in > > integer literals, which would be better. Example random syntax: > > > > flags= 2x00011010101001 > > umask= 8x664 > > answer= 10x42 > > addr= 16x0E84 # 16x == 0x > > gunk=

Re: why are people still using classic classes?

2005-01-13 Thread Aahz
In article <[EMAIL PROTECTED]>, Peter Hansen <[EMAIL PROTECTED]> wrote: > >Unfortunately, if we should follow the recent advice about always using >"super()" in the __init__ method, it's hard to do what you suggest >(though it sounds like good advice) without resorting to extreme >ugliness: > > >>

Re: why are people still using classic classes?

2005-01-13 Thread Simon Wittber
> Unfortunately, if we should follow the recent advice about > always using "super()" in the __init__ method, it's hard > to do what you suggest (though it sounds like good advice) > without resorting to extreme ugliness: 'import this' also provides some good advice: "There should be one-- and pr

Re: Unclear On Class Variables

2005-01-13 Thread Peter Hansen
Simon Brunning wrote: On 13 Jan 2005 07:18:26 EST, Tim Daneliuk <[EMAIL PROTECTED]> wrote: But you are being mislead by the fact that integers are immutable. 'spam.eggs = 2' is *creating* an instance member - there wasn't one before. Have a look at what happens with a mutable object: Simon, it's re

seperating GUI from other code + reports

2005-01-13 Thread flupke
Hi, i need to develop an app here which will be used to produce stats. I'm going to go with twisted pb for the client server communication. And wxPython for the GUI. Now i would want to split the GUI code from the pb code to make debugging easier amongst other things but i'm not sure how i would b

How to install pyparallel

2005-01-13 Thread Michel LE VAN KIEM
Hi everybody ! I'm trying to install the pyparallel module for my Python 2.3.4 (runs on a FC3) but I do have some troubles. When I import the parallel module, python shows the following message : >>> import parallel /usr/lib/python2.3/site-packages/parallel/parallelppdev.py:32: FutureWarning: x<

Re: Unclear On Class Variables

2005-01-13 Thread Simon Brunning
On Thu, 13 Jan 2005 08:56:10 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: > Simon, it's really not about mutability at all. You've changed > the example, Err, there *wasn't* an example, not really. The OP just mentioned 'setting the values' of instance members. That *can* mean name binding, bu

Re: Unclear On Class Variables

2005-01-13 Thread Steve Holden
Tim Daneliuk wrote: I am a bit confused. I was under the impression that: class foo(object): x = 0 y = 1 means that x and y are variables shared by all instances of a class. What it actually does is define names with the given values *in the class namespace*. But when I run this against

Re: Octal notation: severe deprecation

2005-01-13 Thread Steve Holden
[EMAIL PROTECTED] wrote: John Machin wrote: I regard continued usage of octal as a pox and a pestilence. Quite agree. I was disappointed that it ever made it into Python. Octal's only use is: a) umasks b) confusing the hell out of normal non-programmers for whom a leading zero is in no way magic

Re: Unclear On Class Variables

2005-01-13 Thread Fredrik Lundh
Tim Daneliuk wrote: >I am a bit confused. I was under the impression that: > > class foo(object): > x = 0 > y = 1 > > means that x and y are variables shared by all instances of a class. > But when I run this against two instances of foo, and set the values > of x and y, they are indeed unique to

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-13 Thread Steve Holden
Fredrik Lundh wrote: Antoon Pardon wrote: Well, it seems that Guido is wrong then. The documentation clearly states that an expression is a statement. no, it says that an expression statement is a statement. if you don't understand the difference, please *plonk* yourself. OK then, "The documenta

Re: [perl-python] 20050112 while statement

2005-01-13 Thread Peter Maas
[EMAIL PROTECTED] schrieb: "Xah Lee" <[EMAIL PROTECTED]> writes: [...] (As a matter of interest, is this sequence of posts intended to demonstrate ignorance of both languages, or just one?) :) This sequence of posts is intended to stir up a debate just for the sake of a debate. It's a time sink. It

Re: newbie q

2005-01-13 Thread Steve Holden
Egor Bolonev wrote: "Stephen Thorne" <[EMAIL PROTECTED]> ÑÐÐÐÑÐÐ/ÑÐÐÐÑÐÐÐ Ð ÑÐÐÐÑÑÑÐÐ: news:[EMAIL PROTECTED] On Thu, 13 Jan 2005 15:55:10 +1000, Egor Bolonev <[EMAIL PROTECTED]> wrote: how to get rid of 'for' operator in the code? import os, os.path def _test(): src = 'C:\\Documents a

Re: why not datetime.strptime() ?

2005-01-13 Thread Skip Montanaro
Skip> I just checked in your changes. Thanks for the effort. Jeez Skip... That reads poorly. How about "Thanks for your contribution"? In any case, thanks. Skip -- http://mail.python.org/mailman/listinfo/python-list

python 2.3.4 for windows: float("NaN") throws exception

2005-01-13 Thread asmirnov1234567890
Hi my python 2.3.4 for windows refuse to execute line float("NaN"). It says: >>> float("NaN") Traceback (most recent call last): File "", line 1, in ? ValueError: invalid literal for float(): NaN The same line works as expected on Linux and Solaris with python 2.3.4. Could anybody explain what i

Re: python 2.3.4 for windows: float("NaN") throws exception

2005-01-13 Thread Tim Peters
[EMAIL PROTECTED] > my python 2.3.4 for windows refuse to execute line float("NaN"). It > says: > > >>> float("NaN") > Traceback (most recent call last): > File "", line 1, in ? > ValueError: invalid literal for float(): NaN > > The same line works as expected on Linux and Solaris with python 2.3.

Re: python 2.3.4 for windows: float("NaN") throws exception

2005-01-13 Thread Fredrik Lundh
<[EMAIL PROTECTED]> wrote: > my python 2.3.4 for windows refuse to execute line float("NaN"). It > says: > float("NaN") > Traceback (most recent call last): > File "", line 1, in ? > ValueError: invalid literal for float(): NaN > > The same line works as expected on Linux and Solaris with pyt

Re: Unclear On Class Variables

2005-01-13 Thread Antoon Pardon
> > Well I find this a confusing behaviour on python's part. The fact > that instance.field can mean something different, depending on > where in a statement you find it, makes the behaviour inconsistent. > > I know people in general here are against declarations, but declarations > could IMO provi

Re: How to install pyparallel

2005-01-13 Thread Peter Hansen
Michel LE VAN KIEM wrote: I'm trying to install the pyparallel module for my Python 2.3.4 (runs on a FC3) but I do have some troubles. >>> p=parallel.Parallel() ppdev0: failed to register device ! ... IOError: [No such device or address] Some help would be appreciated. Did you read the notes in

Re: python 2.3.4 for windows: float("NaN") throws exception

2005-01-13 Thread Peter Hansen
[EMAIL PROTECTED] wrote: my python 2.3.4 for windows refuse to execute line float("NaN"). It says: float("NaN") Traceback (most recent call last): File "", line 1, in ? ValueError: invalid literal for float(): NaN The same line works as expected on Linux and Solaris with python 2.3.4. Could anybody

Re: Python.org, Website of Satan

2005-01-13 Thread Jane
"Lucas Raab" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Jane wrote: > > <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > >>python.org = 194.109.137.226 > >> > >>194 + 109 + 137 + 226 = 666 > >> > >>What is this website with such a demonic name and IP address

Re: Statement local namespaces summary (was Re: python3: 'where' keyword)

2005-01-13 Thread Nick Coghlan
Nick Coghlan wrote: Semantics - The code:: with: translates to:: def unique_name(): unique_name() I've come to the conclusion that these semantics aren't what I would expect from the construct. Exactly what I would expect can't really be expressed in current Python due to t

Re: Free python server.

2005-01-13 Thread Kartic
You can try for a free shell access at www.arbornet.org. telnet (or better SSH) to m-net.arbornet.org and at the login prompt, type newuser, press enter and follow the on-screen instructions to register. Once you register, you get a shell account with email and web space. Since it is a free servi

Re: What strategy for random accession of records in massive FASTA file?

2005-01-13 Thread Chris Lasher
>Before you get too carried away, how often do you want to do this and >how grunty is the box you will be running on? Oops, I should have specified this. The script will only need to be run once every three or four months, when the sequences are updated. I'll be running it on boxes that are 3GHz/1

Re: What strategy for random accession of records in massive FASTA file?

2005-01-13 Thread Chris Lasher
Thanks for your reply, Larry. I thought about this, but I'm worried the dictionary will consume a lot of resources. I think my 3GHz/1GB RAM box could handle the load fine, but I'm not sure about others' systems. Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Free python server.

2005-01-13 Thread Kartic
And yes, they have python installed... -- http://mail.python.org/mailman/listinfo/python-list

Re: else condition in list comprehension

2005-01-13 Thread Nick Coghlan
Andrey Tatarinov wrote: I presume the point of this is to avoid polluting the local namespace with "newval". I further presume you also have plans to do something about "i"? ;-) no, the point is in grouping definition of newval() with place where it is used. I'd have said the point was both :) B

dynamically inserting function into an object

2005-01-13 Thread michael
Hi, below is a snipplet that could be seen as a part of a spreadsheet with getter and setter properties and a way how to dynamically insert function to be used when setting the value of a "cell" instance import new import inspect class Cell (object): def __init__ (self, initialvalue = 0):

Re: from __future__ import decorators

2005-01-13 Thread Skip Montanaro
Jacek> Crazy idea ... would it be possible to shadow 2.3's parser with Jacek> one stolen from 2.4 ? If you're willing to go to that much trouble, why not just upgrade to 2.4? Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: from __future__ import decorators

2005-01-13 Thread Peter Otten
Jacek Generowicz wrote: > I have some code, which makes copious use of the @decorator syntax > which was introduced in Python2.4. Now I find myself in a situation > where I have to run the code under Python 2.3. However, I would like > to keep developing the code with the new syntax. > > How coul

Re: why are people still using classic classes?

2005-01-13 Thread Aahz
In article <[EMAIL PROTECTED]>, Simon Wittber <[EMAIL PROTECTED]> wrote: > >'import this' also provides some good advice: > >"There should be one-- and preferably only one --obvious way to do it." > >It seems to me that python is not as simple/clean as it once was. It >has grown warts, for the sak

Re: What strategy for random accession of records in massive FASTA file?

2005-01-13 Thread Chris Lasher
>Others have probably solved your basic problem, or pointed >the way. I'm just curious. >Given that the information content is 2 bits per character >that is taking up 8 bits of storage, there must be a good reason >for storing and/or transmitting them this way? I.e., it it easy >to think up a coun

Re: Using Tix and Tkinter

2005-01-13 Thread harold fellermann
On 31.12.2004, at 16:50, Harlin Seritt wrote: import Tix from Tkconstants import * from Tkinter import * root = Tix.Tk() Label(root, text="Hello!").pack() Tix.tixControl().pack() root.mainloop() When I run this, I get the following error: Traceback (most recent call last): File "TixTest.py", lin

Re: lambda

2005-01-13 Thread hanz
Antoon Pardon wrote: > So if I have a call with an expression that takes more than > one line, I should assign the expression to a variable and > use the variable in the call? Yes, that's sometimes a good practice and can clarify the call. > But wait if I do that, people will tell me how bad tha

Unicode conversion in 'print'

2005-01-13 Thread Ricardo Bugalho
Hello, I'm using Python 2.3.4 and I noticed that, when stdout is a terminal, the 'print' statement converts Unicode strings into the encoding defined by the locales instead of the one returned by sys.getdefaultencoding(). However, I can't find any references to it. Anyone knows where it's descrbed

Re: finding/replacing a long binary pattern in a .bin file

2005-01-13 Thread François Pinard
[Stephen Thorne] > On 12 Jan 2005 22:36:54 -0800, yaipa <[EMAIL PROTECTED]> wrote: > > > What would be the common sense way of finding a binary pattern in > > a .bin file, say some 200 bytes, and replacing it with an updated > > pattern of the same length at the same offset? The file itself > > i

Re: dynamically inserting function into an object

2005-01-13 Thread John Roth
If what you want is to insert a method into an instance, look at new.instancemethod. John Roth "michael" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi, below is a snipplet that could be seen as a part of a spreadsheet with getter and setter properties and a way how to dynamically

Re: lambda

2005-01-13 Thread Paul Rubin
"hanz" <[EMAIL PROTECTED]> writes: > > But wait if I do that, people will tell me how bad that it is, > > because it will keep a reference to the value which will prevent > > the garbage collector from harvesting this memory. > > Nobody will tell you that it's bad. Python was never about super > p

Re: Debian says "Warning! you are running an untested version of Python." on 2.3

2005-01-13 Thread Nick Craig-Wood
Alex Stapleton <[EMAIL PROTECTED]> wrote: > Whenever I run python I get > > "Warning! you are running an untested version of Python." > > prepended to the start of any output on stdout. > > This is with Debian and python 2.3 (running the debian 2.1 and 2.2 binaries > doesn't have this effec

  1   2   3   >