Re: Paramiko SFTP autologon using id_dsa.pub

2008-02-07 Thread Martin v. Löwis
> sorry i meant a code example that i pass the id_dsa.pub file contents > too > so i am not reliant on the host system to have the ssh-agent. c.connect("",username="loewis",key_filename=".ssh/identity") works for me with ssh-agent disabled. Regards, Martin -- http://mail.python.org/mailman/list

Re: Multiple interpreters retaining huge amounts of memory

2008-02-07 Thread Martin v. Löwis
> Each cycle leaks (or loses) 132k, which is a significant hit -- in my > real program the hit is around 800k/interpreter. > > I ran it through purify (after rebuilding python with the puremodule, no > pymalloc, no optimization, no threads, and debugging), and while the > results are somewhat ambi

Re: Why not a Python compiler?

2008-02-07 Thread Torsten Bronger
Hallöchen! Reedick, Andrew writes: >> -Original Message- >> From: [EMAIL PROTECTED] [mailto:python- >> [EMAIL PROTECTED] On Behalf Of Torsten Bronger >> Sent: Thursday, February 07, 2008 3:32 PM >> To: python-list@python.org >> Subject: Re: Why not a Python compiler? >> >>> I wonder if G

Re: Why does list have no 'get' method?

2008-02-07 Thread Carl Banks
On Feb 7, 8:44 am, Steve Holden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I'd like to know what others think about it, about this anti-feature. > > What I can say is that other computer languages too think that boolean > > operations must return boolean values only, so I am not alon

Re: Why not a Python compiler?

2008-02-07 Thread Arnaud Delobelle
On Feb 7, 11:25 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: > > Be fair -- he's asking what specific features of Python make it > > hard.  That's a reasonable question. > > Indeed.  The best explanation I've seen explained goes something like > this: i

Re: Code block function syntax, anonymous functions decorator

2008-02-07 Thread Arnaud Delobelle
On Feb 8, 6:50 am, [EMAIL PROTECTED] wrote: > Sometimes, it's more appropriate to write > > @call > def f(): >    normal_suite() > > than > > def f(): >    normal_suite() > f(). > > It's clearer to the eye and reader, and truer to the meaning of the > code.  From reading the docs, it's pretty clear

Re: Code block function syntax, anonymous functions decorator

2008-02-07 Thread castironpi
On Feb 7, 7:13 pm, [EMAIL PROTECTED] wrote: > On Feb 7, 2:48 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > > > > > Jean-Paul Calderone schrieb: > > > > On Wed, 06 Feb 2008 23:59:27 +0100, "Diez B. Roggisch" > > > <[EMAIL PROTECTED]> wrote: > > >> [EMAIL PROTECTED] schrieb: > > >>> def run

Pure Python Salsa20 Stream Cipher Implementation

2008-02-07 Thread betabrain . honshu
Hi Folks, for those of you who are familiar with the micropledge.com project, here is a good opportunity to spend or earn something: http://micropledge.com/projects/pysalsa20 I know that the details of this project are still a bit unclear, but that is something we could discuss. By the way, the e

Re: brain stuck. whats occurring here?

2008-02-07 Thread Ben Finney
"Mariano Suárez-Alvarez" <[EMAIL PROTECTED]> writes: > On Feb 7, 3:38 pm, [EMAIL PROTECTED] wrote: > > [disclaimer dozens of lines long] > > Is this absurd signature really necessary? No. http://www.goldmark.org/jeff/stupid-disclaimers/> -- \ "Never use a long word when there's a c

What do Python IDEs use for the member drop-down?

2008-02-07 Thread tbrianedgar
I realize in the new style, getattr and setattr are supposed to reference something in a base class, but here is what I'm trying to do: class tryit: def __init__(self, a, b): self.__dict__["a"] = a self.__dict__["b"] = b def __dir__(self): return [ "geta", "getb" ]

Re: brain stuck. whats occurring here?

2008-02-07 Thread Mariano Suárez-Alvarez
On Feb 7, 3:38 pm, [EMAIL PROTECTED] wrote: > This message and any attachments (the "message") is > intended solely for the addressees and is confidential. > If you receive this message in error, please delete it and > immediately notify the sender. Any use not in accord with > its purpose, any dis

Re: brain stuck. whats occurring here?

2008-02-07 Thread Terry Reedy
"Mark Tolonen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | | <[EMAIL PROTECTED]> wrote in message | news:[EMAIL PROTECTED] | > Hallo, | > | > I'm after | > | > [[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]]] | > | | How about: | | >>> [[[]

Re: brain stuck. whats occurring here?

2008-02-07 Thread Ben Finney
"Mark Tolonen" <[EMAIL PROTECTED]> writes: > <[EMAIL PROTECTED]> wrote: > > I'm after > > [[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]]] > > How about: > > >>> [[[]]*5]*5 > [[[], [], [], [], []], [[], [], [], [], []], [[], [], [], [], []], > [[], [], [], [

Re: brain stuck. whats occurring here?

2008-02-07 Thread Mark Tolonen
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hallo, > > I'm after > > [[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]]] > How about: >>> [[[]]*5]*5 [[[], [], [], [], []], [[], [], [], [], []], [[], [], [], [], []], [[], [], [], [], []], [[]

Re: embedded python in c++ packaging

2008-02-07 Thread Gabriel Genellina
En Thu, 07 Feb 2008 21:05:46 -0200, Furkan Kuru <[EMAIL PROTECTED]> escribió: > I do not have access to my development machine right now. > but is it enough adding just a simple line at the top of my main python > file > 'sys.path.append("modules.zip")' before importing any other modules? Alm

Re: Dear David (was: MyHDL project)

2008-02-07 Thread Dan Upton
On Feb 7, 2008 8:59 PM, ajaksu <[EMAIL PROTECTED]> wrote: > On Feb 7, 10:05 pm, "Blubaugh, David A." <[EMAIL PROTECTED]> wrote: > > I do not understand why people such as yourself cannot construct > > anything but insults and complaints. > > I can help with that. People asked politely a few days ag

Re: Dear David (was: MyHDL project)

2008-02-07 Thread ajaksu
On Feb 7, 10:05 pm, "Blubaugh, David A." <[EMAIL PROTECTED]> wrote: > I do not understand why people such as yourself cannot construct > anything but insults and complaints. I can help with that. People asked politely a few days ago. Didn't you see it? It happens because you're not following basic

Re: beginner question, function returning object.

2008-02-07 Thread bambam
Thank you. So example 2 was clearly wrong, and example 1 was not clear :~). pipe is a serial port object: when I print pipe it shows first that it is connected to port 5, then that it is connected to port 6. I'll discard the clearly wrong code, and concentrate on the unclear code: probably by th

Re: Microsoft's challenger to Python

2008-02-07 Thread Dotan Cohen
On 08/02/2008, Guilherme Polo <[EMAIL PROTECTED]> wrote: > > > I am not, however, an in depth language nutter, so would > > > appreciate any of our more learned readers comments. > > > > Looks like MS forgot E and E and went straight for E this time. > > I couldn't understand what you said, m

Re: Microsoft's challenger to Python

2008-02-07 Thread Daniel Fetchinson
> > > I am not, however, an in depth language nutter, so would > > > appreciate any of our more learned readers comments. Maybe I'm missing the obvious here, but what does Cobra have to do with Microsoft? (Apart from being .NET oriented.) It seems it's an open source project of a guy who doesn't

Re: Microsoft's challenger to Python

2008-02-07 Thread Guilherme Polo
2008/2/7, Dotan Cohen <[EMAIL PROTECTED]>: > On 08/02/2008, Peter Dilley <[EMAIL PROTECTED]> wrote: > > I am not, however, an in depth language nutter, so would > > appreciate any of our more learned readers comments. > > > Looks like MS forgot E and E and went straight for E this time. > I coul

Re: Code block function syntax, anonymous functions decorator

2008-02-07 Thread castironpi
On Feb 7, 2:48 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Jean-Paul Calderone schrieb: > > > > > > > On Wed, 06 Feb 2008 23:59:27 +0100, "Diez B. Roggisch" > > <[EMAIL PROTECTED]> wrote: > >> [EMAIL PROTECTED] schrieb: > >>> def run3( block ): > >>>    for _ in range( 3 ): > >>>       bloc

Re: Microsoft's challenger to Python

2008-02-07 Thread Dotan Cohen
On 08/02/2008, Peter Dilley <[EMAIL PROTECTED]> wrote: > I am not, however, an in depth language nutter, so would > appreciate any of our more learned readers comments. Looks like MS forgot E and E and went straight for E this time. Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-

Re: socket script from perl -> python

2008-02-07 Thread kettle
On Feb 8, 4:01 am, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > kettle <[EMAIL PROTECTED]> writes: > > # pack $length as a 32-bit network-independent long > > my $len = pack('N', $length); > [...] > > the sticking point seems to be the $len variable. > > Use len = struct.pack('!L', length) in Python.

Re: Microsoft's challenger to Python

2008-02-07 Thread José Antonio Salazar Montenegro
All the touted features and the integration with .Net and the friendly Visual Studio IDE will make it a fearsome adversary. And the name clearly suggests where it intends to harvest converts. Interesting times ahead. On 02/07/2008 06:07 PM, Peter Dilley wrote: Looks like Microsoft has a langu

RE: Multiple interpreters retaining huge amounts of memory

2008-02-07 Thread Bronner, Gregory
On the off chance that anyone is still following this: I've got a relatively simple example of a program that loads 100 interpreters (sequentially) which all load the same swig module, do something trival, and exit. Each cycle leaks (or loses) 132k, which is a significant hit -- in my real progra

Re: How to autorun a python script when a specific user logs on?

2008-02-07 Thread jack trades
"Mike Hjorleifsson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > on windows you can put this in HKEY_Local_Machine\Software\Microsoft > \Windows\Current Version\Run and it will run at logon (or fast user > switch) for each user > or if you only want to do it for a specific user you

RE: embedded python in c++ packaging

2008-02-07 Thread Bronner, Gregory
I've done this the rather old-fashioned way. Basically, what I do is: Step 1: Embed Python: if(!::getenv("PYTHONHOME")) { ::putenv("PYTHONHOME="); } if(!::getenv("PYTHONPATH")) { ::putenv("PYTHONPATH=."); } Py_SetProgramName("leaktester"); Py_InitializeEx(0); init_memor

Microsoft's challenger to Python

2008-02-07 Thread Peter Dilley
Looks like Microsoft has a language aimed at taking all of Pythons strengths and attacking its weaknesses. Quoted as a compiled language that has optional dynamic binding. I've just started investigating the web site, but this is looking to shape up to a rather decent challenge to Python for an

RE: Dear David (was: MyHDL project)

2008-02-07 Thread Blubaugh, David A.
I do not understand why people such as yourself cannot construct anything but insults and complaints. Please e-mail me something that is of reasonable technological value regarding Python development, not just informing me that that my messages are difficult to read under circumstances that are ri

Re: brain stuck. whats occurring here?

2008-02-07 Thread [EMAIL PROTECTED]
On Feb 7, 3:13 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 07 Feb 2008 16:16:11 -0200, [EMAIL PROTECTED]   > <[EMAIL PROTECTED]> escribió: > > > On Feb 7, 11:38 am, [EMAIL PROTECTED] wrote: > > I don't see why you should get either. > > > Especially considering this behaviour: > >

Re: Is there a way to use .NET DLL from Python

2008-02-07 Thread Fuzzyman
On Feb 7, 9:38 pm, Huayang Xia <[EMAIL PROTECTED]> wrote: > On Feb 7, 3:30 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > > On Feb 7, 2:35 pm, "Luis M. González" <[EMAIL PROTECTED]> wrote: > > > > On 7 feb, 05:52, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > > Luis M. González wrote: > > > > > On 6

Re: matplotlib install error

2008-02-07 Thread Diez B. Roggisch
John schrieb: > I'm trying to install matplotlib and currently getting the below > error. I searched the group and google and couldn't find anything > similar... Any ideas? > > Thanks in advance! > > src/ft2font.cpp: In member function 'Py::Object > Glyph::get_path(FT_FaceRec_* const&)': > src/f

Re: Why not a Python compiler?

2008-02-07 Thread Hrvoje Niksic
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Be fair -- he's asking what specific features of Python make it > hard. That's a reasonable question. Indeed. The best explanation I've seen explained goes something like this: imagine a hypothetical Python compiler that achieves native compilation

Looking for SpamBayes feedback/help

2008-02-07 Thread skip
Kim Komando recommended SpamBayes (a Python-based Bayesian spam filter - http://www.spambayes.org/) today to her readers/listening audience: http://www.komando.com/coolsites/ On one level this is very gratifying. On another level it's created a whole new set of requests like "Does SpamBayes

Re: Why does list have no 'get' method?

2008-02-07 Thread Gabriel Genellina
En Thu, 07 Feb 2008 19:36:57 -0200, George Sakkis <[EMAIL PROTECTED]> escribió: > On Feb 7, 4:25 pm, Steven D'Aprano <[EMAIL PROTECTED] > cybersource.com.au> wrote: >> On Thu, 07 Feb 2008 15:59:13 +0100, Wildemar Wildenburger wrote: >> >> > val = foo rather than bar >> >> > If that is not clear

Re: Why not a Python compiler?

2008-02-07 Thread Steve Holden
Steven D'Aprano wrote: > On Thu, 07 Feb 2008 09:06:32 -0500, Steve Holden wrote: > >> Ryszard Szopa wrote: >>> On Feb 5, 9:30 am, [EMAIL PROTECTED] wrote: >>> I don't know the exact details but I think the issue is the dynamic nature of Python makes it impossible to correctly store the v

Re: OT: Star Wars and parsecs [was Re: Why not a Python compiler?]

2008-02-07 Thread Steve Holden
Steven D'Aprano wrote: > On Thu, 07 Feb 2008 13:44:05 -0700, Ivan Van Laningham wrote: > >> Gary Kurtz at SunCon 77 explained that it was a test to see if Obi-Wan >> knew what he was doing; supposedly, Obi-Wan's expression indicated that >> he knew Solo was feeding him shit. > > Why the hell woul

Re: embedded python in c++ packaging

2008-02-07 Thread Furkan Kuru
I do not have access to my development machine right now. but is it enough adding just a simple line at the top of my main python file 'sys.path.append("modules.zip")' before importing any other modules? On 2/7/08, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > En Thu, 07 Feb 2008 16:18:57 -0200

Re: beginners help

2008-02-07 Thread Steve Holden
Tim Chase wrote: >> If i enter a center digit like 5 for example i need to create two >> vertical and horzitonal rows that looks like this. If i enter 6 it shows >> 6 six starts. How can i do this, because i don't have any clue. >> >> * >> * * >> * * >> * * >> * > > Well we start by

Re: a trick with lists ?

2008-02-07 Thread Steve Holden
Tim Chase wrote: self.tasks[:] = tasks What I do not fully understand is the line "self.tasks[:] = tasks". Why does the guy who coded this did not write it as "self.tasks = tasks"? What is the use of the "[:]" trick ? >>> It changes the list in-place. If i

Re: Dear David (was: MyHDL project)

2008-02-07 Thread ajaksu
On Feb 7, 4:48 pm, "Blubaugh, David A." <[EMAIL PROTECTED]> wrote: > sir, > > Is there still a possibility to collaborate??? > > David Blubaugh Dear David A. Blubaugh, Could you please make it a little less painful to read your messages? You're giving a bad name to Belcan, too. Daniel -- http:/

Re: Why not a Python compiler?

2008-02-07 Thread Erik Max Francis
Ivan Van Laningham wrote: > Gary Kurtz at SunCon 77 explained that it was a test to see if Obi-Wan > knew what he was doing; supposedly, Obi-Wan's expression indicated > that he knew Solo was feeding him shit. > > I think Lucas didn't have a clue, myself; it's not credible that > citizens of a st

Re: Looking for library to estimate likeness of two strings

2008-02-07 Thread John Machin
On Feb 7, 10:37 pm, [EMAIL PROTECTED] wrote: > > On Wed, 06 Feb 2008 17:32:53 -0600, Robert Kern wrote: > > > > Jeff Schwab wrote: > > ... > > >> If the strings happen to be the same length, the Levenshtein distance > > >> is equivalent to the Hamming distance. > > Is this really what the OP was as

Re: index() of sequence type?

2008-02-07 Thread Gabriel Genellina
En Thu, 07 Feb 2008 20:13:00 -0200, Raymond Hettinger <[EMAIL PROTECTED]> escribió: > On Feb 7, 1:57 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >> Tuples are worse: they implement >> __contains__ but not index. So you can say: >> >> py> 2 in (1,2,4,8) >> True >> >> but not: >> >> py> (1,

Using a signal to terminate a programm running with an asyncore loop

2008-02-07 Thread [EMAIL PROTECTED]
I'm developing a program that runs using an asyncore loop. Right now I can adequately terminate it using Control-C, but as things get refined I need a better way to stop it. I've developed another program that executes it as a child process using popen2.Popen4(). I was attempting to use signals

Re: index() of sequence type?

2008-02-07 Thread Raymond Hettinger
On Feb 7, 1:57 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > Tuples are worse: they implement > __contains__ but not index. So you can say: > > py> 2 in (1,2,4,8) > True > > but not: > > py> (1,2,4,8).index(2) You must be using an old version of Python like 2.5 ;-) As of yesterday, Py2.6 h

matplotlib install error

2008-02-07 Thread John
I'm trying to install matplotlib and currently getting the below error. I searched the group and google and couldn't find anything similar... Any ideas? Thanks in advance! src/ft2font.cpp: In member function 'Py::Object Glyph::get_path(FT_FaceRec_* const&)': src/ft2font.cpp:441: error: 'FT_CURVE

Re: beginners help

2008-02-07 Thread Tim Chase
> If i enter a center digit like 5 for example i need to create two > vertical and horzitonal rows that looks like this. If i enter 6 it shows > 6 six starts. How can i do this, because i don't have any clue. > > * > * * > * * > * * > * Well we start by introducing the neophite progr

Re: index() of sequence type?

2008-02-07 Thread Gabriel Genellina
En Thu, 07 Feb 2008 11:31:44 -0200, Diez B. Roggisch <[EMAIL PROTECTED]> escribió: >> I see list has index member, but is there an index function that applies >> to any sequence type? >> >> If not, shouldn't there be? > > Looks like an oversight to me as well, yes. The only "difficult" > impleme

Re: Small problem executing python script as shortcut

2008-02-07 Thread Larry Bates
Jorgen Bodde wrote: > Hi all, > > This is slightly OT but it drives me nuts. Whenever I create a > shortcut in the start menu (in Windows) of a python script, it will > only execute it when the path where the script resides in contains no > spaces. For example; > > d:\src\app\app.py > > If I dra

Re: a trick with lists ?

2008-02-07 Thread Ed Leafe
On Feb 7, 2008, at 3:19 PM, James Turk wrote: > if you do > a = [1,2,3] > b = [] > b = a > > then assign: b[1] = 9 > now a[1] == 9 as well > > with a[:] = b you are actually getting a copy of the list rather than > an alias Of course, this only works if 'b' is already a list. A more comm

Re: Setting up a new user and environment from within a python script

2008-02-07 Thread Henry Hollenberg
On Feb 7, 3:30 pm, [EMAIL PROTECTED] wrote: > On Feb 7, 11:15 am, Henry Hollenberg <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > > I have written a script that uses environment variables set during > > a particular users login in ".bash_profile" and ".profile". > > > I have changed to that users

Re: index() of sequence type?

2008-02-07 Thread Paul Rubin
Stefan Behnel <[EMAIL PROTECTED]> writes: > def find_index(seq, value): > try: > find_index = seq.index > except AttributeError: > def find_index(value): > for i,v in enumerate(seq): >if v == value: return i > raise V

Re: a trick with lists ?

2008-02-07 Thread Tim Chase
>>> self.tasks[:] = tasks >>> >>> What I do not fully understand is the line "self.tasks[:] = tasks". Why >>> does >>> the guy who coded this did not write it as "self.tasks = tasks"? What is >>> the >>> use of the "[:]" trick ? >> >> It changes the list in-place. If it has been given to ot

Re: Is there a way to use .NET DLL from Python

2008-02-07 Thread Huayang Xia
On Feb 7, 3:30 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > On Feb 7, 2:35 pm, "Luis M. González" <[EMAIL PROTECTED]> wrote: > > > > > On 7 feb, 05:52, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > Luis M. González wrote: > > > > On 6 feb, 21:17, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > > On Feb 6, 9

Re: a trick with lists ?

2008-02-07 Thread [EMAIL PROTECTED]
On 7 fév, 22:16, Steve Holden <[EMAIL PROTECTED]> wrote: > Diez B. Roggisch wrote: > >> self.tasks[:] = tasks > > >> What I do not fully understand is the line "self.tasks[:] = tasks". Why > >> does > >> the guy who coded this did not write it as "self.tasks = tasks"? What is > >> the > >> u

Re: Why does list have no 'get' method?

2008-02-07 Thread George Sakkis
On Feb 7, 4:25 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Thu, 07 Feb 2008 15:59:13 +0100, Wildemar Wildenburger wrote: > > Arnaud Delobelle wrote: > >> Personally, between > > >> * foo if foo else bar > >> * foo or bar > > >> I prefer the second. Maybe it could be spelt

Re: Why does list have no 'get' method?

2008-02-07 Thread Paul Rubin
"Denis Bilenko" <[EMAIL PROTECTED]> writes: > I convinced that this > > line = self._buffer.get(self._bufindex) > if line is None: > self._bufindex += 1 > self._lineno += 1 > self._filelineno += 1 > return line > line = self.readline() I haven't looked

Re: embedded python in c++ packaging

2008-02-07 Thread Gabriel Genellina
En Thu, 07 Feb 2008 16:18:57 -0200, Joshua Kugler <[EMAIL PROTECTED]> escribió: > Furkan Kuru wrote: >> >> I have been developing an application in C++ that embeds Python >> interpreter. It takes advantage of too many modules from Python. >> When I want to package this application, I need to add

Re: Setting up a new user and environment from within a python script

2008-02-07 Thread ericbrunson
On Feb 7, 11:15 am, Henry Hollenberg <[EMAIL PROTECTED]> wrote: > Hello, > > I have written a script that uses environment variables set during > a particular users login in ".bash_profile" and ".profile". > > I have changed to that users uid and gid in my python script using: > > import os > os.se

Re: beginners help

2008-02-07 Thread Steven D'Aprano
On Thu, 07 Feb 2008 13:53:48 +0100, Guido van Brakel wrote: > Hello > > I totally new to python and i'm doing a python course now. Maybe someone > could help me a little bit here: > > I need to create this script. > > If i enter a center digit like 5 for example i need to create two > vertical

Re: Why not a Python compiler?

2008-02-07 Thread Jeroen Ruigrok van der Werven
-On [20080207 22:09], Reedick, Andrew ([EMAIL PROTECTED]) wrote: >Errr... didn't one of the novels explain it away by describing the >kessel run as a region of space warped by black holes or other objects? >Bragging rights for crossing such a field thus centered on shortest >di

Re: a trick with lists ?

2008-02-07 Thread imho
Steve Holden ha scritto: >>> What I do not fully understand is the line "self.tasks[:] = tasks". >>> Why does the guy who coded this did not write it as "self.tasks = >>> tasks"? What is the use of the "[:]" trick ? >> >> It changes the list in-place. If it has been given to other objects, >> i

Re: Why not a Python compiler?

2008-02-07 Thread Steven D'Aprano
On Thu, 07 Feb 2008 09:06:32 -0500, Steve Holden wrote: > Ryszard Szopa wrote: >> On Feb 5, 9:30 am, [EMAIL PROTECTED] wrote: >> >>> I don't know the exact details but I think the issue is the dynamic >>> nature of Python makes it impossible to correctly store the various >>> types and changes in

Re: Why does list have no 'get' method?

2008-02-07 Thread Steven D'Aprano
On Thu, 07 Feb 2008 15:59:13 +0100, Wildemar Wildenburger wrote: > Arnaud Delobelle wrote: >> Personally, between >> >> * foo if foo else bar >> * foo or bar >> >> I prefer the second. Maybe it could be spelt >> >> * foo else bar ? >> > How about > > val = foo rather than bar > > If that is

OT: Star Wars and parsecs [was Re: Why not a Python compiler?]

2008-02-07 Thread Steven D'Aprano
On Thu, 07 Feb 2008 13:44:05 -0700, Ivan Van Laningham wrote: > Gary Kurtz at SunCon 77 explained that it was a test to see if Obi-Wan > knew what he was doing; supposedly, Obi-Wan's expression indicated that > he knew Solo was feeding him shit. Why the hell would the pilot care whether the passe

Re: print 'hello' -> SyntaxError: invalid syntax

2008-02-07 Thread ajaksu
On Feb 7, 12:52 pm, [EMAIL PROTECTED] wrote: > I try to install Python in a Dell D620 with XP PRO version 5.1.2600 > and I am getting this error. I assume that some dlls are missing but I > installed form a fresh python-2.5.1.msi without errors msg. > > Thanks > > Roberto What is the install path

Re: Why not a Python compiler?

2008-02-07 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, Torsten Bronger <[EMAIL PROTECTED]> wrote: > > a parsec was a unit of time. > > The latter because it was corrected in the novelization. > > Tschö, > Torsten. Sounds like one. The reverse of light year that sounds like a unit of time, but isn't. I've heard it

Re: a trick with lists ?

2008-02-07 Thread James Turk
On Feb 7, 12:20 pm, "Sébastien Vincent" free.fr> wrote: > I've found some class on the Net which takes basically this form : > > ## > class Foo: > def __init__(self): > self.tasks = [] >... > > def method1(self): > tasks = [] > while True: > ... > append

Re: a trick with lists ?

2008-02-07 Thread Steve Holden
Diez B. Roggisch wrote: > "S����������������������������������������������" schrieb: >> I've found some class on the Net which takes basically this form : >> >> ## >> class Foo: >> def __init__(self)

Re: brain stuck. whats occurring here?

2008-02-07 Thread Gabriel Genellina
En Thu, 07 Feb 2008 16:16:11 -0200, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > On Feb 7, 11:38 am, [EMAIL PROTECTED] wrote: > I don't see why you should get either. > > Especially considering this behaviour: > a=[] row=[ [] for n in range(0,10) ] a.extend(row[:]) a > [

RE: Why not a Python compiler?

2008-02-07 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Torsten Bronger > Sent: Thursday, February 07, 2008 3:32 PM > To: python-list@python.org > Subject: Re: Why not a Python compiler? > > > > > I wonder if George Lucas intended it as a joke or if

embedding python

2008-02-07 Thread Robert Dailey
Hi, I'm attempting to embed python into my game. What I want to do is the following: 1) Embed the interpreter into my game (Py_Initialize(), etc) using the Python C API 2) Execute modules from my game using the python interpreter (Using boost.python's objects and handles) 3) Expose C++ interfaces

Re: Why not a Python compiler?

2008-02-07 Thread Ivan Van Laningham
Gary Kurtz at SunCon 77 explained that it was a test to see if Obi-Wan knew what he was doing; supposedly, Obi-Wan's expression indicated that he knew Solo was feeding him shit. I think Lucas didn't have a clue, myself; it's not credible that citizens of a starfaring civilization who deliberately

Re: Why not a Python compiler?

2008-02-07 Thread Torsten Bronger
Hallöchen! Grant Edwards writes: > On 2008-02-06, Gary Duzan <[EMAIL PROTECTED]> wrote: > >> In article <[EMAIL PROTECTED]>, >> >> Grant Edwards <[EMAIL PROTECTED]> wrote: >> >>> [...] >>> >>> Ouch. Two demerits for using the distance unit "parsec" in a >>> context where a quantity of time was r

Re: Is there a way to use .NET DLL from Python

2008-02-07 Thread Fuzzyman
On Feb 7, 2:35 pm, "Luis M. González" <[EMAIL PROTECTED]> wrote: > On 7 feb, 05:52, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > > Luis M. González wrote: > > > On 6 feb, 21:17, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > On Feb 6, 9:59 pm, "Luis M. Gonz�lez" <[EMAIL PROTECTED]> wrote: > > > > > > O

Re: Looking for library to estimate likeness of two strings

2008-02-07 Thread Gabriel Genellina
En Thu, 07 Feb 2008 13:25:14 -0200, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > Many thanks for the excellent leads. I've also found several > functions to find phonetic similarity between English names: the > mentioned above soundex, then, also, one called metaphone. I'm now > thinking

Re: Why not a Python compiler?

2008-02-07 Thread Grant Edwards
On 2008-02-06, Gary Duzan <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Grant Edwards <[EMAIL PROTECTED]> wrote: >>On 2008-02-06, Reedick, Andrew <[EMAIL PROTECTED]> wrote: >> >>> One demerit has been marked against your geek card for missing >>> an obvious science pun. Additiona

Re: Why does list have no 'get' method?

2008-02-07 Thread pruebauno
On Feb 7, 12:15 pm, [EMAIL PROTECTED] wrote: > On Feb 7, 11:01 am, "Denis Bilenko" <[EMAIL PROTECTED]> wrote: > > > > > Steve Holden wrote: > > > These versions differ with respect to treatment of blank lines, which > > > indicates how easy it is to go astray in this kind of semantic > > > optimiz

Re: getting all user defined attributes of a class

2008-02-07 Thread George Sakkis
On Feb 7, 1:42 pm, Amit Gupta <[EMAIL PROTECTED]> wrote: > Thanks. What I found is: If I call iterate over the __dict__ of the > instance of the class, I only get user-atttributes and not built-in > attributes. I have an instance of that class, anyway, so this will do. > However, I wonder if I am

Re: Is there a way to use .NET DLL from Python

2008-02-07 Thread Christian Heimes
Huayang Xia wrote: > What's the difference between .NET DLL and normal C DLL? Do you mean > after clr.AddReference('ClassLibrary1'), there is no need to import > ClassLibrary1? A normal DLL and an assembly DLL share only the header. The rest is totally different. You can see the DLL as a container

Re: socket script from perl -> python

2008-02-07 Thread Hrvoje Niksic
kettle <[EMAIL PROTECTED]> writes: > # pack $length as a 32-bit network-independent long > my $len = pack('N', $length); [...] > the sticking point seems to be the $len variable. Use len = struct.pack('!L', length) in Python. See http://docs.python.org/lib/module-struct.html for details. -- htt

Re: re question

2008-02-07 Thread Amit Gupta
On Feb 7, 10:38 am, Amit Gupta <[EMAIL PROTECTED]> wrote: > Python'ites > > I searched around "google" to find the answer to this question, but I > can't: > > I have a named regexp : x = re.compile("(?P[a-z]+)") > > What I want is an iterator, that can return me both the "groupname" > and the match

MyHDL project!!

2008-02-07 Thread Blubaugh, David A.
sir, Is there still a possibility to collaborate??? David Blubaugh -Original Message- From: Blubaugh, David A. Sent: Friday, February 01, 2008 10:44 AM To: 'chewie54' Cc: 'python-list@python.org' Subject: MyHDL project ! Dan, I would be honored to start a project such as th

Re: getting all user defined attributes of a class

2008-02-07 Thread Amit Gupta
On Feb 7, 12:28 am, grflanagan <[EMAIL PROTECTED]> wrote: > On Feb 6, 11:07 pm, Amit Gupta <[EMAIL PROTECTED]> wrote: > > > Hi > > > How do I get user defined attributes of a class? e.g > > > Class A(object) : > > self.x = 1 > > -- > > > I want something like: > > for userattrib

re question

2008-02-07 Thread Amit Gupta
Python'ites I searched around "google" to find the answer to this question, but I can't: I have a named regexp : x = re.compile("(?P[a-z]+)") What I want is an iterator, that can return me both the "groupname" and the matched string, e.g: m = x.search("aa") Somehow, I want to get {"me" : "aa"

Re: Is there a way to use .NET DLL from Python

2008-02-07 Thread Huayang Xia
What's the difference between .NET DLL and normal C DLL? Do you mean after clr.AddReference('ClassLibrary1'), there is no need to import ClassLibrary1? -- http://mail.python.org/mailman/listinfo/python-list

Re: IronPython vs CPython: faster in 1.6 times?

2008-02-07 Thread Isaac Gouy
On Feb 6, 1:54 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Isaac Gouy wrote: > > On Feb 5, 11:47 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > >> [EMAIL PROTECTED] schrieb: > > >>> Mike C. Fletcher: > Not sure if Mono also provides a speedup. > >>> There is a set of good benchmarks here, t

Re: Distinguishing between functions and methods in a decorator.

2008-02-07 Thread Arnaud Delobelle
On Feb 7, 4:10 pm, Berteun Damman <[EMAIL PROTECTED]> wrote: > Hello, > > I was wondering a bit about the differences between methods and > functions. I have the following: > > def wrap(arg): > print type(arg) > return arg > > class C: > def f(): > pass > > @wrap > def g

Re: brain stuck. whats occurring here?

2008-02-07 Thread [EMAIL PROTECTED]
On Feb 7, 11:38 am, [EMAIL PROTECTED] wrote: > Hallo, > > I'm after > > [[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]],[[],[]­,[],[],[]]] > > (NxN 'grid', 5x5 in that example, and while typing this up i figured out > how to get it, but I'm still not sure what _was_ happening)

Setting up a new user and environment from within a python script

2008-02-07 Thread Henry Hollenberg
Hello, I have written a script that uses environment variables set during a particular users login in ".bash_profile" and ".profile". I have changed to that users uid and gid in my python script using: import os os.setegid os.setgid os.seteuid os.setuid but I still am not picking up the needed

Re: embedded python in c++ packaging

2008-02-07 Thread Joshua Kugler
Furkan Kuru wrote: > Hello, > > I have been developing an application in C++ that embeds Python > interpreter. It takes advantage of too many modules from Python. > When I want to package this application, I need to add too many files > (.pyc) from Python/lib folder together with Python25.dll. > I

Re: embedded python in c++ packaging

2008-02-07 Thread Warren Myers
The Python byte-code files are already pretty dense, so compressing them further is unlikely to work if you try to put them in a zip. WMM On Feb 7, 2008 11:39 AM, Furkan Kuru <[EMAIL PROTECTED]> wrote: > Hello, > > I have been developing an application in C++ that embeds Python > interpreter. >

Small problem executing python script as shortcut

2008-02-07 Thread Jorgen Bodde
Hi all, This is slightly OT but it drives me nuts. Whenever I create a shortcut in the start menu (in Windows) of a python script, it will only execute it when the path where the script resides in contains no spaces. For example; d:\src\app\app.py If I drag that to the Start Menu it can be execu

Re: brain stuck. whats occurring here?

2008-02-07 Thread Robin Becker
[EMAIL PROTECTED] wrote: > Hallo, > > I'm after > > [[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]]] > > (NxN 'grid', 5x5 in that example, and while typing this up i figured out > how to get it, but I'm still not sure what _was_ happening) > > > I'm trying

Re: Why does list have no 'get' method?

2008-02-07 Thread Michael Spencer
Wildemar Wildenburger wrote: > Arnaud Delobelle wrote: >> Personally, between >> >> * foo if foo else bar >> * foo or bar >> >> I prefer the second. Maybe it could be spelt >> >> * foo else bar ? >> > How about > > val = foo rather than bar > > If that is not clear and obvios, I don't know what i

Re: Multiple interpreters retaining huge amounts of memory

2008-02-07 Thread Rhamphoryncus
On Feb 2, 10:32 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > The multi interpreter feature has some limitations, but if you know > what you are doing and your application can be run within those > limitations then it works fine. I've been wondering about this for a while. Given the severe li

brain stuck. whats occurring here?

2008-02-07 Thread Matthew_WARREN
Hallo, I'm after [[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]]] (NxN 'grid', 5x5 in that example, and while typing this up i figured out how to get it, but I'm still not sure what _was_ happening) I'm trying a=[] >>> row=[ [] for n in range(0,10) ]

Re: a trick with lists ?

2008-02-07 Thread Diez B. Roggisch
"S����������������������������������������������" schrieb: > I've found some class on the Net which takes basically this form : > > ## > class Foo: > def __init__(self): > self.tasks = [] >

  1   2   >