IT News

2007-09-13 Thread samsamrober
Hey watchout IT related News and Blog on www.itnewz.net -- http://mail.python.org/mailman/listinfo/python-list

Re: "once" assigment in Python

2007-09-13 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Lorenzo Di Gregorio wrote: > During coding I find it handy to assign a variable *unless it has been > already assigned*: I've found that this is often referred to as "once" > assigment. Why not just assign to it once at the beginning and be done with it? -- http:/

Re: "once" assigment in Python

2007-09-13 Thread Calvin Spealman
This is one of the things that I often see people trying to do in Python, where the best solution is simply to understand how Python works and craft the code to work with the language. The problem, in my view, is not that you don't have a good way to do this "once assignment" operation, but that yo

Re: Python 3K or Python 2.9?

2007-09-13 Thread Terry Reedy
"Bjoern Schliessmann" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |> - only functions being attributes of a class... |What, IYHO, is the difference between a method and a function? A method is a function accessed as an attribute of a class or instance. As an object type, it is a

Re: Extended slicing and Ellipsis - where are they used?

2007-09-13 Thread Paddy
On Sep 14, 1:50 am, James Stroud <[EMAIL PROTECTED]> wrote: > Rodney Maxwell wrote: > > The following are apparently legal Python syntactically: > >L[1:3, 8:10] > >L[1, ..., 5:-2] > > > But they don't seem to work on lists: > l = [0,1,2,3] > l[0:2,3] > > Traceback (most recent cal

"once" assigment in Python

2007-09-13 Thread Lorenzo Di Gregorio
Hello, I've been using Python for some DES simulations because we don't need full C speed and it's so much faster for writing models. During coding I find it handy to assign a variable *unless it has been already assigned*: I've found that this is often referred to as "once" assigment. The best

Spaces from string specifier

2007-09-13 Thread Gavin Tomlins
Greetings all, I'm trying to work out when using a format specifier I get spaces in the resulting string. Eg. Looking at the outputted string you can see that there are spaces after T5LAT, F4LAT etc. as I result from trying to keep the code aligned Does anyone have any insights in how to

distutils install-data-hook

2007-09-13 Thread Thomas Dybdahl Ahle
Hey I have this pythonapp I'm trying to pack, and I've read in the Gnome specifications that I should run "update-icon-cache" after install, in order to get the menus and stuff correctly updated. Is there a way to specify a (list of) commands to be run after installation? -- http://mail.python

Re: Just bought Python in a Nutshell

2007-09-13 Thread Steve Holden
Lamonte Harris wrote: > http://www.powells.com/biblio/63-9780596001889-7 Used, has anyone read > this book. Any additional information that you like,dislike about this > book? [I like having real books and stead of ebooks because its better > on the eyes.] Should be her 2morrow Afternoon :),

Re: Python 3K or Python 2.9?

2007-09-13 Thread TheFlyingDutchman
> If you look at the thread "parameter list notation" from ten days or so > ago, TheFlyingDutchman has forked Python and is working on a very special > new language, PIEthun 3.01B. > I for one am looking forward to seeing all > the very special features of PIEthun. It will be named PIEthun 3000 as

Re: How to Start

2007-09-13 Thread Paul McGuire
On Sep 13, 4:59 pm, [EMAIL PROTECTED] (Michael R. Copeland) wrote: >Yes, I could fire up the interactive mode and play with some > statements...but I consider that sort of thing for programming > neophytes or experimenting with specific issues. To misquote Francis Bacon, "you would have fis

RE: Setting stdout encoding

2007-09-13 Thread Ryan Ginstrom
> On Behalf Of Gabriel Genellina > You should check that obj is an unicode object before calling > encode. > Strings should not be encoded. ... > __getattr__ is only called when the attribute has NOT been > found in the usual way, so checking for "write" is > unnecesary. Just return getattr(se

Re: Extending Python with C API

2007-09-13 Thread Thierry Masson
On 9/13/07, Carsten Haese wrote: >Your module C code uses an unknown function by the name of PyBuildValue. >The actual name of the function you mean is Py_BuildValue. Thank you so much, Carsten. I can't believe I missed that underscore! I'm posting the working code below in case it ever turns out

Re: PIL DPI trouble

2007-09-13 Thread Gabriel Genellina
En Thu, 13 Sep 2007 23:50:39 -0300, Gary Bloom <[EMAIL PROTECTED]> escribi�: > I notice that the PIL has trouble playing with the DPI of other programs > and image standards: when I create a file with Paint Shop Pro or > Photoshop, the PIL routines can't properly recognize the DPI. Do you m

Re: Setting stdout encoding

2007-09-13 Thread Gabriel Genellina
En Thu, 13 Sep 2007 08:43:11 -0300, Ryan Ginstrom <[EMAIL PROTECTED]> escribi�: >> On Behalf Of Fabio Zadrozny >> Makes sense... Do you think that creating a new object, >> setting it as sys.stdout and overriding its write() method to >> check for a unicode string to do >> original_stdout.write(

Re: How to Start

2007-09-13 Thread James Stroud
Michael R. Copeland wrote: >Yes, I could fire up the interactive mode and play with some > statements...but I consider that sort of thing for programming neophytes > or experimenting with specific issues. The interactive interpreter is *the fastest* way to learn, expert, novice, or somewhe

Re: Setting stdout encoding

2007-09-13 Thread Gabriel Genellina
En Thu, 13 Sep 2007 08:08:39 -0300, Fabio Zadrozny <[EMAIL PROTECTED]> escribi�: >> >> But I don't think it's a good idea. Changing the default encoding will >> change it for *all* scripts, *all* users, *all* objects. And AFAIK you >> have trouble ONLY with sys.std* - one should fix those object

Re: Decimal formatting

2007-09-13 Thread Aahz
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > a >12.3 print '%0.2f' % a >12.33 a = 1 print '%0.2f' % a >1.00 >>> '%.2f' % 1 '1.00' -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "Many customs in this life per

Re: Coming from Perl - SOLVED

2007-09-13 Thread Amer Neely
Amer Neely wrote: > I'm a complete newbie with Python, but have several years experience > with Perl in a web environment. > > A question I have, if someone here is familiar with Perl, does Python > have something like Perl's 'here document'? I've just searched and read > some postings on gener

Re: automatic parallelization

2007-09-13 Thread Mikhail Teterin
Cameron Laird wrote: > There are a LOT more possibilities one might pursue, depending > on the details of Mr. Teterin's intent. The reason I began wondering about this is that I like a particular image-gallery generating tool called `imageindex' (http://www.edwinh.org/imageindex/) Unfortunately,

PIL DPI trouble

2007-09-13 Thread Gary Bloom
Howdy! I notice that the PIL has trouble playing with the DPI of other programs and image standards: when I create a file with Paint Shop Pro or Photoshop, the PIL routines can't properly recognize the DPI. And when I create an image file (via the save method) of PIL, setting the DPI, those sa

Re: Python 3K or Python 2.9?

2007-09-13 Thread Aahz
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: >Chris Mellon <[EMAIL PROTECTED]> wrote: >> >> and I'll punch a kitten before I accept having to read >> Python code guessing if something is a global, a local, or part of >> self like I do in C++. > >Exactly: the technical o

Re: Python 3K or Python 2.9?

2007-09-13 Thread Aahz
In article <[EMAIL PROTECTED]>, Ben Finney <[EMAIL PROTECTED]> wrote: > >Specifically an easier way of doing it provided by the language syntax >(hence "syntactic sugar"). As in, "the form 'foo += 1' is syntactic >sugar for 'foo = foo + 1'". Except, of course, that it isn't, quite. ;-) -- Aahz

Re: An ordered dictionary for the Python library?

2007-09-13 Thread James Stroud
Carl Banks wrote: > On Sep 13, 4:20 pm, James Stroud <[EMAIL PROTECTED]> wrote: >> Mark Summerfield wrote: >>> - If an item is inserted it is put in the right place (because the >>> underlying data structure, b*tree, skiplist or whatever is >>> intrinsically ordered by < on the key) >> +1 for all y

Re: An ordered dictionary for the Python library?

2007-09-13 Thread Carl Banks
On Sep 13, 4:20 pm, James Stroud <[EMAIL PROTECTED]> wrote: > Mark Summerfield wrote: > > - If an item is inserted it is put in the right place (because the > > underlying data structure, b*tree, skiplist or whatever is > > intrinsically ordered by < on the key) > > +1 for all your suggestions belo

Re: An ordered dictionary for the Python library?

2007-09-13 Thread Jürgen Urner
Puh, what a discussion... most common use case I can think of is >> d = {'a': 1, 'b': 2, 'c': 3} >> for key in d: >> # do something that relies on order of keys as specified in the >> constructor It's a bit tireing having to type >> for key in sorted(d.keys()): >> do_somethig_with(d[ke

Re: Extending Python with C API

2007-09-13 Thread Carsten Haese
On Thu, 2007-09-13 at 18:05 -0700, Thierry Masson wrote: > Hello, > > I'm trying to use the C API to extend Python. I've looked at various > books and web sites (including the docs at python.org) and I can't get > any of the samples to work. Below is a very minimalist example that > I'm trying to

Re: Decimal formatting

2007-09-13 Thread Zentrader
The documentation is here http://docs.python.org/lib/typesseq-strings.html -- http://mail.python.org/mailman/listinfo/python-list

Extending Python with C API

2007-09-13 Thread Thierry Masson
Hello, I'm trying to use the C API to extend Python. I've looked at various books and web sites (including the docs at python.org) and I can't get any of the samples to work. Below is a very minimalist example that I'm trying to get working and I was wondering if someone could tell me where I'm go

Re: read part of jpeg file by pure python

2007-09-13 Thread Pacino
On 9 13 , 7 44 , [EMAIL PROTECTED] wrote: > On 13 Wrz, 10:48, Pacino <[EMAIL PROTECTED]> wrote: > > > > > On 9 13 , 4 43 , Laurent Pointal <[EMAIL PROTECTED]> wrote: > > > > Pacino a écrit : > > > > > Hi, everyone, > > > > > I am wondering whether it's possible to read part (e.g. 1000*1000) of

Re: Extended slicing and Ellipsis - where are they used?

2007-09-13 Thread James Stroud
Rodney Maxwell wrote: > The following are apparently legal Python syntactically: >L[1:3, 8:10] >L[1, ..., 5:-2] > > But they don't seem to work on lists: l = [0,1,2,3] l[0:2,3] > Traceback (most recent call last): > File "", line 1, in > TypeError: list indices must be integer

httplib hangs in read / strace says recvfrom()

2007-09-13 Thread Michael Bacarella
Hi list, I'm 99% sure httplib is sporadically hanging when I call read() on the HTTPResponse object (r.status == 200). Evidence: straceing the process shows it's blocked in recvfrom() ls -la /proc/pid/fd shows the socket-id for recvfrom() file descriptor (3) lsof -n | grep socket-id

Re: lxml + mod_python: cannot unmarshal code objects in restricted execution mode

2007-09-13 Thread Graham Dumpleton
On Sep 13, 11:05 pm, Dmitri Fedoruk <[EMAIL PROTECTED]> wrote: > Hello everyone, > > I'm developing a mod_python application that is based on XML\XSLT > transforming. > > I used 4Suite libraries for that, but as the speed was unacceptable > for me, I switched to lxml. Everything became much easier

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread Steven D'Aprano
On Thu, 13 Sep 2007 12:47:27 -0700, Carl Banks wrote: > On Sep 13, 9:55 am, Steven D'Aprano <[EMAIL PROTECTED] > cybersource.com.au> wrote: >> On Thu, 13 Sep 2007 12:10:03 +, [EMAIL PROTECTED] wrote: >> > Why not use '_' as the self variable. It is minimal and achieves >> > close to '.var', a

Re: How to Start

2007-09-13 Thread Brandon Barry
On Sep 13, 5:59 pm, [EMAIL PROTECTED] (Michael R. Copeland) wrote: >I've decided that Python is a language/environment I'd like to learn > (I've been a professional programmer for 45+ years), but I really don't > know where and how to start! I have a number of books - and am buying > some more

Re: Python 3K or Python 2.9?

2007-09-13 Thread Steven D'Aprano
On Thu, 13 Sep 2007 20:59:06 +0200, Bjoern Schliessmann wrote: > TheFlyingDutchman wrote: >> Here's a FAQ item where they refer to it as I think Python should have >> done it - a special predefined variable: > > Maybe. Personally, I like it the way it is in Python. > > Why don't you make a prepr

Re: An ordered dictionary for the Python library?

2007-09-13 Thread James Stroud
James Stroud wrote: > set_value_at -> set_value (not simply set) Actually, 'set' seems better than set_value. -- http://mail.python.org/mailman/listinfo/python-list

Re: Lost in __setstate__() in C++ and swig

2007-09-13 Thread Amaury Forgeot d'Arc
Hello, Martin Drautzburg a écrit : > I am trying to cPickle/unpickle a C++ extension class with some private > data members. I wrote __getstate__() and __setstate__ in C++ (I have > to, due to the private data). Pickling writes the following file: > > ccopy_reg > _reconstructor >

Re: Python 3K or Python 2.9?

2007-09-13 Thread Bjoern Schliessmann
Bruno Desthuilliers wrote: > Bjoern Schliessmann a écrit : >> Why don't you make a preprocessor which accepts method >> declarations without "self" and fixes them? > > The problem being that there's no such thing as a "method > declaration" in Python Yep, there are only definitions. I'm sorry.

Re: How to Start

2007-09-13 Thread Tom Brown
On Thursday 13 September 2007 14:59, Michael R. Copeland wrote: >I've decided that Python is a language/environment I'd like to learn > (I've been a professional programmer for 45+ years), but I really don't > know where and how to start! I have a number of books - and am buying > some more -

Re: How to Start

2007-09-13 Thread TheFlyingDutchman
On Sep 13, 2:59 pm, [EMAIL PROTECTED] (Michael R. Copeland) wrote: >I've decided that Python is a language/environment I'd like to learn > (I've been a professional programmer for 45+ years), but I really don't > know where and how to start! I have a number of books - and am buying > some more

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread stef mientki
>>> Certainly, but again: Such main people are not the intended audience. >>> The code is for people that know how to read these equations. I think >>> a general rule of (any form of) writing is to write with your audience >>> in mind. I always do that and happily, that audience is usually nake

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread Steven D'Aprano
On Thu, 13 Sep 2007 13:14:25 -0400, J. Clifford Dyer wrote: > On Thu, Sep 13, 2007 at 04:21:36PM -, Steven D'Aprano wrote > regarding Re: newbie: self.member syntax seems /really/ annoying: >> >> It's not just a matter of taste. >> >> Reading comprehensibility is an objective, measurable qua

How to Start

2007-09-13 Thread Michael R. Copeland
I've decided that Python is a language/environment I'd like to learn (I've been a professional programmer for 45+ years), but I really don't know where and how to start! I have a number of books - and am buying some more - but because of the bewildering number of after-market packages, envi

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread Wildemar Wildenburger
stef mientki wrote: > Wildemar Wildenburger wrote: >> Bruno Desthuilliers wrote: >> >>> OTHO, simple math-illeterate programmers like me will have hard time >>> maintaining such a code. >>> >> Certainly, but again: Such main people are not the intended audience. >> The code is for people t

Re: Subprocess module and unicode input

2007-09-13 Thread Matthew Lausch
Thanks! That worked perfectly. Matt On Sep 7, 10:42 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 07 Sep 2007 18:46:26 -0300, Matthew Lausch <[EMAIL PROTECTED]> > escribi?: > > > I'd like to use thesubprocessmodule with upper level characters in > > the process name or in the argume

Re: Python 3K or Python 2.9?

2007-09-13 Thread Terry Reedy
"TheFlyingDutchman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Here's a FAQ item where they refer to it as I think Python should have | done it - a special predefined variable: | | http://www.faqs.org/docs/javap/c5/s5.html | | "Java provides a special, predefined variable named

Re: automatic parallelization

2007-09-13 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Michael Schlenker <[EMAIL PROTECTED]> wrote: >Mikhail Teterin schrieb: >> While C/C++ and Fortran have OpenMP (http://www.OpenMP.org/), there is >> nothing comparable in Tcl (nor, as far as I know, in the two other >> scripting languages). >> >> Or is there? I'd li

Re: sys.argv index out of range error

2007-09-13 Thread Ian Clark
Brian McCann wrote: > init.sh > > #!/bin/sh > WORKSPACE_ROOT="$1"; > > export > JAVA_OPTIONS="-Djava.library.path=$WORKSPACE_ROOT/:$WORKSPACE_ROOT/:$WORKSPACE_ROOT/" > echo "JAVA_OPTIONS="$JAVA_OPTIONS; > > set > PATH="$WORKSPACE_ROOT/vendor/basistech/rlp5.4/rlp/bin/ia32-glibc23-gcc32:$WORKSP

Re: sys.argv index out of range error

2007-09-13 Thread Miles
On 9/13/07, Brian McCann wrote: > bootstrap.sh > #!/bin/sh > cd /home/workspaces > export LANG="en_US.UTF-8" > > source init $1 > test.py $2 > # > > what's wrong with the line "source init $1 ? Assuming your /bin/sh is actually the Bourne-again shell, this excerpt

Re: Decimal formatting

2007-09-13 Thread [EMAIL PROTECTED]
On Sep 13, 3:50 pm, Harlin Seritt <[EMAIL PROTECTED]> wrote: > Cant believe I have to post this and get help... and can't believe I > couldnt Google it reasonably well enough... I need to take a float > variable and have it display as a string to always have two decimal > places: > > 12. -> 12.

Re: Decimal formatting

2007-09-13 Thread J. Clifford Dyer
On Thu, Sep 13, 2007 at 01:50:51PM -0700, Harlin Seritt wrote regarding Decimal formatting: > > Cant believe I have to post this and get help... and can't believe I > couldnt Google it reasonably well enough... I need to take a float > variable and have it display as a string to always have two d

Re: extract text from log file using re

2007-09-13 Thread Tim Williams
On 13/09/2007, Fabian Braennstroem <[EMAIL PROTECTED]> wrote: > me again... I should describe it better: > the result should be an array with just: > > 498 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04 8.3956e-04 > 3.8560e-03 4.8384e-02 11:40:01 499 > 499 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04

Decimal formatting

2007-09-13 Thread Harlin Seritt
Cant believe I have to post this and get help... and can't believe I couldnt Google it reasonably well enough... I need to take a float variable and have it display as a string to always have two decimal places: 12. -> 12.33 1.0 -> 1.00 etc... Anyone willing to help with this one? thanks, H

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread stef mientki
Wildemar Wildenburger wrote: > Bruno Desthuilliers wrote: > >> OTHO, simple math-illeterate programmers like me will have hard time >> maintaining such a code. >> > Certainly, but again: Such main people are not the intended audience. > The code is for people that know how to read these e

Re: plotting pixels in python

2007-09-13 Thread Jonathan Gardner
On Sep 13, 11:37 am, [EMAIL PROTECTED] wrote: > No currently I am using a canvas from the Tkinter module > What I actually want is to show how a line is plotted pixel by pixel > using a delay loop. I want functions something like putpixel not > draw_line Try drawing 1px wide rectangles. -- http:

Re: An ordered dictionary for the Python library?

2007-09-13 Thread Paul Rubin
Mark Summerfield <[EMAIL PROTECTED]> writes: > > Yes. It should use a functional data structure. > Could you elaborate? I mean use a data structure like an AVL tree, that can make a new dict object quickly, whose contents are the same as the old object except for one element (i.e. most of the con

Re: An ordered dictionary for the Python library?

2007-09-13 Thread James Stroud
Mark Summerfield wrote: > - If an item is inserted it is put in the right place (because the > underlying data structure, b*tree, skiplist or whatever is > intrinsically ordered by < on the key) +1 for all your suggestions below, but -1 for the above. You suggest that myOrderedDict['key'] = va

Re: extract text from log file using re

2007-09-13 Thread Fabian Braennstroem
me again... I should describe it better: the result should be an array with just: 498 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04 8.3956e-04 3.8560e-03 4.8384e-02 11:40:01 499 499 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04 8.3956e-04 3.8560e-03 4.8384e-02 11:40:01 499 500 1.0049e-03 2.4630e-04

Re: Parallel/Multiprocessing script design question

2007-09-13 Thread Paddy
Hi Amit, Why not create a list of those 800+ files and a sccript that when run, looks for an environment variable that will be a number from 1 to 800, selectss the file at that line number and processes it fully. For the process control install a job scheduler such as LSF or the Sun grid Engine ht

Re: Python Database Apps

2007-09-13 Thread Jonathan Gardner
On Sep 12, 9:38 pm, Prateek <[EMAIL PROTECTED]> wrote: > Have you checked out Brainwave?http://www.brainwavelive.com > > We provide a schema-free non-relational database bundled with an app > server which is basically CherryPy with a few enhancements (rich JS > widgets, Cheetah/Clearsilver template

Re: Python Database Apps

2007-09-13 Thread Jonathan Gardner
On Sep 11, 5:56 am, Harry George <[EMAIL PROTECTED]> wrote: > I use postgresql as well. I wonder if Pythonistas do so out of > concern for rigor, clarity, and scalability. It works fine for a > quick one-off effort and still works fine after scaling to a DBMS > server supporting lots of clients,

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread Wildemar Wildenburger
Bruno Desthuilliers wrote: > OTHO, simple math-illeterate programmers like me will have hard time > maintaining such a code. Certainly, but again: Such main people are not the intended audience. The code is for people that know how to read these equations. I think a general rule of (any form of)

Re: automatic parallelization

2007-09-13 Thread Michael Schlenker
Mikhail Teterin schrieb: > While C/C++ and Fortran have OpenMP (http://www.OpenMP.org/), there is > nothing comparable in Tcl (nor, as far as I know, in the two other > scripting languages). > > Or is there? I'd like to, for example, have a version of foreach loop, that > would split the tasks bet

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread Carl Banks
On Sep 13, 9:55 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Thu, 13 Sep 2007 12:10:03 +, [EMAIL PROTECTED] wrote: > > Why not use '_' as the self variable. It is minimal and achieves close > > to '.var', as '_.var' isn't that different. I know its a little > > perl-

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread Bruno Desthuilliers
Wildemar Wildenburger a écrit : > Bjoern Schliessmann wrote: > >>> No, but the point being made is that it would be better IN >>> THIS CASE. >> >> >> It wouldn't. IMHO, rewriting the code to two or three lines would be >> better. >> > > Well I think Charles' Point about making the equations look

Re: Coming from Perl

2007-09-13 Thread Paddy
On Sep 13, 1:30 am, Amer Neely <[EMAIL PROTECTED]> wrote: > I'm a complete newbie with Python, but have several years experience > with Perl in a web environment. > > A question I have, if someone here is familiar with Perl, does Python > have something like Perl's 'here document'? I've just search

Re: Python 3K or Python 2.9?

2007-09-13 Thread Bruno Desthuilliers
Bjoern Schliessmann a écrit : > TheFlyingDutchman wrote: > >>Here's a FAQ item where they refer to it as I think Python should >>have done it - a special predefined variable: > > > Maybe. Personally, I like it the way it is in Python. > > Why don't you make a preprocessor which accepts method d

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread Wildemar Wildenburger
Bjoern Schliessmann wrote: >> No, but the point being made is that it would be better IN >> THIS CASE. > > It wouldn't. IMHO, rewriting the code to two or three lines would be > better. > Well I think Charles' Point about making the equations look like the ones in the paper(s) is a pretty good

Re: Search path for python script

2007-09-13 Thread WGWhalley
This works for me under cygwin. Start the script with the line #! /usr/bin/python Place the script in a directory shown by the command echo $PATH Invoke the script using its name, i.e. test.py -- http://mail.python.org/mailman/listinfo/python-list

sys.argv index out of range error

2007-09-13 Thread Brian McCann
Hi, I trying to create a bootstrap.sh shell script that takes two command line args that passes them to two scripts. one script is init.sh that sets up some environment varilables the other will be a Python script used as the main build script. the contents of the bootstrap file and init.sh a

Re: Python tickets summary

2007-09-13 Thread Facundo Batista
2007/9/10, Facundo Batista <[EMAIL PROTECTED]>: > I modified my tool, whichs makes a summary of all the Python tickets > (I moved the source where the info is taken from SF to our Roundup). > > In result, the summary is now, again, updated daily: Taking an idea from Jeff Rush, now there're separa

Re: Python 3K or Python 2.9?

2007-09-13 Thread Wildemar Wildenburger
TheFlyingDutchman wrote: >> (Can you tell I'm currently forced to developing in Java? ;) (Which I'm >> currently avoiding to do, by wasting my time on usenet.)) >> > > Maybe you can sneak Jython into the mix. Just describe it as "this > Java scripting language". > > Hehe, devious idea. I might j

Re: Quick Modules question

2007-09-13 Thread Carsten Haese
On Thu, 2007-09-13 at 14:01 -0500, Lamonte Harris wrote: > How do you import modules that aren't in the main python Lib folder? > Is it possible to keep it in the same file as the script thats being > ran? See http://docs.python.org/tut/node8.html#SECTION00811 and http://catb.org/~

Re: plotting pixels in python

2007-09-13 Thread Paul McGuire
On Sep 13, 1:37 pm, [EMAIL PROTECTED] wrote: > On Sep 13, 11:22 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > > > On Sep 13, 1:03 pm, [EMAIL PROTECTED] wrote: > > > > hi to all > > > I am just a beginner of python. I want to know how pixels are plotted > > > in python. I am not intending to use PIL

extract text from log file using re

2007-09-13 Thread Fabian Braennstroem
Hi, I would like to delete a region on a log file which has this kind of structure: #--flutest 498 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04 8.3956e-04 3.8560e-03 4.8384e-02 11:40:01 499 499 1.0086e-03 2.4608e-04 9.8589e-05

Quick Modules question

2007-09-13 Thread Lamonte Harris
How do you import modules that aren't in the main python Lib folder? Is it possible to keep it in the same file as the script thats being ran? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3K or Python 2.9?

2007-09-13 Thread Bjoern Schliessmann
TheFlyingDutchman wrote: > Here's a FAQ item where they refer to it as I think Python should > have done it - a special predefined variable: Maybe. Personally, I like it the way it is in Python. Why don't you make a preprocessor which accepts method declarations without "self" and fixes them? Re

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread Bjoern Schliessmann
OKB (not okblacke) wrote: What kind of name is this? > No, but the point being made is that it would be better IN > THIS CASE. It wouldn't. IMHO, rewriting the code to two or three lines would be better. No need to scream, BTW. Regards, Björn -- BOFH excuse #447: According to Microsoft, it

Re: plotting pixels in python

2007-09-13 Thread J. Clifford Dyer
On Thu, Sep 13, 2007 at 06:37:43PM -, [EMAIL PROTECTED] wrote regarding Re: plotting pixels in python: > > On Sep 13, 11:22 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > > On Sep 13, 1:03 pm, [EMAIL PROTECTED] wrote: > > > > > hi to all > > > I am just a beginner of python. I want to know how

Re: Car-ac-systems

2007-09-13 Thread John Timney \(MVP\)
ho ho..now thats quite funny! Regards John Timney (MVP) http://www.johntimney.com http://www.johntimney.com/blog <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sep 11, 9:35 am, "John Timney \(MVP\)" > <[EMAIL PROTECTED]> wrote: >> How do I control one with C# then! Thats

Re: plotting pixels in python

2007-09-13 Thread jo5867472
On Sep 13, 11:22 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Sep 13, 1:03 pm, [EMAIL PROTECTED] wrote: > > > hi to all > > I am just a beginner of python. I want to know how pixels are plotted > > in python. I am not intending to use PIL because I don't need to > > manipulate images. So is the

Re: Python 3K or Python 2.9?

2007-09-13 Thread TheFlyingDutchman
> > (Can you tell I'm currently forced to developing in Java? ;) (Which I'm > currently avoiding to do, by wasting my time on usenet.)) > Maybe you can sneak Jython into the mix. Just describe it as "this Java scripting language". -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread Carsten Haese
On Thu, 2007-09-13 at 09:05 -0700, Charles Fox wrote: > when you are implementing a model from a published > paper, the variables tend to be single greek or roman letter names, > possibly with subscripts and superscripts, and it helps if the name > you see on the screen is the same as the name on t

awrkawrprpkar

2007-09-13 Thread Iwan
http://www.martin-stosch-superstar.wg.am/ -- http://mail.python.org/mailman/listinfo/python-list

Re: plotting pixels in python

2007-09-13 Thread Paul McGuire
On Sep 13, 1:03 pm, [EMAIL PROTECTED] wrote: > hi to all > I am just a beginner of python. I want to know how pixels are plotted > in python. I am not intending to use PIL because I don't need to > manipulate images. So is there a simple module for 2D graphics and > plot pixels Here is a *very* si

Troubleshooting installing new package

2007-09-13 Thread Gheorghe Postelnicu
Hi, I have Python 2.5 installed on WinXP and I am trying to install a new package. I ran the setup.py build and I get the following message: C:\packages\reedsolomon-0.1>setup.py build running build running build_ext error: Python was built with Visual Studio 2003; extensions must be built with a

plotting pixels in python

2007-09-13 Thread jo5867472
hi to all I am just a beginner of python. I want to know how pixels are plotted in python. I am not intending to use PIL because I don't need to manipulate images. So is there a simple module for 2D graphics and plot pixels -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3K or Python 2.9?

2007-09-13 Thread Bruno Desthuilliers
TheFlyingDutchman a écrit : > Well I'm with Bruce Eckel - there shouldn't be any argument for the > object in the class method parameter list. def fun(obj, *args, **kw): # generic code here that do something with obj import some_module some_module.SomeClass.fun = fun This is why uniformity is

Re: Help to start python

2007-09-13 Thread kyosohma
On Sep 13, 9:39 am, python_lover <[EMAIL PROTECTED]> wrote: > On Sep 13, 7:23 pm, [EMAIL PROTECTED] wrote: > > > > > python_lover wrote: > > > Hi All, > > > > I'm new to python. I installed python 2.5 and IDLE 1.2.1 . I'm able > > > to run shell commands. > > > > But I don't know how to execute a

Re: Python 3K or Python 2.9?

2007-09-13 Thread Marc 'BlackJack' Rintsch
On Thu, 13 Sep 2007 10:10:57 -0700, TheFlyingDutchman wrote: >> Isn't one of the main ideas behind python that it doesn't force you to >> do (well, declare) anything? And by "ideas" I mean "design decisions". >> Thats exactly what makes python great for prototyping; you just do it >> and see if it

Re: recursion

2007-09-13 Thread Neil Cerutti
On 2007-09-13, Ian Clark <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: >> On 2007-09-13, Gigs_ <[EMAIL PROTECTED]> wrote: >>> Can someone explain me this >>> >> def f(l): >>> if l == []: >>> return [] >>> else: >>> return f(l[1:]) + l[:1] # <= cant figure thi

Re: An ordered dictionary for the Python library?

2007-09-13 Thread [EMAIL PROTECTED]
On Sep 13, 1:27 am, Mark Summerfield <[EMAIL PROTECTED]> wrote: > On 13 Sep, 00:03, Paul Rubin wrote: > > > Mark Summerfield <[EMAIL PROTECTED]> writes: > > > I feel that Python lacks one useful data structure: an ordered > > > dictionary. > > > Do other Python programmer

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread OKB (not okblacke)
Steven D'Aprano wrote: >> And I agree with the OP that the convention is really annoying. >> >> self.rect.width = self.foo(self.rect.x + self.rect.y) * self.boo() >> >> is much less concise than >> >> s.rect.width = s.foo(s.rect.x + s.rect.y) * s.boo() > > > Y do u thnk bng cncis is lwys

Re: recursion

2007-09-13 Thread James Stroud
Ian Clark wrote: > Neil Cerutti wrote: >> On 2007-09-13, Gigs_ <[EMAIL PROTECTED]> wrote: >>> Can someone explain me this >>> >> def f(l): >>> if l == []: >>> return [] >>> else: >>> return f(l[1:]) + l[:1] # <= cant figure this, how is all >>> sum at the end? >> >> In

Re: Python 3K or Python 2.9?

2007-09-13 Thread Stefan Bellon
On Thu, 13 Sep, TheFlyingDutchman wrote: > Bruce said that no other mainstream OO language is explicitly passing > the object as a parameter to class methods. Ada 95 does. And Ada 95 was the first standardized OO language. Now with Ada 2005 you can either pass the the object explicitly as first p

Re: Python 3K or Python 2.9?

2007-09-13 Thread TheFlyingDutchman
> > Isn't one of the main ideas behind python that it doesn't force you to > do (well, declare) anything? And by "ideas" I mean "design decisions". > Thats exactly what makes python great for prototyping; you just do it > and see if it works. As soon as you need to declare things you have to > cha

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread J. Clifford Dyer
On Thu, Sep 13, 2007 at 04:21:36PM -, Steven D'Aprano wrote regarding Re: newbie: self.member syntax seems /really/ annoying: > > It's not just a matter of taste. > > Reading comprehensibility is an objective, measurable quantity, and I > would bet that "(self.foo + self.bar) * self.baz" wo

Re: Python 3K or Python 2.9?

2007-09-13 Thread Wildemar Wildenburger
TheFlyingDutchman wrote: > What I would like to have seen added to class definitions was the > forced declaration of all object variables in the class outside of > methods. I don't like the fact that they have to be, and can be > created in any method on the fly. > Isn't one of the main ideas behi

Re: Python 3K or Python 2.9?

2007-09-13 Thread TheFlyingDutchman
> > > Here is a link to a tutorial where Sun is talking about the this > > reference: > >http://java.sun.com/docs/books/tutorial/java/javaOO/thiskey.html > > That's a tutorial for getting you started, no reference > documentation or in-depth course. > Here's a FAQ item where they refer to it as I

  1   2   >