PyAr - Python Argentina 5th Meeting, tomorrow Thursday, Decimal t alk included

2005-01-13 Thread Batista, Facundo
Title: PyAr - Python Argentina 5th Meeting, tomorrow Thursday, Decimal talk included The Argentinian Python User Group, PyAr, will have its fifth meeting this Thursday, January 13th at 7:00pm. Please see http://pyar.decode.com.ar/Wiki/ProximaReunion for details (in Spanish.) Agenda --

Roundup Issue Tracker release 0.8 beta 2

2005-01-13 Thread Richard Jones
I'm proud to release this 8th major feature release of Roundup. This is currently a DEVELOPMENT release, meaning it probably has bugs. If you want a STABLE release, use 0.7.x First up, big thanks go to alexander smishlajev who has done some really good work getting the i18n and new configuration

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 can

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 datetime.datetime(2005,

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 same

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

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,

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 people

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\.xsl$, xsl),

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 in the code? import os, os.path def

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)

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

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 different

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 temporary

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

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. /F --

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

[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 ($b20) { print $b, \n; ($a,$b)= ($b, $a+$b); } Xah [EMAIL PROTECTED] http://xahlee.org/PageTwo_dir/more.html --

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 difference, please

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 java code in

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

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*

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 string pickstr, I

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 of foo,

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

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,

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 class

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 seen

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 --

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: 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

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 ($b20) { print $b, \n; ($a,$b)= ($b, $a+$b); } That python code produces a syntax error: File

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 information.

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 would like

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 --

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

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.

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 from

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 all instances of 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

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

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

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, people

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 not class)

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, it

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= 36x8H6Z9A0X I

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: class

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

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

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

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: xy

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, but

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 the

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

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's

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 and SettingsMy Documents\\My

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 stdin, 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 is

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 stdin, 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

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 stdin, line 1, in ? ValueError: invalid literal for float(): NaN The same line works as expected on Linux and Solaris with python 2.3.4.

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 provide

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

2005-01-13 Thread Nick Coghlan
Nick Coghlan wrote: Semantics - The code:: statement with: suite translates to:: def unique_name(): suite statement 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

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

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

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 :) But

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 performance,

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 effect) What

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

2005-01-13 Thread Nick Craig-Wood
Gerhard Haering [EMAIL PROTECTED] wrote: ROFL. Are you using testing, sid or experimental? I expect overzealous patching from Debian developers, but this is the worst I've heard of. I would have thought that is unlikely given the way packages move (unmodified) from unstable - testing (and

Re: from __future__ import decorators

2005-01-13 Thread Jacek Generowicz
Skip Montanaro [EMAIL PROTECTED] writes: 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? *I* upgraded to 2.4 sometime when it was in alpha. --

RE: module on files directories

2005-01-13 Thread Robert Brewer
Sara Fwd wrote: 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? and Simon Brunning replied: See os.path.isfile() and os.path.isdir() - http://docs.python.org/lib/module-os.path.html. I suspect

Tix.FileSelectDialog wait for user?

2005-01-13 Thread harold fellermann
Hi, I have a question concerning the Tix file select mechanisms. Unfortunately, I have very little experience with neither tk, Tkinter nor Tix. Somewhere in my GUI I have a save button. What I want is that pressing the button opens a file requester. The user can either select a filename or

Re: dynamically inserting function into an object

2005-01-13 Thread hanz
# class Cell(object): # def __init__(self, initialvalue = 0): #self._func = lambda x: x #self.__value = initialvalue # # def setvalue (self, newvalue): # self.__value = self._func(newvalue) # # def getvalue (self): # return self.__value # # def

Re: why are people still using classic classes?

2005-01-13 Thread Michael Hobbs
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 Paul McGuire
Despite the regexp alternatives, I refuse to post a pyparsing solution to this! :) -- Paul -- http://mail.python.org/mailman/listinfo/python-list

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

2005-01-13 Thread beliavsky
Tim Peters wrote: Neither -- all Python behavior in the presence of float NaNs, infinities, or signed zeroes is a platform-dependent accident. C99 and Fortran 2003 have IEEE arithmetic. If CPython could be compiled with a C99 compiler, would it also have IEEE arithmetic? Do Python

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

2005-01-13 Thread Jeff Shannon
Nick Coghlan wrote: def f(): a = 1 b = 2 print 1, locals() print 3, locals() using: a = 2 c = 3 print 2, locals() print 4, locals() I think the least suprising result would be: 1 {'a': 1, 'b': 2} # Outer scope 2 {'a': 2, 'c': 3} # Inner

Re: reference or pointer to some object?

2005-01-13 Thread Jeff Shannon
Antoon Pardon wrote: Op 2005-01-12, Jeff Shannon schreef [EMAIL PROTECTED]: It's also rather less necessary to use references in Python than it is in C et. al. You use nothing but references in Python, that is the reason why if you assign a mutable to a new name and modify the object through

Re: Free python server.

2005-01-13 Thread rootshell
Thank you very much. Arbornet.org seems to be ok Unforutnately I was convinced that I only have to only copy my *.py file to /public_hml directory and everything will be all right. As you expect I was wrong. R. -- http://mail.python.org/mailman/listinfo/python-list

Re: reference or pointer to some object?

2005-01-13 Thread Alex Martelli
Jeff Shannon [EMAIL PROTECTED] wrote: Because Python uses a fundamentally different concept for variable names than C/C++/Java (and most other static languages). In those languages, variables can be passed by value or by reference; neither term really applies in Python. (Or, if you

Re: Free python server.

2005-01-13 Thread Reinhold Birkenfeld
Kartic wrote: And yes, they have python installed... Python 2.1! Reinhold -- http://mail.python.org/mailman/listinfo/python-list

Re: Refactoring; arbitrary expression in lists

2005-01-13 Thread Jeff Shannon
Stephen Thorne wrote: As for the overall efficiency concerns, I feel that talking about any of this is premature optimisation. I disagree -- using REs is adding unnecessary complication and dependency. Premature optimization is a matter of using a conceptually more-complicated method when a

  1   2   >