Re: Must COMMIT after SELECT (was: Very weird behavior in MySQLdb "execute")

2008-02-06 Thread Frank Aune
On Wednesday 06 February 2008 16:16:45 Paul Boddie wrote: > Really, the rule is this: always (where the circumstances described > above apply) make sure that you terminate a transaction before > attempting to read committed, updated data. How exactly do you terminate a transaction then?Do you term

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

2008-02-06 Thread Raymond Hettinger
[Denis Bilenko] > Why does list have no 'get' method with exactly the same semantics as > dict's get, > that is "return an element if there is one, but do NOT raise > an exception if there is not.": . . . > It is often desirable, for example, when one uses the easiest > command-line options parsin

Re: Looking for library to estimate likeness of two strings

2008-02-06 Thread Daniel Fetchinson
> Are there any Python libraries implementing measurement of similarity > of two strings of Latin characters? > > I'm writing a script to guess-merge two tables based on people's > names, which are not necessarily spelled the same way in both tables > (especially the given names). I would like som

Re: getting all user defined attributes of a class

2008-02-06 Thread Marc 'BlackJack' Rintsch
On Wed, 06 Feb 2008 15:16:26 -0800, Amit Gupta wrote: > On Feb 6, 2:55 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> Amit Gupta schrieb: >> > I should make class A as: >> > class A (object) : >> > x = 1 >> >> > Now, x is class attribute and I am looking for some-way to filter non- >> > us

beginner question, function returning object.

2008-02-06 Thread bambam
I started with ths: -- def open_pipe(): pipe=PIPE() print pipe return pipe pipe=open_pipe() pipe.parent = self.parent print pipe -- It didn't do what I wanted: when I printed the pipe the second time it was not the same object as

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

2008-02-06 Thread Paul Rubin
"Denis Bilenko" <[EMAIL PROTECTED]> writes: > port = sys.argv.get(1) or 8000 I like the suggestion, except it should be port = int(sys.argv.get(1, '8000')) one could imagine your example going wrong in a protocol where 0 is a valid port number. -- http://mail.python.org/mailman/listinf

Why does list have no 'get' method?

2008-02-06 Thread Denis Bilenko
Why does list have no 'get' method with exactly the same semantics as dict's get, that is "return an element if there is one, but do NOT raise an exception if there is not.": def get(self, item, default = None): try: return self[item] except IndexError:

Re: mysqldb: Rows READ or Processed

2008-02-06 Thread Carsten Haese
On Wed, 2008-02-06 at 21:35 -0500, Steve Holden wrote: > Carsten Haese wrote: > > On Wed, 2008-02-06 at 18:53 -0500, Steve Holden wrote: > >> If you mean the number of (say) rows updated by a SQL UPDATE statement, > >> the DB API does not provide any way to access that information > > > > It does

Re: Code block function syntax, anonymous functions decorator

2008-02-06 Thread castironpi
On Feb 6, 4:59 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > > > > > def run3( block ): > >    for _ in range( 3 ): > >       block() > > > run3(): > >    normal_suite() > > > Introduces new syntax; arbitrary functions can follow 'colon'. > > > Maintains reada

Re: loading dictionary from a file

2008-02-06 Thread Adonis Vargas
Amit Gupta wrote: > Need a python trick, if it exists: > > I have a file that stores key, value in following format > -- > "v1" : "k1", > "v2" : "k2" > -- > > Is there a way to directly load this file as dictionary in python. I > could do (foreach line in file, split by ":" and then do dictionary

Re: Looking for library to estimate likeness of two strings

2008-02-06 Thread Jeff Schwab
Steven D'Aprano 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. > ... >> I'm afraid that it isn't. Using Magnus Lie Hetland's implement

Re: Code block function syntax, anonymous functions decorator

2008-02-06 Thread castironpi
On Feb 6, 8:10 pm, [EMAIL PROTECTED] wrote: > On Feb 6, 5:45 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > > > > > > > On Wed, 06 Feb 2008 23:59:27 +0100, "Diez B. Roggisch" <[EMAIL PROTECTED]> > > wrote: > > > >[EMAIL PROTECTED] schrieb: > > >> def run3( block ): > > >>    for _ in range(

Re: Need help with first program to connect to mysql database via apache and python.

2008-02-06 Thread Steve Holden
pythonbrian wrote: > I am just learning python and I am trying to create a simple > connection to a mysql table via Python and Apache, using a Python > program > Unfortunately I keep getting an internal server error (50), when I > bring it up in my browser ... information attached. > Any help would

Re: python beginner problem(?)

2008-02-06 Thread Steve Holden
Steve Holden wrote: > Alan Illeman wrote: >> Win2k Pro - installed python: ok >> [...] >> = > C:\Python25\Lib\site-packages\pythonwin\pywin\mfc\object.py: >> 23: DeprecationWarning: raising a string exception is deprecated >> raise win32ui.error

Re: mysqldb: Rows READ or Processed

2008-02-06 Thread Steve Holden
Carsten Haese wrote: > On Wed, 2008-02-06 at 18:53 -0500, Steve Holden wrote: >> If you mean the number of (say) rows updated by a SQL UPDATE statement, >> the DB API does not provide any way to access that information > > It doesn't? Isn't that what cursor.rowcount does? > When it works, yes. P

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

2008-02-06 Thread Luis M. González
On 6 feb, 21:17, Fuzzyman <[EMAIL PROTECTED]> wrote: > On Feb 6, 9:59 pm, "Luis M. González" <[EMAIL PROTECTED]> wrote: > > > On Feb 6, 6:27 pm, Huayang Xia <[EMAIL PROTECTED]> wrote: > > > > Hello All, > > > > I have several .NET DLL (I have no source code for them), is there > > > anyway to use t

Re: Code block function syntax, anonymous functions decorator

2008-02-06 Thread castironpi
On Feb 6, 5:45 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > 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 ): > >>       block() > > >> run3(): > >>    normal_suit

Re: loading dictionary from a file

2008-02-06 Thread Amit Gupta
On Feb 6, 5:33 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > Amit Gupta <[EMAIL PROTECTED]> writes: > > Need a python trick, if it exists: > > > I have a file that stores key, value in following format > > -- > > "v1" : "k1", > > "v2" : "k2" > > -- > > > Is there a way to directly load this file as d

Re: loading dictionary from a file

2008-02-06 Thread Ben Finney
Amit Gupta <[EMAIL PROTECTED]> writes: > Need a python trick, if it exists: > > I have a file that stores key, value in following format > -- > "v1" : "k1", > "v2" : "k2" > -- > > Is there a way to directly load this file as dictionary in python. That input looks almost like valid JSON http://j

Need help with first program to connect to mysql database via apache and python.

2008-02-06 Thread pythonbrian
I am just learning python and I am trying to create a simple connection to a mysql table via Python and Apache, using a Python program Unfortunately I keep getting an internal server error (50), when I bring it up in my browser ... information attached. Any help would be appreciated ... Thx, [EMAIL

Re: loading dictionary from a file

2008-02-06 Thread Miki
Hello Amit, > Need a python trick, if it exists: > > I have a file that stores key, value in following format > -- > "v1" : "k1", > "v2" : "k2" > -- > > Is there a way to directly load this file as dictionary in python. I > could do (foreach line in file, split by ":" and then do dictionary > inse

Re: mysqldb: Rows READ or Processed

2008-02-06 Thread mcl
On Feb 7, 12:19 am, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Wed, 2008-02-06 at 14:51 -0800, mcl wrote: > > I have looked through Python Database API Specification v2.0, but can > > not find any reference to the number of records processed in a select > > query. > > > I know I can get the numb

loading dictionary from a file

2008-02-06 Thread Amit Gupta
Need a python trick, if it exists: I have a file that stores key, value in following format -- "v1" : "k1", "v2" : "k2" -- Is there a way to directly load this file as dictionary in python. I could do (foreach line in file, split by ":" and then do dictionary insert). Wondering, if some python bu

Re: Using a class as a structure/container

2008-02-06 Thread david . car7
On Feb 6, 2:18 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 06 Feb 2008 00:59:48 -0200, <[EMAIL PROTECTED]> escribi�: > > > > > Is it appropriate to use a class as a simple container in order to > > access attributes using a series of dot operators?  Is their a more > > Pythonic way

Re: Looking for library to estimate likeness of two strings

2008-02-06 Thread Steven D'Aprano
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. ... > I'm afraid that it isn't. Using Magnus Lie Hetland's implementation: ... > In [4]: hamdist('abcde

Re: mysqldb: Rows READ or Processed

2008-02-06 Thread Carsten Haese
On Wed, 2008-02-06 at 14:51 -0800, mcl wrote: > I have looked through Python Database API Specification v2.0, but can > not find any reference to the number of records processed in a select > query. > > I know I can get the number of records returned with cursor.rowcount, > but I want to know the

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

2008-02-06 Thread Fuzzyman
On Feb 6, 9:59 pm, "Luis M. González" <[EMAIL PROTECTED]> wrote: > On Feb 6, 6:27 pm, Huayang Xia <[EMAIL PROTECTED]> wrote: > > > Hello All, > > > I have several .NET DLL (I have no source code for them), is there > > anyway to use them from python instead of from C#. > > > Thanks, > > Huayang > >

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

2008-02-06 Thread Fuzzyman
On Feb 6, 9:27 pm, Huayang Xia <[EMAIL PROTECTED]> wrote: > Hello All, > > I have several .NET DLL (I have no source code for them), is there > anyway to use them from python instead of from C#. > > Thanks, > Huayang To access .NET types you either need to use IronPython or Python.NET. .NET assemb

Re: mysqldb: Rows READ or Processed

2008-02-06 Thread Carsten Haese
On Wed, 2008-02-06 at 18:53 -0500, Steve Holden wrote: > If you mean the number of (say) rows updated by a SQL UPDATE statement, > the DB API does not provide any way to access that information It doesn't? Isn't that what cursor.rowcount does? -- Carsten Haese http://informixdb.sourceforge.net

Re: python beginner problem(?)

2008-02-06 Thread Steve Holden
Alan Illeman wrote: > Win2k Pro - installed python: ok > > Example 2.1 from DiveIntoPython tutorial copied > and pasted into "Pythonwin - Python IDE and GUI > Framework for Windows." > -- > def buildConnectionString(params): > """Buil

Re: mysqldb: Rows READ or Processed

2008-02-06 Thread Steve Holden
mcl wrote: > I have looked through Python Database API Specification v2.0, but can > not find any reference to the number of records processed in a select > query. > > I know I can get the number of records returned with cursor.rowcount, > but I want to know the number of records processed. > If

OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-06 Thread Steven D'Aprano
On Wed, 06 Feb 2008 10:14:10 -0600, Reedick, Andrew wrote: >> > 'c' is also the speed of light. >> >> 'c' is the speed of light _in_a_vacuum_. > > True. > > >> > And since nothing can travel faster than light... >> >> Nothing can travel faster than the speed of light _in_a_vacuum_. There >>

Re: Code block function syntax, anonymous functions decorator

2008-02-06 Thread Jean-Paul Calderone
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 ): >> block() >> >> run3(): >>normal_suite() >> >> Introduces new syntax; arbitrary functions can follow 'colon'. >> >> Maintains re

Re: Looking for library to estimate likeness of two strings

2008-02-06 Thread Robert Kern
Jeff Schwab wrote: > Tim Chase wrote: >>> Are there any Python libraries implementing measurement of similarity >>> of two strings of Latin characters? >> It sounds like you're interested in calculating the Levenshtein distance: >> >> http://en.wikipedia.org/wiki/Levenshtein_distance >> >> which gi

Re: Formatting arrays using myarrayy.tolist()

2008-02-06 Thread Robert Kern
[EMAIL PROTECTED] wrote: > sorry, i should've been more specific, this is a numpy array. It's usually best to ask numpy questions on the numpy mailing list for this reason. http://www.scipy.org/Mailing_Lists -- Robert Kern "I have come to believe that the whole world is an enigma, a harmle

python beginner problem(?)

2008-02-06 Thread Alan Illeman
Win2k Pro - installed python: ok Example 2.1 from DiveIntoPython tutorial copied and pasted into "Pythonwin - Python IDE and GUI Framework for Windows." -- def buildConnectionString(params): """Build a connection string from a diction

Re: getting all user defined attributes of a class

2008-02-06 Thread Amit Gupta
On Feb 6, 2:55 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Amit Gupta schrieb: > > > > > On Feb 6, 2:15 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > >> On Wed, 06 Feb 2008 14:07:23 -0800, Amit Gupta wrote: > >>> Class A(object) : > >>> self.x = 1 > >> This is not valid Python

Re: Adding properties to an instance

2008-02-06 Thread dg . google . groups
On Feb 6, 11:09 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > While this is technically possible (I tried a couple years ago), it > requires hacking the __getattribute__ method, which is something I > would not recommand, not only because it can be tricky, but mostly > because this is a very

Re: Code block function syntax, anonymous functions decorator

2008-02-06 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > def run3( block ): >for _ in range( 3 ): > block() > > run3(): >normal_suite() > > Introduces new syntax; arbitrary functions can follow 'colon'. > > Maintains readability, meaning is consistent. > > Equivalent to: > > def run3( block ): >for _ in

Re: Looking for library to estimate likeness of two strings

2008-02-06 Thread Jeff Schwab
Tim Chase wrote: >> Are there any Python libraries implementing measurement of similarity >> of two strings of Latin characters? > > It sounds like you're interested in calculating the Levenshtein distance: > > http://en.wikipedia.org/wiki/Levenshtein_distance > > which gives you a measure of ho

Re: getting all user defined attributes of a class

2008-02-06 Thread Diez B. Roggisch
Amit Gupta schrieb: > On Feb 6, 2:15 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> On Wed, 06 Feb 2008 14:07:23 -0800, Amit Gupta wrote: >>> Class A(object) : >>> self.x = 1 >> This is not valid Python code. >> >>> I want something like: >>> for userattrib in A.getAllUserAttribute(

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

2008-02-06 Thread Christian Heimes
Huayang Xia wrote: > Is there anyway to import class (to generate objects) from .NET DLL? You can use PythonDotNET if you want to access .NET assemblies in CPython (the standard Python implementation written in C). Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding properties to an instance

2008-02-06 Thread dg . google . groups
On Feb 6, 10:54 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > I'd suggest a small improvement: _A as a class name isn't very nice. > Replace the inner class statement with: > _A = type(self.__class__.__name__ + '_autoprops', (self.__class__,), {}) Ah yes, that's much nicer. > A problem wit

mysqldb: Rows READ or Processed

2008-02-06 Thread mcl
I have looked through Python Database API Specification v2.0, but can not find any reference to the number of records processed in a select query. I know I can get the number of records returned with cursor.rowcount, but I want to know the number of records processed. I suppose the info is in one

Re: TheSchwartz in Python?

2008-02-06 Thread Damjan
> Cool, but sched saves job in memory... > > cron can't be an option. It's just a scheduler not a job queue. You could probably make lpd do what you want to do. -- damjan -- http://mail.python.org/mailman/listinfo/python-list

Re: getting all user defined attributes of a class

2008-02-06 Thread Amit Gupta
On Feb 6, 2:15 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 06 Feb 2008 14:07:23 -0800, Amit Gupta wrote: > > Class A(object) : > > self.x = 1 > > This is not valid Python code. > > > I want something like: > > for userattrib in A.getAllUserAttribute() : > > print usera

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

2008-02-06 Thread Gabriel Genellina
Huayang Xia wrote: >> I have several .NET DLL (I have no source code for them), is there >> anyway to use them from python instead of from C#. En Wed, 06 Feb 2008 19:37:02 -0200, Shane Geiger <[EMAIL PROTECTED]> escribió: > Calling DLL functions from Python > (http://aspn.activestate.com/ASPN

Re: TheSchwartz in Python?

2008-02-06 Thread Steve Holden
js wrote: > Cool, but sched saves job in memory... > > cron can't be an option. It's just a scheduler not a job queue. > Note that "at" and "batch" *are* job queues. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -

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

2008-02-06 Thread Huayang Xia
Or maybe we can do it in IronPython? -- http://mail.python.org/mailman/listinfo/python-list

Re: Paramiko SFTP autologon using id_dsa.pub

2008-02-06 Thread Mike Hjorleifsson
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. On Feb 6, 3:09 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Mike Hjorleifsson wrote: > > Thanks for the response, is there an example bit of code somewhere

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

2008-02-06 Thread Huayang Xia
On Feb 6, 4:59 pm, "Luis M. González" <[EMAIL PROTECTED]> wrote: > On Feb 6, 6:27 pm, Huayang Xia <[EMAIL PROTECTED]> wrote: > > > Hello All, > > > I have several .NET DLL (I have no source code for them), is there > > anyway to use them from python instead of from C#. > > > Thanks, > > Huayang > >

Re: Looking for library to estimate likeness of two strings

2008-02-06 Thread Tim Chase
> Are there any Python libraries implementing measurement of similarity > of two strings of Latin characters? It sounds like you're interested in calculating the Levenshtein distance: http://en.wikipedia.org/wiki/Levenshtein_distance which gives you a measure of how different they are. A measu

Re: getting all user defined attributes of a class

2008-02-06 Thread Marc 'BlackJack' Rintsch
On Wed, 06 Feb 2008 14:07:23 -0800, Amit Gupta wrote: > Class A(object) : > self.x = 1 This is not valid Python code. > I want something like: > for userattrib in A.getAllUserAttribute() : > print userattrib > > My question is, is there a builtin function, called > getAllUserAttributes?

Re: Adding properties to an instance

2008-02-06 Thread [EMAIL PROTECTED]
On 6 fév, 21:06, [EMAIL PROTECTED] wrote: > Hi all, > > So I understand that properties belong to a class not an instance, but > nonetheless I want to add properties to an instance. While this is technically possible (I tried a couple years ago), it requires hacking the __getattribute__ method, wh

getting all user defined attributes of a class

2008-02-06 Thread Amit Gupta
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 in A.getAllUserAttribute() : print userattrib My question is, is there a builtin function, called getAllUserAttributes? Thanks -- http://mail.p

Looking for library to estimate likeness of two strings

2008-02-06 Thread [EMAIL PROTECTED]
Are there any Python libraries implementing measurement of similarity of two strings of Latin characters? I'm writing a script to guess-merge two tables based on people's names, which are not necessarily spelled the same way in both tables (especially the given names). I would like some function

Re: TheSchwartz in Python?

2008-02-06 Thread js
Cool, but sched saves job in memory... cron can't be an option. It's just a scheduler not a job queue. On Feb 7, 2008 1:36 AM, Larry Bates <[EMAIL PROTECTED]> wrote: > > js wrote: > > Hi, > > > > I'm looking for a job queue manager in Python, like TheSchwartz.[1]. > > I found there's TheSchawrtz

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

2008-02-06 Thread Luis M. González
On Feb 6, 6:27 pm, Huayang Xia <[EMAIL PROTECTED]> wrote: > Hello All, > > I have several .NET DLL (I have no source code for them), is there > anyway to use them from python instead of from C#. > > Thanks, > Huayang I used to put my .dll files into the .DLL folder, so I could simply import them a

RE: Why not a Python compiler?

2008-02-06 Thread Jorge Godoy
Reedick, Andrew wrote: >> -Original Message- >> From: [EMAIL PROTECTED] [mailto:python- >> [EMAIL PROTECTED] On Behalf Of Grant Edwards >> >> Nothing can travel faster than the speed of light >> _in_a_vacuum_. There are situtaitons where things can (and >> regularly do) travel faster tha

Re: IronPython vs CPython: faster in 1.6 times?

2008-02-06 Thread Stefan Behnel
Fuzzyman wrote: > On Feb 5, 7:47 pm, 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, the answer is negative: >>> http://shootout.alioth.debian.org/sandbox/bench

Re: IronPython vs CPython: faster in 1.6 times?

2008-02-06 Thread Stefan Behnel
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, the answer is negative: >>> http://shootout.alioth.debian.org/sandbox/be

Re: Adding properties to an instance

2008-02-06 Thread Gabriel Genellina
En Wed, 06 Feb 2008 18:06:48 -0200, <[EMAIL PROTECTED]> escribió: > So I understand that properties belong to a class not an instance, but > nonetheless I want to add properties to an instance. I have a class > which when an instance is created runs some fairly complicated code > and produces a

Re: package import

2008-02-06 Thread Sean Allen
Thanks. Found that 10 minutes after I sent. On Feb 6, 2008, at 4:57 AM, Diez B. Roggisch wrote: > Sean Allen wrote: > >> ok, what am i doing wrong? >> >> in current working directory i have: >> >> t.py >> sub/t1.py >> >> t.py is: >> >> import sub.t1 >> >> i get: >> >> ImportError: No module named

Re: IronPython vs CPython: faster in 1.6 times?

2008-02-06 Thread Carsten Haese
On Wed, 2008-02-06 at 13:39 -0800, Fuzzyman wrote: > On Feb 5, 7:47 pm, 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, the answer is negative: > >

Re: IronPython vs CPython: faster in 1.6 times?

2008-02-06 Thread Fuzzyman
On Feb 5, 6:52 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Jeff wrote: > >IronPythonruns on top of .NET. I would be suspect of any claims that > > it is faster than cPython, just as I would of claims that Stackless or > > Jython are faster. > > Well don't be. There are benchmarks that clearly sh

Re: IronPython vs CPython: faster in 1.6 times?

2008-02-06 Thread Fuzzyman
On Feb 5, 7:47 pm, 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, the answer is negative: > >http://shootout.alioth.debian.org/sandbox/benchmark.php?test=all&l

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

2008-02-06 Thread Shane Geiger
The following links *may* put you on the right path: Calling DLL functions from Python ( http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146847 ), a fairly complete description with some helper class code. Another example ( http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/181063 )

Is there a way to use .NET DLL from Python

2008-02-06 Thread Huayang Xia
Hello All, I have several .NET DLL (I have no source code for them), is there anyway to use them from python instead of from C#. Thanks, Huayang -- http://mail.python.org/mailman/listinfo/python-list

Code block function syntax, anonymous functions decorator

2008-02-06 Thread castironpi
def run3( block ): for _ in range( 3 ): block() run3(): normal_suite() Introduces new syntax; arbitrary functions can follow 'colon'. Maintains readability, meaning is consistent. Equivalent to: def run3( block ): for _ in range( 3 ): block() @run3 def anonfunc(): norm

Re: Adding properties to an instance

2008-02-06 Thread Jared Grubb
Er, instead of "getattr(self,...) you gotta do "object.__getattr__(self,...)" and same for setattr and delattr. Dumb error on my part. (Otherwise you get infinite recursion!) On Feb 6, 2008 12:43 PM, Jared Grubb <[EMAIL PROTECTED]> wrote: > Here's one way of doing what you're asking... I would su

Re: Adding properties to an instance

2008-02-06 Thread Jared Grubb
Here's one way of doing what you're asking... I would suggest using __getattribute__ and __setattr__ to dispatch the methods to the custom class you invent that holds all those properties. For example (I simplified your makeprops into __init__ just to keep the example short, but you can probably s

Re: Paramiko SFTP autologon using id_dsa.pub

2008-02-06 Thread Martin v. Löwis
Mike Hjorleifsson wrote: > Thanks for the response, is there an example bit of code somewhere i > could digest ? I did c.connect("",username="loewis") with ssh-agent, and it worked just fine. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Adding properties to an instance

2008-02-06 Thread dg . google . groups
Hi all, So I understand that properties belong to a class not an instance, but nonetheless I want to add properties to an instance. I have a class which when an instance is created runs some fairly complicated code and produces a set of names which I'd like to be able to access via properties. At

Re: Why chdir command doesn't work with client.get_transport() ?

2008-02-06 Thread Charles_hans
Thank you, Matt, for your valuable advice! My application is converting (to sftp/ssh) a script which used ftp/telnet to load/copy/zip files with labels to/from a ClearCase server. ClearCase is a version control software similar to MS Source Safe or PVCS. The command 'ct setview aViewName' is just

Re: Formatting arrays using myarrayy.tolist()

2008-02-06 Thread Alan G Isaac
http://www.scipy.org/Cookbook/InputOutput> hth, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Broke my IDLE!

2008-02-06 Thread kdwyer
Just to clarify my earlier comment... IDLE (on Windows, at least) creates a folder called .idlerc in the current directory when it is called. If you amend the key bindings two files, config-keys.cfg and config-main.cfg are created. config- keys.cfg contains the amended key bindings and config-ma

Re: Paramiko SFTP autologon using id_dsa.pub

2008-02-06 Thread Mike Hjorleifsson
Thanks for the response, is there an example bit of code somewhere i could digest ? On Feb 6, 1:35 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > I wrote a lil module using paramiko's module to send a file via > > sftp.. it works great using the username and password. > > I would prefer to u

Professional Grant Proposal Writing Workshop (May 2008: Salt Lake City, Utah)

2008-02-06 Thread Anthony Jones
The Grant Institute's Grants 101: Professional Grant Proposal Writing Workshop will be held in Salt Lake City, Utah, May 12 - 14, 2008. Interested development professionals, researchers, faculty, and graduate students should register as soon as possible, as demand means that seats will fill up q

Re: Server side cookie problems

2008-02-06 Thread Gabriel Genellina
En Wed, 06 Feb 2008 15:27:53 -0200, rodmc <[EMAIL PROTECTED]> escribi�: > Hi, I am trying to set a cookie on a client computer using the Cookie > module however all I get is the text being printed in the browser > window. Can anyone point me in the right direction so that the cookie > > def writ

Re: Formatting arrays using myarrayy.tolist()

2008-02-06 Thread gmaximus6
sorry, i should've been more specific, this is a numpy array. -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple interpreters retaining huge amounts of memory

2008-02-06 Thread Martin v. Löwis
> What objects need to be shared across interpreters? > > My thought was to add an interpreter number to the PyThreadState > structure, to increment it when Py_NewInterpreter is called, and to > keep track of the interpreter that creates each object. On deletion, > all memory belonging to the

Re: Formatting arrays using myarrayy.tolist()

2008-02-06 Thread Colin J. Williams
Max Abrahams wrote: > I've got an array that looks like this: > > >> >> p.xv[20:25] > > array([[ 1.60783821e-01, 1.04174046e+01, -1.74045566e-03, > 6.02421398e-01, 2.16078382e+00, -1.60783821e-02], >[ 1.66704816e-01, 1.04390422e+01, -1.90421758e-03, > 5.817

Re: Tkinter fonts setting

2008-02-06 Thread Gabriel Genellina
En Wed, 06 Feb 2008 14:02:35 -0200, Unnamed One <[EMAIL PROTECTED]> escribi�: > jim-on-linux wrote: >> On Tuesday 05 February 2008 15:22, Unnamed >> One wrote: >> >>> First question - is it possible to set >>> font to default OS font for window text? >>> It would be preferable, while on my >>> W

Re: IronPython vs CPython: faster in 1.6 times?

2008-02-06 Thread Isaac Gouy
On Feb 6, 12:04 am, [EMAIL PROTECTED] wrote: > Stefan Behnel: > > > This doesn't look like Mono to me: > >IronPython 1.1 (1.1) on .NET 2.0.50727.42 > > You are right! No. > I think this shows that IronPython isn't faster than > CPython at all :-) (And it uses more memory). -- http://mail.p

Re: IronPython vs CPython: faster in 1.6 times?

2008-02-06 Thread Isaac Gouy
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, the answer is negative: > >http://shootout.alioth.debian.org/sandbox/benchmark.php?test=all&

Re: Installing PyQt

2008-02-06 Thread Phil Thompson
On Wednesday 06 February 2008, Marcus Strube wrote: > Hi > > I was trying to install PyQt, but things don't work as promised. > > I'm working on OS X 10.5, didn't install another version of Python - > so it's 2.5.1 -, installed the latest "qt-mac-opensource-4.3.3.dmg" > and the latest sip 4.7.3. Bu

Re: Paramiko SFTP autologon using id_dsa.pub

2008-02-06 Thread Martin v. Löwis
> I wrote a lil module using paramiko's module to send a file via > sftp.. it works great using the username and password. > I would prefer to use id_dsa.pub to have an autologon and not save > the > password anywhere on the disk.. I cant find a good example of this. > Can anyone help ? When you h

Re: Why not a Python compiler?

2008-02-06 Thread Carl Friedrich Bolz
Hi Luis, Luis M. Gonzalez wrote: > Well, lets suppose that being faster than C is the real goal... How about we call it a very long-term dream? > Are you confident that it will be reached? We have ideas how to get there, but it is really rather long-term. There will be a lot of research needed

Re: Installing PyQt

2008-02-06 Thread Diez B. Roggisch
Marcus Strube schrieb: > Hi > > I was trying to install PyQt, but things don't work as promised. > > I'm working on OS X 10.5, didn't install another version of Python - so > it's 2.5.1 -, installed the latest "qt-mac-opensource-4.3.3.dmg" and the > latest sip 4.7.3. But when I then try to run

Re: Why chdir command doesn't work with client.get_transport() ?

2008-02-06 Thread Gabriel Genellina
En Wed, 06 Feb 2008 12:39:55 -0200, <[EMAIL PROTECTED]> escribió: > If I had access to the > list from where I currently work any other way I would use that. Have you Web access? You can read *and* post messages using: Google Groups http://groups.google.com/group/comp.lang.python/ Gmane http:

Installing PyQt

2008-02-06 Thread Marcus Strube
Hi I was trying to install PyQt, but things don't work as promised. I'm working on OS X 10.5, didn't install another version of Python - so it's 2.5.1 -, installed the latest "qt-mac-opensource-4.3.3.dmg" and the latest sip 4.7.3. But when I then try to run python configure.py for PyQt 4.3.

Re: smtpd module

2008-02-06 Thread Gabriel Genellina
En Wed, 06 Feb 2008 05:36:05 -0200, Stefan Witzel <[EMAIL PROTECTED]> escribi�: > the documentation of the smtpd module in the Python Library Reference > is very short, I think. Are there any examples available? Especially > I'm interested in the DebuggingServer. Yes, the documentation is rathe

Server side cookie problems

2008-02-06 Thread rodmc
Hi, I am trying to set a cookie on a client computer using the Cookie module however all I get is the text being printed in the browser window. Can anyone point me in the right direction so that the cookie data is set without it appearing in the browser? A shortened version of the code is below, in

Re: Why not a Python compiler?

2008-02-06 Thread Luis M. Gonzalez
Hi Carl, Well, lets suppose that being faster than C is the real goal... Are you confident that it will be reached? How far is it at this moment? I've been following the project but the scarcity of news is getting me anxious... Cheers, Luis On Feb 6, 2008 2:14 PM, Carl Friedrich Bolz <[EMAIL P

Formatting arrays using myarrayy.tolist()

2008-02-06 Thread Max Abrahams
I've got an array that looks like this: >>> p.xv[20:25] array([[ 1.60783821e-01, 1.04174046e+01, -1.74045566e-03, 6.02421398e-01, 2.16078382e+00, -1.60783821e-02], [ 1.66704816e-01, 1.04390422e+01, -1.90421758e-03, 5.81767402e-01, 2.16670482e+00, -1.6

Re: Why not a Python compiler?

2008-02-06 Thread Carl Friedrich Bolz
Reedick, Andrew wrote: >> -Original Message- >> From: [EMAIL PROTECTED] [mailto:python- >> [EMAIL PROTECTED] On Behalf Of Luis M. González >> Sent: Tuesday, February 05, 2008 6:44 PM >> To: python-list@python.org >> Subject: Re: Why not a Python compiler? >> >> >> Pypy is a very ambitious p

Re: Why not a Python compiler?

2008-02-06 Thread Steve Holden
Reedick, Andrew wrote: >> -Original Message- >> From: [EMAIL PROTECTED] [mailto:python- >> [EMAIL PROTECTED] On Behalf Of Grant Edwards >> Sent: Wednesday, February 06, 2008 10:35 AM >> To: python-list@python.org >> Subject: Re: Why not a Python compiler? >> >> On 2008-02-06, Reedick, Andre

Re: TheSchwartz in Python?

2008-02-06 Thread Steve Holden
Larry Bates wrote: > js wrote: >> Hi, >> >> I'm looking for a job queue manager in Python, like TheSchwartz.[1]. >> I found there's TheSchawrtz server, RPC server powered by Gearman, >> to which Python/Ruby can connect [2], but setting up two languages env >> is a little cumbersome to me. >> >> Is

Re: TheSchwartz in Python?

2008-02-06 Thread Larry Bates
js wrote: > Hi, > > I'm looking for a job queue manager in Python, like TheSchwartz.[1]. > I found there's TheSchawrtz server, RPC server powered by Gearman, > to which Python/Ruby can connect [2], but setting up two languages env > is a little cumbersome to me. > > Is there any alternative to th

Re: Traversing python datatypes via http

2008-02-06 Thread Larry Bates
Mark wrote: > Is it possible to traverse say python lists via http:// > > say there is a list in the memory > > can we traverse the list using list/next list/prev list/first list/last > > is there a pythonic library to do that? > > thanks > It sounds like what you want would be implemented usi

  1   2   >