Requesting direction for installation problem

2008-11-26 Thread Frederic Rentsch
Hi, Where can one get assistance if a Windows installation service fails to install an msi installer? I used to download zip files, but they seem to have been replaced with msi files. I know this issue is off topic here. So my question simply is: where is it not off topic? Thanks for any hin

Re: what's so difficult about namespace?

2008-11-26 Thread Stefan Behnel
Glenn Linderman wrote: > it appears the > OP understands that issue, and is asking why languages without > namespaces don't add them. Note that Xah Lee is not generally someone who (or something that) "asks" in order to learn something or to understand issues better. The more general interest appe

Re: Reg Expression - Get position of >

2008-11-26 Thread Duncan Booth
"Chris Rebert" <[EMAIL PROTECTED]> wrote: > On Wed, Nov 26, 2008 at 1:48 AM, M_H <[EMAIL PROTECTED]> >> >> I have a beginning of a (longer) string who is like: >> mystr = '

Re: How to get a directory file descriptor?

2008-11-26 Thread Cong Ma
alex23 wrote: > On Nov 26, 3:26 pm, greg <[EMAIL PROTECTED]> wrote: >> os.O_DIRECTORY must be fairly new -- it doesn't exist >> in my 2.5 installation. But os.O_RDONLY seems to work >> just as well for this purpose. > > Which OS are you using? > > Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)

Tkinter and asyncronous socket

2008-11-26 Thread maxlosblob
Hi all, I'm new to python and I've been spending the last week on GUI that refresh its content based on data periodically coming from a remote socket. I succeded in doing it (thanks newsgroups and online manual!) using the Tkinter.after method to implement a busy wait on the socket (which I had pre

Re: Python C/API simple debugging

2008-11-26 Thread Stefan Behnel
k3xji wrote: > I am new to Python C API and finding it difficult to debug C > extensions. So, basically I want to see the value of an integer value > during the C API. Here is the code: > > #define LAST_MIX_VAL 0xDEADBEEF > > static PyObject * > chash(PyObject *self, PyObject *args) > { > uns

Re: Python C/API simple debugging

2008-11-26 Thread k3xji
On Nov 26, 1:34 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: > k3xji wrote: > > I am new to Python C API and finding it difficult to debug C > > extensions. So, basically I want to see the value of an integer value > > during the C API. Here is the code: > > > #define LAST_MIX_VAL 0xDEADBEEF > > >

Re: Python C/API simple debugging

2008-11-26 Thread Diez B. Roggisch
k3xji wrote: > On Nov 26, 1:34 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: >> k3xji wrote: >> > I am new to Python C API and finding it difficult to debug C >> > extensions. So, basically I want to see the value of an integer value >> > during the C API. Here is the code: >> >> > #define LAST_MIX

Re: Python C/API simple debugging

2008-11-26 Thread k3xji
On Nov 26, 1:43 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > k3xji wrote: > > On Nov 26, 1:34 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: > >> k3xji wrote: > >> > I am new to Python C API and finding it difficult to debug C > >> > extensions. So, basically I want to see the value of an inte

Re: Requesting direction for installation problem

2008-11-26 Thread Bruno Desthuilliers
Frederic Rentsch a écrit : Hi, Where can one get assistance if a Windows installation service fails to install an msi installer? I used to download zip files, but they seem to have been replaced with msi files. I know this issue is off topic here. So my question simply is: where is it not off

[lambda]Is the behavior expected?

2008-11-26 Thread Alphones
Hi all, def getFunc(x): return lambda y : x + y if __name__ == '__main__': todo = [] proc = getFunc(1) todo.append(lambda: proc(1)) proc = getFunc(2) todo.append(lambda: proc(1)) proc = getFunc(3) todo.append(lambda: proc(1)) todo.append(lambda: getFunc(1)(1)

Re: Tkinter and asyncronous socket

2008-11-26 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Hi all, I'm new to python and I've been spending the last week on GUI > that refresh its content based on data periodically coming from a > remote socket. > I succeded in doing it (thanks newsgroups and online manual!) using > the Tkinter.after method to implement a busy

Re: Multiple equates

2008-11-26 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: >Cameron Laird wrote: > >> I've been trying to decide if there's any sober reason to advocate >> the one-liner >> >> map(lambda i: a.__setitem__(i, False), [x1, x2, x3, ..., x1024]) > >Are lambdas like the Dark Sid

ONLINE EARNINGS $$$ 500 - $$$ 1000 PER MONTH WITHOUT INVESTMENT...

2008-11-26 Thread alan wells
ONLINE EARNINGS $$$ 500 - $$$ 1000 PER MONTH WITHOUT INVESTMENT... projectpayday has been proven to a legit source of income that can be earned the same day you sign up.the best programme i found in online that it pays more than $100 perday to me. they provides you step by step guide untill than y

Re: Is the behavior expected?

2008-11-26 Thread bearophileHUGS
Alphones: > it is a little deferent from other script language. See also here: http://en.wikipedia.org/wiki/Dynamic_scope#Dynamic_scoping Python doesn't have such automatic closures, probably for performance reasons and/or maybe to keep its C implementation simpler (maybe other people here can gi

Re: How to get a directory file descriptor?

2008-11-26 Thread Nick Craig-Wood
Cong Ma <[EMAIL PROTECTED]> wrote: > Thanks for your reply. I checked my Python 2.5 install on Linux and there's > the > O_DIRECTORY flag. However this is not mentioned anywhere in the Library > Reference. > > There's another question regarding to this flag though: I checked the manual > of

Re: Getting in to metaprogramming

2008-11-26 Thread Hendrik van Rooyen
"Aaron Brady" <[EMAIL PROTECTED]> wrote: >I don't know a clean, reliable way to structure a metaprogram though. >Mine always turn out messy. Yes. Then another thing - it strikes me that any problem that can be solved by metaprogramming, can be solved by putting similar code into a class and ins

Re: what's so difficult about namespace?

2008-11-26 Thread Joshua Cranmer
Xah Lee wrote: In many languages, they don't have namespace and is often a well known sour point for the lang. For example, Scheme has this problem up till R6RS last year. PHP didn't have namespace for the past decade till about this year. Javascript, which i only have working expertise, didn't h

Apache & mod_python: I don't receive anything with POST method

2008-11-26 Thread tengounplanb
Hi, I'm using a simple form to make possible the users of our site upload files. The "upload.py" looks like this: from mod_python import apache, util; def index(req): form = util.FieldStorage(req, keep_blank_values=1) try: # form is

Re: Using dictionary to hold regex patterns?

2008-11-26 Thread Bruno Desthuilliers
André a écrit : (snip) you don't need to use pattern.items()... Here is something I use (straight cut-and-paste): def parse_single_line(self, line): '''Parses a given line to see if it match a known pattern''' for name in self.patterns: result = self.patterns[nam

Re: Reg Expression - Get position of >

2008-11-26 Thread Chris Rebert
On Wed, Nov 26, 2008 at 1:48 AM, M_H <[EMAIL PROTECTED]> wrote: > On Nov 25, 11:06 pm, r <[EMAIL PROTECTED]> wrote: >> On Nov 25, 4:33 pm, Jorgen Grahn <[EMAIL PROTECTED]> wrote: >> >> >> >> > On Tue, 25 Nov 2008 12:41:53 -0800 (PST), r <[EMAIL PROTECTED]> wrote: >> > > On Nov 25, 10:36 am, M_H <[E

Re: Is the behavior expected?

2008-11-26 Thread Alphones
On 11月26日, 下午8时48分, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Alphones wrote: > > Hi all, > > > def getFunc(x): > > return lambda y : x + y > > > if __name__ == '__main__': > > todo = [] > > proc = getFunc(1) > > todo.append(lambda: proc(1)) > > proc = getFunc(2) > > t

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-26 Thread Antoon Pardon
On 2008-11-20, greg <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: > >> You are changing your argument. In a follow up you >> made the point that call by value should be as it >> was intended by the writers of the algol 60 report. > > No, I was countering the argument that "call by value" > is s

Re: Security implications of using open() on untrusted strings.

2008-11-26 Thread Jorgen Grahn
On Tue, 25 Nov 2008 23:37:25 +0100, News123 <[EMAIL PROTECTED]> wrote: > Jorgen Grahn wrote: >> Compare with a language (does Perl allow this?) where if the string >> is "rm -rf /|", open will run "rm -rf /" and start reading its output. >> *That* interface would have been > Good example. (

Re: How to get a directory file descriptor?

2008-11-26 Thread Cong Ma
Nick Craig-Wood wrote: > Here is how you do exactly that in python using ctypes > > from ctypes import CDLL, c_char_p, c_int, Structure, POINTER > from ctypes.util import find_library > > class c_dir(Structure): > """Opaque type for directory entries, corresponds to struct DIR""" > c_dir_p =

Re: How to get a directory file descriptor?

2008-11-26 Thread alex23
On Nov 26, 11:07 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > alex23 wrote: > > I'm pretty certain it was present under Windows XP as well. > > Since these two are the exact same version I presume O_DIRECTORY is not > meaningful on Windows. Anyway, when I try to use O_RDONLY on Vista I get > "Perm

Re: Getting in to metaprogramming

2008-11-26 Thread Michele Simionato
On Nov 26, 11:55 pm, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > Then another thing - it strikes me that any problem that can be solved > by metaprogramming, can be solved by putting similar code into a class > and instanciating an instance. > > Does anybody know if this is true? > > If it is

Re: confused about classes and tkinter object design

2008-11-26 Thread Bruno Desthuilliers
marc wyburn a écrit : Hi, I've created my first Tkinter GUI class which consists of some buttons that trigger functions. I have also created a tkFileDialog.askdirectory control to local a root folder for log files. I have several file paths that depend on the value of tkFileDialog.askdirectory

Python C/API simple debugging

2008-11-26 Thread k3xji
Hi all, I am new to Python C API and finding it difficult to debug C extensions. So, basically I want to see the value of an integer value during the C API. Here is the code: #define LAST_MIX_VAL 0xDEADBEEF static PyObject * chash(PyObject *self, PyObject *args) { unsigned int key,result; //

Re: Python surpasses Perl in popularity?

2008-11-26 Thread Steve Holden
Roy Smith wrote: > In article <[EMAIL PROTECTED]>, > Jorgen Grahn <[EMAIL PROTECTED]> wrote: > >> Hard to take a popularity index seriously when Logo is at #19 and >> Bourne shell at #32 ... and then they suggest that their readers can >> use it "to make a strategic decision about what programmi

Re: Reg Expression - Get position of >

2008-11-26 Thread M_H
On Nov 25, 11:06 pm, r <[EMAIL PROTECTED]> wrote: > On Nov 25, 4:33 pm, Jorgen Grahn <[EMAIL PROTECTED]> wrote: > > > > > On Tue, 25 Nov 2008 12:41:53 -0800 (PST), r <[EMAIL PROTECTED]> wrote: > > > On Nov 25, 10:36 am, M_H <[EMAIL PROTECTED]> wrote: > > >> Hey, > > > >> I need the position of the

Re: what's so difficult about namespace?

2008-11-26 Thread Xah Lee
On Nov 26, 5:45 am, Joshua Cranmer <[EMAIL PROTECTED]> wrote: > > i cannot fathom what could possibly be difficult of > > introducing or implementing a namespace mechanism into a language. > > Namespaces go to the very core of a language, name resolution. > Retroactively adding such a feature is ex

Re: zope vs openACS

2008-11-26 Thread Stefan Scholl
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Stefan Scholl a écrit : >> [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >>> On Nov 19, 1:50 am, gavino <[EMAIL PROTECTED]> wrote: what is nicer about each? >>> Yes. >> >> And No. >> > Or maybe ? This isn't Haskell. -- http://mail.python.org/

Re: How to get a directory file descriptor?

2008-11-26 Thread Steve Holden
alex23 wrote: > On Nov 26, 3:26 pm, greg <[EMAIL PROTECTED]> wrote: >> os.O_DIRECTORY must be fairly new -- it doesn't exist >> in my 2.5 installation. But os.O_RDONLY seems to work >> just as well for this purpose. > > Which OS are you using? > > Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)

Re: Python/C API: using from a shared library

2008-11-26 Thread Robie Basak
On 2008-11-25, Robie Basak <[EMAIL PROTECTED]> wrote: > If I use dlopen() to open a shared library that I've written, and that > shared library tries to use the Python/C API, then it fails. I've > reduced the problem to the test case below. The error is: > > ImportError: /usr/lib/python2.5/lib-dynl

Re: Python C/API simple debugging

2008-11-26 Thread Philip Semanchuk
On Nov 26, 2008, at 6:47 AM, k3xji wrote: By the way for simple print-debugging, below works right now, I forgot to try that fprintf(stderr,"%d", key); As a new extension developer myself, I'll pass along the following handy macro that I swiped from another extension (psycopg I think):

Re: Python surpasses Perl in popularity?

2008-11-26 Thread Marco Mariani
Steve Holden wrote: In fact all that's really happened is that Perl has slid down the ranks, at least temporarily. Python has been around the 6/7 mark for a while now. Also.. can someone attempt to explain the funny correlation in popularity over time between, for instance, Python and Delphi?

How to use Py_DEBUG ?

2008-11-26 Thread MCG
Hello, Does somebody know how to debug this kind of bug ? (see following traceback) I suppose that the bug is in my program (executable with python embedded) and not in python... but how to locate it ? I tried to compile all C sources calling Python.h with -DPy_DEBUG and to link my code against co

Re: Getting in to metaprogramming

2008-11-26 Thread Steven D'Aprano
On Thu, 27 Nov 2008 00:55:33 +0200, Hendrik van Rooyen wrote: > "Aaron Brady" <[EMAIL PROTECTED]> wrote: > > >>I don't know a clean, reliable way to structure a metaprogram though. >>Mine always turn out messy. > > Yes. > > Then another thing - it strikes me that any problem that can be solved

Re: Is the behavior expected?

2008-11-26 Thread Alphones
On 11月26日, 下午9时28分, [EMAIL PROTECTED] wrote: > Alphones: > > > it is a little deferent from other script language. > > See also here:http://en.wikipedia.org/wiki/Dynamic_scope#Dynamic_scoping > > Python doesn't have such automatic closures, probably for performance > reasons and/or maybe to keep it

Re: How to get a directory file descriptor?

2008-11-26 Thread alex23
On Nov 26, 8:56 pm, Cong Ma <[EMAIL PROTECTED]> wrote: > Thanks for your reply. I checked my Python 2.5 install on Linux and there's > the > O_DIRECTORY flag. However this is not mentioned anywhere in the Library > Reference. Yes, I just noticed that myself. >        O_DIRECTORY >              

Re: what's so difficult about namespace?

2008-11-26 Thread Lew
Xah Lee wrote: Of languages that do have namespace that i [sic] have at least working expertise: Mathematica, Perl, Python, Java. Knowing these langs sufficiently well, i [sic] do not see anything special about namespace. The _essence_ of namespace is that a char is choosen as a separator, and th

Re: Getting in to metaprogramming

2008-11-26 Thread Kay Schluehr
On 25 Nov., 11:08, Rafe <[EMAIL PROTECTED]> wrote: > Hi, > > In the name of self-education can anyone share some pointers, links, > modules, etc that I might use to begin learning how to do some > "metaprogramming". That is, using code to write code (right?) > > Cheers, > > - Rafe http://www.letme

Re: [lambda]Is the behavior expected?

2008-11-26 Thread Diez B. Roggisch
Alphones wrote: > Hi all, > > > def getFunc(x): > return lambda y : x + y > > if __name__ == '__main__': > todo = [] > proc = getFunc(1) > todo.append(lambda: proc(1)) > proc = getFunc(2) > todo.append(lambda: proc(1)) > proc = getFunc(3) > todo.append(lambda: pr

Re: Pyhon (with wxPython) on Windows' cygwin: can it be done fully ?

2008-11-26 Thread Steve Holden
Barak, Ron wrote: > Hi Pythonistas, > > I read diaz's comments with interest, but - in my current configuration, I'm > unable to use pdb. > > I'm developing on cygwin and use wxPython. > Consequently, I cannot use native cygwin Python, but my Python is actually > the Windows XP Python (i.e., /

Re: Python surpasses Perl in popularity?

2008-11-26 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Marco Mariani <[EMAIL PROTECTED]> wrote: > Steve Holden wrote: > > > In fact all that's really happened is that Perl has slid down the ranks, > > at least temporarily. Python has been around the 6/7 mark for a while now. > > Also.. can someone attempt to explain

Re: what's so difficult about namespace?

2008-11-26 Thread Steve Holden
Xah Lee wrote: > On Nov 26, 5:45 am, Joshua Cranmer <[EMAIL PROTECTED]> wrote: >>> i cannot fathom what could possibly be difficult of >>> introducing or implementing a namespace mechanism into a language. >> Namespaces go to the very core of a language, name resolution. >> Retroactively adding suc

Re: Is the behavior expected?

2008-11-26 Thread Diez B. Roggisch
Alphones wrote: > On 11月26日, 下午9时28分, [EMAIL PROTECTED] wrote: >> Alphones: >> >> > it is a little deferent from other script language. >> >> See also here:http://en.wikipedia.org/wiki/Dynamic_scope#Dynamic_scoping >> >> Python doesn't have such automatic closures, probably for performance >> reas

Re: Enumerating k-segmentations of a sequence

2008-11-26 Thread bullockbefriending bard
On Nov 26, 12:15 am, [EMAIL PROTECTED] wrote: > bullockbefriending bard napisa³(a): > > > > > I'm not sure if my terminology is precise enough, but what I want to > > do is: > > > Given an ordered sequence of n items, enumerate all its possible k- > > segmentations. > > > This is *not* the same as

Re: How to get a directory file descriptor?

2008-11-26 Thread Terry Reedy
Steve Holden wrote: import os hasattr(os, 'O_DIRECTORY') True I'm pretty certain it was present under Windows XP as well. f = os.open(".", os.O_DIRECTORY) Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'O_DIRECTORY' The 3.0 manu

Re: Python surpasses Perl in popularity?

2008-11-26 Thread Xah Lee
On Nov 25, 2:47 pm, Jorgen Grahn <[EMAIL PROTECTED]> wrote: > On Mon, 24 Nov 2008 20:25:51 -0500, [EMAIL PROTECTED] <[EMAIL PROTECTED]> > wrote: > > QuotingXahLee<[EMAIL PROTECTED]>: > > >> herald: Python surpasses Perl in popularity! > > >> According to > >> ?TIOBE Programming Community Index for

Re: what's so difficult about namespace?

2008-11-26 Thread Wojtek
Xah Lee wrote : i cannot fathom what could possibly be difficult of introducing or implementing a namespace mechanism into a language. I do not understand, why so many languages that lacks so much needed namespace for so long? If it is a social problem, i don't imagine they would last so long. It

Re: Is the behavior expected?

2008-11-26 Thread Peter Otten
Alphones wrote: > On 11月26日, 下午9时28分, [EMAIL PROTECTED] wrote: >> Alphones: >> >> > it is a little deferent from other script language. >> >> See also here:http://en.wikipedia.org/wiki/Dynamic_scope#Dynamic_scoping >> >> Python doesn't have such automatic closures, probably for performance >> reas

Re: Python surpasses Perl in popularity?

2008-11-26 Thread Steve Holden
Xah Lee wrote: > On Nov 25, 2:47 pm, Jorgen Grahn <[EMAIL PROTECTED]> wrote: >> On Mon, 24 Nov 2008 20:25:51 -0500, [EMAIL PROTECTED] <[EMAIL PROTECTED]> >> wrote: >>> QuotingXahLee<[EMAIL PROTECTED]>: herald: Python surpasses Perl in popularity! According to ?TIOBE Programming Comm

Re: what's so difficult about namespace?

2008-11-26 Thread Xah Lee
Xah Lee wrote: > > i cannot fathom what could possibly be difficult of > > introducing or implementing a namespace mechanism into a language. I > > do not understand, why so many languages that lacks so much needed > > namespace for so long? If it is a social problem, i don't imagine they > > would

Re: Is the behavior expected?

2008-11-26 Thread Michele Simionato
On Nov 26, 2:28 pm, [EMAIL PROTECTED] wrote: > Alphones: > > > it is a little deferent from other script language. > > See also here:http://en.wikipedia.org/wiki/Dynamic_scope#Dynamic_scoping > > Python doesn't have such automatic closures, probably for performance > reasons and/or maybe to keep it

Re: what's so difficult about namespace?

2008-11-26 Thread Stefan Behnel
Xah Lee wrote: >> The IT community has enough trouble getting a few ISPs to upgrade their >> DNS software. How are you going to get millions of general users to >> upgrade? > > alright, that's speaks for Javascript. > > But how's that apply to, say, Scheme lisp, Emacs lisp, PHP? Think before you

Re: what's so difficult about namespace?

2008-11-26 Thread George Sakkis
On Nov 26, 11:42 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Xah Lee wrote: > >> The IT community has enough trouble getting a few ISPs to upgrade their > >> DNS software. How are you going to get millions of general users to > >> upgrade? > > > alright, that's speaks for Javascript. > > > But h

Re: what's so difficult about namespace?

2008-11-26 Thread Xah Lee
On Nov 26, 8:42 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > XahLeewrote: > >> The IT community has enough trouble getting a few ISPs to upgrade their > >> DNS software. How are you going to get millions of general users to > >> upgrade? > > > alright, that's speaks for Javascript. > > > But how

Re: what's so difficult about namespace?

2008-11-26 Thread Xah Lee
Xah Lee wrote: > i cannot fathom what could possibly be difficult of > introducing or implementing a namespace mechanism into a language. Joshua Cranmer wrote: >> Namespaces go to the very core of a language, name resolution. >> Retroactively adding such a feature is extremely difficult because th

Re: what's so difficult about namespace?

2008-11-26 Thread Hendrik van Rooyen
"Steve Holden" <[EMAIL PROTECTED]> wrote: > And before anyone bothers to point it out, yes, I know PHO now (finally) > has namespaces. I cannot resist oulling the oiss... Its not the first time... :-) - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting in to metaprogramming

2008-11-26 Thread Hendrik van Rooyen
"Steven D'Aprano" wrote: > > Well, I don't know about "any problem". And it's not so much about > whether metaprograms can solve problems that can't be solved by anything > else, as whether metaprograms can solve problems more effectively than > other techniques. > > If you include factory

import in a class

2008-11-26 Thread TP
Hi everybody, Here is a file "test_import_scope.py": ## class a(): import re def __init__( self ): if re.search( "to", "toto" ): self.se = "ok!" def print_se( self ): print self.se a().print_se() ## When python executes this file, we obtain an error:

Re: import in a class

2008-11-26 Thread Chris Rebert
On Wed, Nov 26, 2008 at 9:30 AM, TP <[EMAIL PROTECTED]> wrote: > Hi everybody, > > Here is a file "test_import_scope.py": > ## > class a(): > import re > def __init__( self ): > if re.search( "to", "toto" ): > self.se = "ok!" > def print_se( self ): > print self.se >

Is it possible (and wise) to extend the None-type ?

2008-11-26 Thread Stef Mientki
hello, I've the idea that I always have a lot of useless code in my programs, like the next example. def _On_Menu_File_Open ( self, event = None ): if event : event.Skip () instead of def _On_Menu_File_Open ( self, event = None ): event.Skip () So I would like to extend the None-ty

best IDE

2008-11-26 Thread asit
Which one is the best IDE for python -- http://mail.python.org/mailman/listinfo/python-list

Re: best IDE

2008-11-26 Thread Chris Rebert
On Wed, Nov 26, 2008 at 9:59 AM, asit <[EMAIL PROTECTED]> wrote: > Which one is the best IDE for python This was recently discussed. To avoid needlessly rehashing said discussion, see the thread at http://groups.google.com/group/comp.lang.python/browse_thread/thread/7fd136aef1c63e47/fbaff9006

Re: best IDE

2008-11-26 Thread asit
On Nov 26, 11:09 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > On Wed, Nov 26, 2008 at 9:59 AM, asit <[EMAIL PROTECTED]> wrote: > > Which one is the best IDE for python > > This was recently discussed. To avoid needlessly rehashing said > discussion, see the thread > athttp://groups.google.

Re: Is it possible (and wise) to extend the None-type ?

2008-11-26 Thread Chris Rebert
On Wed, Nov 26, 2008 at 9:55 AM, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > I've the idea that I always have a lot of useless code in my programs, > like the next example. > > def _On_Menu_File_Open ( self, event = None ): > if event : >event.Skip () > > instead of > > def _On_Men

Re: Getting in to metaprogramming

2008-11-26 Thread Kay Schluehr
On 27 Nov., 05:41, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > Given that, can anybody think of an example that you could not do with > a class? (excepting the "stored procedure" aspect) I just noticed that corepy 1.0 [1] has been released. Corepy is an embedded DSL for synthesizing machin

Re: Reg Expression - Get position of >

2008-11-26 Thread Jorgen Grahn
On Wed, 26 Nov 2008 01:48:59 -0800 (PST), M_H <[EMAIL PROTECTED]> wrote: > On Nov 25, 11:06 pm, r <[EMAIL PROTECTED]> wrote: >> On Nov 25, 4:33 pm, Jorgen Grahn <[EMAIL PROTECTED]> wrote: ... >> > Depends on if you have an irrational fear of REs or not ... I agree >> > that REs are overused for t

Re: Is it possible (and wise) to extend the None-type ?

2008-11-26 Thread John Machin
On Nov 27, 4:55 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > I've the idea that I always have a lot of useless code in my programs, > like the next example. > >   def _On_Menu_File_Open ( self, event = None ): >     if event : >      event.Skip () > > instead of > >   def _On_Menu_File_

Re: best IDE

2008-11-26 Thread Mike Driscoll
On Nov 26, 11:59 am, asit <[EMAIL PROTECTED]> wrote: > Which one is the best IDE for python You'll probably also want to take a look at the Python wiki: http://wiki.python.org/moin/PythonEditors Mike -- http://mail.python.org/mailman/listinfo/python-list

newbie question

2008-11-26 Thread Nan
Hello, I just started to use Python. I wrote the following code and expected 'main' would be called. def main(): print "hello" main But I was wrong. I have to use 'main()' to invoke main. The python interpreter does not give any warnings for the above code. Is there any way/tool to easily d

Python equivalent of Common Lisp Macros?

2008-11-26 Thread dpapathanasiou
I'm using the feedparser library to extract data from rss feed items. After I wrote this function, which returns a list of item titles, I noticed that most item attributes would be retrieved the same way, i.e., the function would look exactly the same, except for the single data.append line inside

Re: newbie question

2008-11-26 Thread Albert Hopkins
On Wed, 2008-11-26 at 11:11 -0800, Nan wrote: > Hello, >I just started to use Python. I wrote the following code and > expected 'main' would be called. > > def main(): > print "hello" > > main > > But I was wrong. I have to use 'main()' to invoke main. The python > interpreter does not giv

Re: newbie question

2008-11-26 Thread Chris Rebert
On Wed, Nov 26, 2008 at 11:11 AM, Nan <[EMAIL PROTECTED]> wrote: > Hello, > I just started to use Python. I wrote the following code and > expected 'main' would be called. > > def main(): > print "hello" > > main > > But I was wrong. I have to use 'main()' to invoke main. The python > interprete

Re: Instance attributes vs method arguments

2008-11-26 Thread Aahz
In article <[EMAIL PROTECTED]>, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > >It is always good practice to provide default values for instance >variables in the class definition, both to enhance readability and to >allow adding documentation regarding the variables, e.g. Actually, my company uses a

Re: Python equivalent of Common Lisp Macros?

2008-11-26 Thread Chris Rebert
On Wed, Nov 26, 2008 at 11:13 AM, dpapathanasiou <[EMAIL PROTECTED]> wrote: > I'm using the feedparser library to extract data from rss feed items. > > After I wrote this function, which returns a list of item titles, I > noticed that most item attributes would be retrieved the same way, > i.e., th

Re: Python equivalent of Common Lisp Macros?

2008-11-26 Thread Diez B. Roggisch
dpapathanasiou schrieb: I'm using the feedparser library to extract data from rss feed items. After I wrote this function, which returns a list of item titles, I noticed that most item attributes would be retrieved the same way, i.e., the function would look exactly the same, except for the sing

Re: Getting in to metaprogramming

2008-11-26 Thread Terry Reedy
Hendrik van Rooyen wrote: I am using the term in the restricted sense of Python writing Python source. Given that, can anybody think of an example that you could not do with a class? (excepting the "stored procedure" aspect) I am not sure I understand your question. def iterize(recursive_f

Re: Python equivalent of Common Lisp Macros?

2008-11-26 Thread Arnaud Delobelle
dpapathanasiou <[EMAIL PROTECTED]> writes: > I'm using the feedparser library to extract data from rss feed items. > > After I wrote this function, which returns a list of item titles, I > noticed that most item attributes would be retrieved the same way, > i.e., the function would look exactly th

Re: Is it possible (and wise) to extend the None-type ?

2008-11-26 Thread Terry Reedy
Stef Mientki wrote: hello, I've the idea that I always have a lot of useless code in my programs, like the next example. def _On_Menu_File_Open ( self, event = None ): if event : event.Skip () instead of def _O So I would like to extend the None-type (if that's possible), with a dum

Re: Python equivalent of Common Lisp Macros?

2008-11-26 Thread J Kenneth King
dpapathanasiou <[EMAIL PROTECTED]> writes: > I'm using the feedparser library to extract data from rss feed items. > > After I wrote this function, which returns a list of item titles, I > noticed that most item attributes would be retrieved the same way, > i.e., the function would look exactly th

Re: what's so difficult about namespace?

2008-11-26 Thread Gene
On Nov 26, 9:15 am, Xah Lee <[EMAIL PROTECTED]> wrote: > On Nov 26, 5:45 am, Joshua Cranmer <[EMAIL PROTECTED]> wrote: > > > > i cannot fathom what could possibly be difficult of > > > introducing or implementing a namespace mechanism into a language. > > > Namespaces go to the very core of a langu

Python+Pyjamas+V8=ftw

2008-11-26 Thread inhahe
I don't know how much the community knows about this - i haven't been participating much of late - but here's something amazing. Apparently javascript is just as dynamic as python, because someone made a python-to-javascript converter in just 1200 line (pyjamas). Meanwhile google's new javascr

Re: Python equivalent of Common Lisp Macros?

2008-11-26 Thread dpapathanasiou
On Nov 26, 2:30 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > On Wed, Nov 26, 2008 at 11:13 AM, dpapathanasiou > > <[EMAIL PROTECTED]> wrote: > > I'm using the feedparser library to extract data from rss feed items. > > > After I wrote this function, which returns a list of item titles, I > > not

asp versus cgi

2008-11-26 Thread davidj411
when i use cgi, i never get a 500 error but i can see how it might take on overhead if many users are hitting the site at once. so to avoid this, i looked into registering the python engine for ASP requests. when i use asp (C:\WINDOWS\system32\inetsrv\asp.dll fileversion info:"--a-- W32i DLL ENU

hello from colombia

2008-11-26 Thread fel
I work in a small software company using php all day, I wish the usage of Python was more common within my company they are starting a new project (insurance stuff) using Java, and I just hate that eventually I'l be debugging someone-else's java code how can I convince them that Python is better, a

asp oddness , why specify ASP twice

2008-11-26 Thread davidj411
for some reason this code works: * <%@ LANGUAGE = Python%> <% Response.Write ("test") %> * but this code does NOT: * <%@ LANGUAGE = Python Response.Write ("test") %>

Re: Is it possible (and wise) to extend the None-type ?

2008-11-26 Thread Jason Scheirer
On Nov 26, 11:40 am, Terry Reedy <[EMAIL PROTECTED]> wrote: > Stef Mientki wrote: > > hello, > > > I've the idea that I always have a lot of useless code in my programs, > > like the next example. > > >  def _On_Menu_File_Open ( self, event = None ): > >    if event : > >     event.Skip () > > > in

Re: Is it possible (and wise) to extend the None-type ?

2008-11-26 Thread Stef Mientki
Alternative (if you *really* want to save the explicit test) is to attach the behaviour modification to the *relevant* class: class NonEvent(Event): def do_nothing(self): pass skip = jump = hop = waltz = saunter = do_nothing def __len__(self): return 0 NON_EVENT = NonEvent(

Re: what's so difficult about namespace?

2008-11-26 Thread Kaz Kylheku
On 2008-11-26, Xah Lee <[EMAIL PROTECTED]> wrote: > comp.lang.lisp,comp.lang.functional,comp.lang.perl.misc,comp.lang.python,comp.lang.java.programmer > > 2008-11-25 > > Recently, Steve Yegge implemented Javascript in Emacs lisp, and > compared the 2 languages. > > http://steve-yegge.blogspot.com/

Re: Is it possible (and wise) to extend the None-type ?

2008-11-26 Thread Stef Mientki
Jason Scheirer wrote: On Nov 26, 11:40 am, Terry Reedy <[EMAIL PROTECTED]> wrote: Stef Mientki wrote: hello, I've the idea that I always have a lot of useless code in my programs, like the next example. def _On_Menu_File_Open ( self, event = None ): if event : ev

Re: what's so difficult about namespace?

2008-11-26 Thread MRAB
Kaz Kylheku wrote: On 2008-11-26, Xah Lee <[EMAIL PROTECTED]> wrote: comp.lang.lisp,comp.lang.functional,comp.lang.perl.misc,comp.lang.python,comp.lang.java.programmer 2008-11-25 Recently, Steve Yegge implemented Javascript in Emacs lisp, and compared the 2 languages. http://steve-yegge.blogs

help with class

2008-11-26 Thread tekion
Hello, I am playing with class. Below is the code snippet: #!/usr/bin/python 2 3 class test_class: 4#import gzip 5def __init__(self,file): 6 self.file = file 7def open_file(self): 8 try: 9 print "file: %s" % self.file

Re: Python surpasses Perl in popularity?

2008-11-26 Thread Hrvoje Niksic
Xah Lee <[EMAIL PROTECTED]> writes: > Bourne Shell, is pretty much replaced by Bash since several years ago. > For example, as far as i know, linuxes today don't have Bourne Shell > anymore. “sh” is just a alias to bash with some compatibility > parameter. That used to be the case, but these days

Re: what's so difficult about namespace?

2008-11-26 Thread Tamas K Papp
On Wed, 26 Nov 2008 21:32:24 +, Kaz Kylheku wrote: > See: > http://arcfn.com/2008/07/why-your-favorite-programming-language-is- unpopular.html That was 404 for me, but http://arcfn.com/2008/07/why-your-favorite-language-is-unpopular.html works. Interesting, thanks for mentioning it. Tamas

Re: Is it possible (and wise) to extend the None-type ?

2008-11-26 Thread M.-A. Lemburg
On 2008-11-26 18:55, Stef Mientki wrote: > hello, > > I've the idea that I always have a lot of useless code in my programs, > like the next example. > > def _On_Menu_File_Open ( self, event = None ): >if event : > event.Skip () > > instead of > > def _On_Menu_File_Open ( self, event

Re: Tkinter and asyncronous socket

2008-11-26 Thread maxlosblob
On 26 Nov, 13:42, Steve Holden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi all, I'm new to python and I've been spending the last week on GUI > > that refresh its content based on data periodically coming from a > > remote socket. > > I succeded in doing it (thanks newsgroups and o

  1   2   >