Re: Python books?

2007-03-09 Thread wesley chun
On Mar 8, 7:06 pm, Tommy Nordgren <[EMAIL PROTECTED]> wrote: > Could some kind soul please recommend a few textbooks on Python 2.5 > and it's class library? it's not necessary to have a 2.5 book that can introduce you to the modules of the Python Standard Library (not all modules are [or have] cl

Re: Configuration: Apache + mod_python

2007-03-09 Thread Danilo
On 8 Mrz., 22:23, [EMAIL PROTECTED] wrote: > On Mar 9, 12:02 am, "Danilo" <[EMAIL PROTECTED]> wrote: > > > > > On 8 Mrz., 12:18, [EMAIL PROTECTED] wrote: > > > > On Mar 8, 9:50 pm, "Danilo" <[EMAIL PROTECTED]> wrote: > > > > > Hi there, > > > > > is it possible to create a rewrite rule to send ever

Re: merits of Lisp vs Python

2007-03-09 Thread Terry Reedy
"Alex Martelli" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | later sold for mucho dinero) is an unabashed fan of Python; the "XO" | (nee "One Laptop Per Child", OLPC, and once known as the "$100 laptop") | uses Python as its preferred (only?-) application language, and it's | sla

Re: catching exceptions from an except: block

2007-03-09 Thread Duncan Booth
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > Not the *previous* exception, but the *current* one. You must be > inside an "except" clause to use a bare raise. > No, you don't have to be inside an except clause to use a bare raise. A bare 'raise' will re-raise the last exception that was act

Re: catching exceptions from an except: block

2007-03-09 Thread Gabriel Genellina
En Fri, 09 Mar 2007 04:49:59 -0300, Gerard Flanagan <[EMAIL PROTECTED]> escribió: > Another version: > > import exceptions As back in time as I could go (Python 1.5), exceptions were available as builtins... > def onfailFalse(fn): > def inner(*args, **kwargs): > try: >

2 new comment-like characters in Python to aid development?

2007-03-09 Thread dbhbarton
Had a thought that's grown on me. No idea if it's original or not- too inexperienced in programming- but I guess there's no harm floating it out there. Python wins big on readability, and there's no doubt that context- dependent text formatting in IDEs (keywords, strings, comments etc) is a massiv

Re: class attrdict

2007-03-09 Thread Hallvard B Furuseth
Alex Martelli writes: > (...) >> class Namespace(object): > (...) > I might, if it weren't for the redundant "if" and the horribly buggy > interference between separate instances -- which is why I wrote it, > almost six years ago and without the bugs, as >

Re: catching exceptions from an except: block

2007-03-09 Thread Gabriel Genellina
En Fri, 09 Mar 2007 05:52:35 -0300, Duncan Booth <[EMAIL PROTECTED]> escribió: > "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > >> Not the *previous* exception, but the *current* one. You must be >> inside an "except" clause to use a bare raise. >> > No, you don't have to be inside an except

Re: class attrdict

2007-03-09 Thread Hallvard B Furuseth
Alex Martelli writes: > You make a good point. I do like being able to say foo.bar=baz rather > than foo['bar']=baz in certain cases -- not so much to save 3 chars, but > to avoid excessive punctuation; however, I don't really need this AND > all of dict's power at the same time, so, I don't inher

Python not processing .pth files

2007-03-09 Thread pnm
This one I do not understand -- does anyone have any suggestions? Newly compiled untweaked Python2.5 is not processing .pth files (as far as I can see _any_ .pth files in site-packages. Example:. +++ [EMAIL PROTECTED]:/usr/local/lib/python2.5/site-packages$ ls setup* -rw-r--r-- 1 r

Pb with descriptor and super ...

2007-03-09 Thread Erwan Adam
Hi all, I have a problem with the use of descriptors and super. The file is : # --- class Desc(object): def __init__(self, class_name): self.class_name = class_name return def __get__(self, obj, typ): print "Desc.__get__ : class_name is %s, obj is

Re: Python books?

2007-03-09 Thread Ralf Schönian
Have a look at: Core python programming from Wesley J. Chun printed by Prentice Hall. Ralf Schoenian -- http://mail.python.org/mailman/listinfo/python-list

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread Gabriel Genellina
En Fri, 09 Mar 2007 06:14:46 -0300, <[EMAIL PROTECTED]> escribió: > A '?' placed in the preceding whitespace of a line as a means of > quickly highlighting a line or block of code for special attention. > The interpreter simply ignores these characters, and executes the code > as if each WIP chara

Re: Configuration: Apache + mod_python

2007-03-09 Thread Graham Dumpleton
On Mar 9, 7:09 pm, "Danilo" <[EMAIL PROTECTED]> wrote: > On 8 Mrz., 22:23, [EMAIL PROTECTED] wrote: > > > > > On Mar 9, 12:02 am, "Danilo" <[EMAIL PROTECTED]> wrote: > > > > On 8 Mrz., 12:18, [EMAIL PROTECTED] wrote: > > > > > On Mar 8, 9:50 pm, "Danilo" <[EMAIL PROTECTED]> wrote: > > > > > > Hi th

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread Nick Craig-Wood
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > What if 2 new 'special' comment-like characters were added to Python?: > > > 1. The WIP (Work In Progress) comment: I use # FIXME for this purpose or /* FIXME */ in C etc. I have an emacs macro which shows it up in bright red / yellow text so it

Re: catching exceptions from an except: block

2007-03-09 Thread Gerard Flanagan
On Mar 9, 9:56 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 09 Mar 2007 04:49:59 -0300, Gerard Flanagan > <[EMAIL PROTECTED]> escribió: > > > Another version: > > > import exceptions > > As back in time as I could go (Python 1.5), exceptions were available as > builtins... > I did

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread dbhbarton
Thanks for the thoughts. > This could be implemented without new syntax: just make your editor > recognize some special comments, and apply the highlighting to the > following block. By example, > > # XXX Remove this when FuruFaifa is fixed to always provide > #

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread Bruno Desthuilliers
Nick Craig-Wood a écrit : > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> What if 2 new 'special' comment-like characters were added to Python?: >> >> >> 1. The WIP (Work In Progress) comment: > > I use # FIXME for this purpose or /* FIXME */ in C etc. > > I have an emacs macro which shows it

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > Of course I'll still argue that the WIP character would be a more > elegant, speedy and versatile alternative. I don't think so. Those characters have no syntactical meaning and would, IMHO, make the language "dirty". Regards, Björn -- BOFH excuse #73: Daemons did

Re: Pb with descriptor and super ...

2007-03-09 Thread Gabriel Genellina
En Fri, 09 Mar 2007 06:25:08 -0300, Erwan Adam <[EMAIL PROTECTED]> escribió: > I have a problem with the use of descriptors > and super. The file is : Descriptors for "super" behave a bit different than for classes. See http://www.python.org/2.2/descrintro.html#cooperation -- Gabriel Genellin

Re: C++ and Python

2007-03-09 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > I'm considering about generating some Python Bindings for C++ > libraries. What are considered the best tools for doing something > like this? I know that there are SWIG, SIP, Boost.Python, and > GCC_XML. Please excuse me for asking the following stupid question ... I'

Python in a Nutshell v2.5 shortcomings (was: Python books?)

2007-03-09 Thread Bjoern Schliessmann
Alex Martelli wrote: > I do know that the 2nd edition of Python in a Nutshell tries to do > so, but falls quite a bit short on a number of important new > additions to the library Which, if I may ask? Regards, Björn -- BOFH excuse #221: The mainframe needs to rest. It's getting old, you kn

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread BJörn Lindqvist
On 9 Mar 2007 02:31:14 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Thanks for the thoughts. > > > This could be implemented without new syntax: just make your editor > > recognize some special comments, and apply the highlighting to the > > following block. By example, > > > >

Re: Pb with descriptor and super ...

2007-03-09 Thread Erwan Adam
Erwan Adam a écrit : > Hi all, > > I have a problem with the use of descriptors > and super. The file is : > > # --- > > class Desc(object): > def __init__(self, class_name): > self.class_name = class_name > return > def __get__(self, obj, typ): > prin

Re: catching exceptions from an except: block

2007-03-09 Thread Gabriel Genellina
En Fri, 09 Mar 2007 07:30:20 -0300, Gerard Flanagan <[EMAIL PROTECTED]> escribió: >> There is a serious flaw on this approach, the function can't return any >> false value (it would be treated as a failure). > > I was teaching myself decorators more than anything, so it's not > thought out to an

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread dbhbarton
>Those characters have no syntactical meaning... ? Neither does # until you give it syntactical meaning. I must be missing what you mean. > would, IMHO, make the language "dirty". Well I'm not a big fan of decorators so I know how you must feel. But # FIXME + a hack doesn't seem clean to me. And

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread Diez B. Roggisch
> > Well I'm not a big fan of decorators so I know how you must feel. But > # FIXME + a hack doesn't seem clean to me. And commenting off the > bottom half of a long script with triple quotes is ugly and a pain and > you can't indicate multiple alternate halt points as in the 'tutorial > script' e

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread dbhbarton
On Mar 9, 10:59 am, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote: > On 9 Mar 2007 02:31:14 -0800, [EMAIL PROTECTED] > > > > > > <[EMAIL PROTECTED]> wrote: > > Thanks for the thoughts. > > > > This could be implemented without new syntax: just make your editor > > > recognize some special comments, a

Re: catching exceptions from an except: block

2007-03-09 Thread Gerard Flanagan
On Mar 9, 11:57 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 09 Mar 2007 07:30:20 -0300, Gerard Flanagan > <[EMAIL PROTECTED]> escribió: > > >> There is a serious flaw on this approach, the function can't return any > >> false value (it would be treated as a failure). > > > I was te

Python-friendly hosting (was Re: merits of Lisp vs Python)

2007-03-09 Thread Paul Boddie
On 9 Mar, 02:32, John Nagle <[EMAIL PROTECTED]> wrote: > [Dedicated server offerings] I'm not so familiar with dedicated servers, being unlikely to buy into that kind of hosting any time soon - I'm not running a business with serious reliability/control/uptime constraints where I could justify sp

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread Robert Marshall
On Fri, 09 Mar 2007, Bruno Desthuilliers wrote: > > Nick Craig-Wood a écrit : >> [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >>> What if 2 new 'special' comment-like characters were added to >>> Python?: >>> >>> >>> 1. The WIP (Work In Progress) comment: >> >> I use # FIXME for this purpose o

Re: Pb with descriptor and super ...

2007-03-09 Thread Erwan Adam
Gabriel Genellina a écrit : > En Fri, 09 Mar 2007 06:25:08 -0300, Erwan Adam <[EMAIL PROTECTED]> > escribió: > >> I have a problem with the use of descriptors >> and super. The file is : > > Descriptors for "super" behave a bit different than for classes. See > http://www.python.org/2.2/descrint

Re: What is the best way to upgrade python?

2007-03-09 Thread Paul Boddie
On 8 Mar, 22:13, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > i am using red hat enterprise 4. It has python 2.3 installed. What is > the best way to upgrade to python 2.4? By installing a version from the source packages available from python.org. > I think one way is to compile pyth

Creat a DLL File from python code, and use that DLL file in other Platform (Labview, Java .NET etc)

2007-03-09 Thread macedo . silva
Hi, I would like to request your attention for this very specific issue: I have several classes in Python, and now I want simply re-use it, in other language. The closest to solution I think I came was with this site: http://www.py2exe.org/index.cgi/Py2exeAndCtypesComExeServer?highlight=%28%28P

A Pythonic Way to Measure and Improve Your Programming Skills?

2007-03-09 Thread Jeff Rush
(inspired by a thread on the psf-members list about Python certification) Those who know me know I am no fan of the programmer certification industry and I agree that your typical certificate arrangement, e.g. to show HR to get that box checked in your candidate file, so a company can skip respo

Creating a DLL file from Python Code

2007-03-09 Thread macedo . silva
Hi, I would like to request your attention for this very specific issue: I have several classes in Python, and now I want simply re-use it, in other language. The closest to solution I think I came was with this site: http://www.py2exe.org/index.cgi/Py2exeAndCtypesComDllServer but I not able to

MPI in python?

2007-03-09 Thread Joydeep Mitra
Hi guys, I am a relatively new user of python. I wanted to know what are the minimum requirements (modules, etc) are required for paralleliing python programs on a multiproc linux cluster. Is there a tutorial that explains the MPI syntax in python with examples? Thanking in advance, Joydeep -- h

Re: C++ and Python

2007-03-09 Thread cptnwillard
On Mar 9, 7:04 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi Everyone, > > I'm considering about generating some Python Bindings for C++ > libraries. What are considered the best tools for doing something like > this? I know that there are SWIG, SIP, Boost.Python, and GCC_XML. > > Thanks!

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: >> Those characters have no syntactical meaning... > > ? > Neither does # until you give it syntactical meaning. I must be > missing what you mean. Yes, it has. It says "disregard the following characters until EOL". If you remove it, the following code will be interprete

Re: catching exceptions from an except: block

2007-03-09 Thread Gabriel Genellina
En Fri, 09 Mar 2007 08:14:18 -0300, Gerard Flanagan <[EMAIL PROTECTED]> escribió: > Mea culpa. Ego te absolvo in nomine Patris Guidii et Filii Python et Spiritus Sancti Computatorium. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: MPI in python?

2007-03-09 Thread rishi pathak
try this http://sourceforge.net/projects/pympi/ On 3/9/07, Joydeep Mitra <[EMAIL PROTECTED]> wrote: Hi guys, I am a relatively new user of python. I wanted to know what are the minimum requirements (modules, etc) are required for paralleliing python programs on a multiproc linux cluster. Is th

Re: pylint: don't warn about tabs

2007-03-09 Thread Colin J. Williams
Ben Finney wrote: > Bjoern Schliessmann <[EMAIL PROTECTED]> writes: > >> Alan Isaac wrote: >>> As a tab user, I want the tabs warning turned off. >> Advice: Don't. > > Agreed. Sticking to spaces for indentation avoids the ambiguity of > interpretation that ASCII TAB characters are subject to. In

Re: Pb with descriptor and super ...

2007-03-09 Thread Gabriel Genellina
En Fri, 09 Mar 2007 08:22:46 -0300, Erwan Adam <[EMAIL PROTECTED]> escribió: > Thanks for your answer ... I followed the link > and tried to use the "fully functional implementation of > the super() built-in class in pure Python" given > on this page and the result is quite surprising : It appe

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread Nick Craig-Wood
Robert Marshall <[EMAIL PROTECTED]> wrote: > On Fri, 09 Mar 2007, Bruno Desthuilliers wrote: > > > > > Nick Craig-Wood a ?crit : > >> [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >>> What if 2 new 'special' comment-like characters were added to > >>> Python?: > >>> > >>> > >>> 1. The WIP (W

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread dbhbarton
> Yes, it has. It says "disregard the following characters until EOL". > If you remove it, the following code will be interpreted as ... > code (and not be disregarded). and ! would say "disregard the following characters until End Of Program". Is it really so different? > > Well I'm not a big f

Re: C++ and Python

2007-03-09 Thread Mandus
8 Mar 2007 22:04:48 -0800 skrev [EMAIL PROTECTED]: > Hi Everyone, > > I'm considering about generating some Python Bindings for C++ > libraries. What are considered the best tools for doing something like > this? I know that there are SWIG, SIP, Boost.Python, and GCC_XML. We are doing this quite e

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread Diez B. Roggisch
> It sounds like other Python users *do* like to do the kind of things I > suggested, but seasoned users would rather rely on macros and features > of specific editors. Unfortunately, to a newbie like myself, these > seem like obscure 'tricks' to be mastered rather than simple built-in > convenienc

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread dbhbarton
On 9 Mar, 14:05, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > But you _can't_ profit from these conveniences, at least not the ? > character. It's just garbage put in there for some others to interpret, > meaningless to the interpreter. So it _always_ boils down to > editor-support. I'm sorry I

Re: Reading a portion of a file

2007-03-09 Thread Vulcanius
Here is the code I've come up with. Please feel free to critique it and let me know what you would change. Also, as you can see I call "open(SERVER,'r')" twice; but I want to only call it once, what would the best way to do this be? imp

Is this right? Multiple imports of same module.

2007-03-09 Thread Lou Pecora
>From what I gleaned on some messages this is the way multiple imports of the same module work. Say, I have 3 modules (mod1.py, mod2.py, and mod3.py) and in the same session they all import another module mymodule.py like this: *In mod1.py import mymodule *In mod2.py import mymodule *In mo

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > On 9 Mar, 14:05, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> But you _can't_ profit from these conveniences, at least not the ? >> character. It's just garbage put in there for some others to interpret, >> meaningless to the interpreter. So it _always_ boils down to

number generator

2007-03-09 Thread cesco
I have to generate a list of N random numbers (integer) whose sum is equal to M. If, for example, I have to generate 5 random numbers whose sum is 50 a possible solution could be [3, 11, 7, 22, 7]. Is there a simple pattern or function in Python to accomplish that? Thanks and regards Francesco --

Re: number generator

2007-03-09 Thread Paul Rubin
"cesco" <[EMAIL PROTECTED]> writes: > I have to generate a list of N random numbers (integer) whose sum is > equal to M. If, for example, I have to generate 5 random numbers whose > sum is 50 a possible solution could be [3, 11, 7, 22, 7]. Is there a > simple pattern or function in Python to accomp

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread dbhbarton
> > I'm sorry I don't follow your logic. Meaningless to the interpreter, > > yes, meaningless to the IDE or to me, no. I "_can't_ profit from these > > conveniences"? Why ever not? > > Exactly, the ? is meaningless to the language itself, it's only a comment > sign - ... > ... it has nothing to do

Re: Creating a DLL file from Python Code

2007-03-09 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : > Hi, > > I would like to request your attention for this very specific issue: > > I have several classes in Python, and now I want simply re-use it, in > other language. > > The closest to solution I think I came was with this site: > http://www.py2exe.org/index.cgi/

Re: number generator

2007-03-09 Thread cesco
On Mar 9, 3:51 pm, Paul Rubin wrote: > "cesco" <[EMAIL PROTECTED]> writes: > > I have to generate a list of N random numbers (integer) whose sum is > > equal to M. If, for example, I have to generate 5 random numbers whose > > sum is 50 a possible solution could be [3, 11

Re: Creat a DLL File from python code, and use that DLL file in other Platform (Labview, Java .NET etc)

2007-03-09 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi, > > I would like to request your attention for this very specific issue: > > I have several classes in Python, and now I want simply re-use it, in > other language. > > > The closest to solution I think I came was with this site: > http://www.py2exe.org/index.cgi

opinion needed

2007-03-09 Thread azrael
id like to hear your opinion about something. I just started using Prolog yesterday and i have my doubts about it, but it seems to me something like object oriented. so i wanted to ask you how usefull prolog is. Sure this is no prolog newsgroup so my question is: because it seems object oriented, h

Re: C++ and Python

2007-03-09 Thread hg
Mandus wrote: > 8 Mar 2007 22:04:48 -0800 skrev [EMAIL PROTECTED]: >> Hi Everyone, >> >> I'm considering about generating some Python Bindings for C++ >> libraries. What are considered the best tools for doing something like >> this? I know that there are SWIG, SIP, Boost.Python, and GCC_XML. > >

Re: number generator

2007-03-09 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, cesco wrote: > Given two positive integers, N and M with N < M, I have to generate N > positive integers such that sum(N)=M. No more constraints. Break it into subproblems. Generate a random number X from a suitable range and you are left with one number, and the problem

Re: Is this right? Multiple imports of same module.

2007-03-09 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Lou Pecora wrote: > *In mod1.py > > import mymodule > > *In mod2.py > > import mymodule > > *In mod3.py > > import mymodule as MM > > Then mymodule is imported only once, but each module has access to it > through the module name (mod1 and mod2) and the alias MM (mod

Re: number generator

2007-03-09 Thread Gerard Flanagan
On Mar 9, 4:17 pm, "cesco" <[EMAIL PROTECTED]> wrote: > On Mar 9, 3:51 pm, Paul Rubin wrote: > > > "cesco" <[EMAIL PROTECTED]> writes: > > > I have to generate a list of N random numbers (integer) whose sum is > > > equal to M. If, for example, I have to generate 5 random

Re: C++ and Python

2007-03-09 Thread Roman Yakovenko
On 8 Mar 2007 22:04:48 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi Everyone, I'm considering about generating some Python Bindings for C++ libraries. What are considered the best tools for doing something like this? I know that there are SWIG, SIP, Boost.Python, and GCC_XML. If you

Re: number generator

2007-03-09 Thread Carsten Haese
On Fri, 2007-03-09 at 07:17 -0800, cesco wrote: > On Mar 9, 3:51 pm, Paul Rubin wrote: > > "cesco" <[EMAIL PROTECTED]> writes: > > > I have to generate a list of N random numbers (integer) whose sum is > > > equal to M. If, for example, I have to generate 5 random numbers

Re: Is this right? Multiple imports of same module.

2007-03-09 Thread Simon Brunning
On 3/9/07, Lou Pecora <[EMAIL PROTECTED]> wrote: > > *In mod1.py > > import mymodule > > *In mod2.py > > import mymodule > > *In mod3.py > > import mymodule as MM > > Then mymodule is imported only once, but each module has access to it > through the module name (mod1 and mod2) and the alias MM (mo

Re: Is this right? Multiple imports of same module.

2007-03-09 Thread Bart Ogryczak
On Mar 9, 3:30 pm, Lou Pecora <[EMAIL PROTECTED]> wrote: > Then mymodule is imported only once, but each module has access to it > through the module name (mod1 and mod2) and the alias MM (mod3). Is > that right? Yes, it is. > I was concerned about multiple imports and efficiency. If the module

Re: opinion needed

2007-03-09 Thread Grant Edwards
On 2007-03-09, azrael <[EMAIL PROTECTED]> wrote: > I just started using Prolog yesterday and i have my doubts about it, > but it seems to me something like object oriented. Not in my experience, but I haven't used Prolog for 10 years. > so i wanted to ask you how usefull prolog is. It's brillia

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: >> > I'm sorry I don't follow your logic. Meaningless to the interpreter, >> > yes, meaningless to the IDE or to me, no. I "_can't_ profit from these >> > conveniences"? Why ever not? >> >> Exactly, the ? is meaningless to the language itself, it's only a comment >> sign -

Re: number generator

2007-03-09 Thread Paul Rubin
Carsten Haese <[EMAIL PROTECTED]> writes: > > Given two positive integers, N and M with N < M, I have to generate N > > positive integers such that sum(N)=M. No more constraints. > Paul still had a point, since the word "positive" is a vital piece of > information that never appeared in your origin

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread Bruno Desthuilliers
Nick Craig-Wood a écrit : > Robert Marshall <[EMAIL PROTECTED]> wrote: >> On Fri, 09 Mar 2007, Bruno Desthuilliers wrote: >> >>> Nick Craig-Wood a ?crit : [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > What if 2 new 'special' comment-like characters were added to > Python?: > >>

Re: opinion needed

2007-03-09 Thread Bart Ogryczak
On Mar 9, 4:27 pm, "azrael" <[EMAIL PROTECTED]> wrote: > id like to hear your opinion about something. > I just started using Prolog yesterday and i have my doubts about it, > but it seems to me something like object oriented. so i wanted to ask > you how usefull prolog is. It's very useful for "L

about application deployment

2007-03-09 Thread Alessandro de Manzano
Hello, I'ld ask you all about deployment of python applications. Sometimes (if not most times..) I would make deployment easy (easier) for my customers (and for me too...) What I mean, would be very useful to have a "jar-like" archive/single file / multiple platform in order to deploy also compl

Re: opinion needed

2007-03-09 Thread Diez B. Roggisch
azrael wrote: > id like to hear your opinion about something. > I just started using Prolog yesterday and i have my doubts about it, > but it seems to me something like object oriented. so i wanted to ask > you how usefull prolog is. Sure this is no prolog newsgroup so my > question is: because it

Re: about application deployment

2007-03-09 Thread Diez B. Roggisch
Alessandro de Manzano wrote: > Hello, > > I'ld ask you all about deployment of python applications. > > Sometimes (if not most times..) I would make deployment easy (easier) > for my customers (and for me too...) > > What I mean, would be very useful to have a "jar-like" archive/single > file /

Re: number generator

2007-03-09 Thread Bjoern Schliessmann
cesco wrote: > On Mar 9, 3:51 pm, Paul Rubin >> "cesco" <[EMAIL PROTECTED]> writes: >>> I have to generate a list of N random numbers (integer) whose >>> sum is equal to M. If, for example, I have to generate 5 random >>> numbers whose sum is 50 a possible solution could

Re: Is this right? Multiple imports of same module.

2007-03-09 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, Lou Pecora wrote: > > > *In mod1.py > > > > import mymodule > > > > *In mod2.py > > > > import mymodule > > > > *In mod3.py > > > > import mymodule as MM > > > > Then mymodule is i

Re: Is this right? Multiple imports of same module.

2007-03-09 Thread Simon Brunning
On 3/9/07, Lou Pecora <[EMAIL PROTECTED]> wrote: > I have noticed that using from xxx import * can lead to problems when > trying to access variables in the xxx module. Don't do it, then. ;-) -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http://mail.python.or

Re: Is this right? Multiple imports of same module.

2007-03-09 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, "Bart Ogryczak" <[EMAIL PROTECTED]> wrote: > On Mar 9, 3:30 pm, Lou Pecora <[EMAIL PROTECTED]> wrote: > > Then mymodule is imported only once, but each module has access to it > > through the module name (mod1 and mod2) and the alias MM (mod3). Is > > that right?

Re: opinion needed

2007-03-09 Thread Grant Edwards
On 2007-03-09, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > azrael wrote: > >> id like to hear your opinion about something. >> I just started using Prolog yesterday and i have my doubts about it, >> but it seems to me something like object oriented. so i wanted to ask >> you how usefull prolog is

Re: number generator

2007-03-09 Thread Steven D'Aprano
On Fri, 09 Mar 2007 06:44:01 -0800, cesco wrote: > I have to generate a list of N random numbers (integer) whose sum is > equal to M. If, for example, I have to generate 5 random numbers whose > sum is 50 a possible solution could be [3, 11, 7, 22, 7]. Is there a > simple pattern or function in Py

Re: about application deployment

2007-03-09 Thread Jeff McNeil
If a .egg file is in your sys.path, it would be nice to simply use 'python -m' in my opinion. As far as I know, you can't '-m' a module that's been imported from a zip file? On 3/9/07, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: Alessandro de Manzano wrote: > Hello, > > I'ld ask you all abou

Problem with new Vista and os.system

2007-03-09 Thread Arne Jamtgaard
I'm getting myself set up on a new Vista box at work, and one of my old scripts has stopped working. Specifically, all calls to os.system return a -1. Whatever action I was asking os.system to run does not take place. Is this a Vista thing, or perhaps just a wonky setting in my environment. Oh,

Problem with new Vista and os.system

2007-03-09 Thread Arne Jamtgaard
I'm getting myself set up on a new Vista box at work, and one of my old scripts has stopped working. Specifically, all calls to os.system return a -1. Whatever action I was asking os.system to run does not take place. Is this a Vista thing, or perhaps just a wonky setting in my environment? I've

Re: Is this right? Multiple imports of same module.

2007-03-09 Thread Michele Simionato
On Mar 9, 5:18 pm, Lou Pecora <[EMAIL PROTECTED]> wrote: > I have noticed that using from xxx import * can lead to problems when > trying to access variables in the xxx module. ``from xxx import *`` is intended to be used in the interactive interpreter only. Michele Simionato -- http://

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread dbhbarton
> But all of them are clear on how they work: they affect one line, or have a > bracket style like /* */ and thus demark clearly what they affect. Even > someone not fluent in the language in question will quickly grab what they > mean. There's nothing remotely fuzzy about how wip or halt comments

Re: Creat a DLL File from python code, and use that DLL file in other Platform (Labview, Java .NET etc)

2007-03-09 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Hi, > > I would like to request your attention for this very specific issue: > > I have several classes in Python, and now I want simply re-use it, in > other language. > > > The closest to solution I think I came was with this site: > http://www.py2exe.org/index.cgi/

Re: Pb with descriptor and super ...

2007-03-09 Thread Arnaud Delobelle
On Mar 9, 11:22 am, Erwan Adam <[EMAIL PROTECTED]> wrote: [snip] > > [EMAIL PROTECTED] /home/adam/Work/Python]> python super_from_guido.py > Using built-in super > Desc.__get__ : class_name is A, obj is <__main__.B object at 0xb7bc302c> > and typ is > Using python Super > Desc.__get__ : class_name

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread Diez B. Roggisch
>> The ? has no meaning. It only has a meaning for an editor. > > So it _does_ have meaning! I'm sorry I just don't buy into this kind > of abstract programming ideology, and I never really have. I don't > care what the interpreter finds meaningful and neither, on a day to > day basis, do most us

Re: about application deployment

2007-03-09 Thread Larry Bates
Alessandro de Manzano wrote: > Hello, > > I'ld ask you all about deployment of python applications. > > Sometimes (if not most times..) I would make deployment easy (easier) > for my customers (and for me too...) > > What I mean, would be very useful to have a "jar-like" archive/single > file /

SQLite3 trapping OperationalError

2007-03-09 Thread jim-on-linux
pyhelp, I set up a table in SQLite3. While running other modules I want to know if a table exists. SQL has a command "List Tables" but I don't think SQLlite3 has this command. I've tried cursor.execute("select * from debtor where key is not null ") The table debtor does not exist so

Re: SQLite3 trapping OperationalError

2007-03-09 Thread Jerry Hill
On 3/9/07, jim-on-linux <[EMAIL PROTECTED]> wrote: > However python 2.5, > except OperationalError: > responds with > "OperationalError" is not defined. I believe that needs to be spelled except sqlite3.OperationalError: do_something() -- Jerry -- http://mail.python.org/mailman/listinfo/pyt

Re: SQLite3 trapping OperationalError

2007-03-09 Thread jim-on-linux
On Friday 09 March 2007 13:10, Jerry Hill wrote: > On 3/9/07, jim-on-linux <[EMAIL PROTECTED]> wrote: > > However python 2.5, > > except OperationalError: > > responds with > > "OperationalError" is not defined. > > I believe that needs to be spelled > except sqlite3.OperationalError: > do_som

Are Lists thread safe?

2007-03-09 Thread abcd
Are lists thread safe? Or do I have to use a Lock when modifying the list (adding, removing, etc)? Can you point me to some documentation on this? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread Matthew Woodcraft
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: Nick Craig-Wood a ecrit : > I use # FIXME for this purpose or /* FIXME */ in C etc. > > I have an emacs macro which shows it up in bright red / yellow text > so it is easy to see > Thanks you both. For what it's worth, sufficien

Re: merits of Lisp vs Python

2007-03-09 Thread Tim Bradshaw
On 2007-03-09 07:00:06 +, [EMAIL PROTECTED] (Alex Martelli) said: > (nee "One Laptop Per Child", OLPC, and once known as the "$100 laptop") > uses Python as its preferred (only?-) application language, and it's > slated to be the most widely distributed Python distro if it hits even > half of

Re: Are Lists thread safe?

2007-03-09 Thread Larry Bates
abcd wrote: > Are lists thread safe? Or do I have to use a Lock when modifying the > list (adding, removing, etc)? Can you point me to some documentation > on this? > > thanks > You really should at least try Google first: http://effbot.org/pyfaq/what-kinds-of-global-value-mutation-are-thread-

Re: Best place for a function?

2007-03-09 Thread Inyeol Lee
On Wed, Mar 07, 2007 at 05:27:04PM -0500, Sergio Correia wrote: > I'm writing a class, where one of the methods is kinda complex. The > method uses a function which I know for certain will not be used > anywhere else. This function does not require anything from self, only > the args passed by the

Re: Are Lists thread safe?

2007-03-09 Thread Greg Copeland
On Mar 9, 1:03 pm, "abcd" <[EMAIL PROTECTED]> wrote: > Are lists thread safe? Or do I have to use a Lock when modifying the > list (adding, removing, etc)? Can you point me to some documentation > on this? > > thanks Yes there are still some holes which can bite you. Adding and removing is thr

floating point rounding

2007-03-09 Thread hg
Hi, Here is my issue: f = 1.5 * 0.01 f >> 0.014999 '%f' % f >>'0.015000' But I really want to get 0.02 as a result ... is there a way out ? Thanks, hg -- http://mail.python.org/mailman/listinfo/python-list

Re: Are Lists thread safe?

2007-03-09 Thread abcd
Thanks for the link. I saw that one in my google search but didn't visit it for some reason. Looks like most operations should be just fine. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >