pyclutter anyone?

2010-02-05 Thread donn
Hi, this is a little bit of a cross-post. I posted to the clutter list, but there's little activity there. I am trying to make sense of pyClutter 1.0. Could anyone point me to an example (or post one) that shows clipping from a path applied to child objects? For example: A star shape that conta

C:\Python25\Lib\IDLELIB\idle.pyw won't start

2010-02-05 Thread Anthra Norell
Hi, I upgraded from 2.4 to 2.5 and am unable to start an 2.5 idle window. This is the command I have been using: C:\Python24\pythonw.exe C:\Python24\Lib\IDLELIB\idle.pyw -n -c execfile('C:\\Python24\\i') And this is the command that doesn't start anything: C:\Python25\pythonw.exe C:\Pyt

Re: Common area of circles

2010-02-05 Thread Shashwat Anand
Here is my approach: # input circles, remove duplicates, store them # check whether all circle intersect: if no: print '0.0' if yes: # calculate intersection points of two circles. # check if that point lies in rest all circles if yes: store it as polygon-coordinates (hull) calculat

Re: C:\Python25\Lib\IDLELIB\idle.pyw won't start

2010-02-05 Thread Alf P. Steinbach
* Anthra Norell: Hi, I upgraded from 2.4 to 2.5 and am unable to start an 2.5 idle window. This is the command I have been using: C:\Python24\pythonw.exe C:\Python24\Lib\IDLELIB\idle.pyw -n -c execfile('C:\\Python24\\i') And this is the command that doesn't start anything: C:\Python25\

Re: xmlrpc slow in windows 7 if hostnames are used

2010-02-05 Thread News123
Yhanks a lot I'll check whether this is the root cause. Currently my machine could live without IPV6 bye N Gabriel Genellina wrote: > En Thu, 04 Feb 2010 19:34:20 -0300, News123 escribió: > >> I wrote a small xmlrpc client on Windows 7 with python 2.6 >> >> srv = xmlrpclib.Server('http://l

Re: Python and Ruby

2010-02-05 Thread Ethan Furman
Robert Kern wrote: On 2010-02-04 14:55 PM, Jonathan Gardner wrote: On Feb 3, 3:39 pm, Steve Holden wrote: Robert Kern wrote: On 2010-02-03 15:32 PM, Jonathan Gardner wrote: I can explain all of Python in an hour; I doubt anyone will understand all of Python in an hour. With all respect,

Re: Your beloved python features

2010-02-05 Thread Ethan Furman
Julian wrote: Hello, I've asked this question at stackoverflow a few weeks ago, and to make it clear: this should NOT be a copy of the stackoverflow-thread "hidden features of Python". I want to design a poster for an open source conference, the local usergroup will have a table there, and in t

Re: xmlrpc slow in windows 7 if hostnames are used

2010-02-05 Thread Jean-Michel Pichavant
News123 wrote: Yhanks a lot I'll check whether this is the root cause. Currently my machine could live without IPV6 bye N Gabriel Genellina wrote: En Thu, 04 Feb 2010 19:34:20 -0300, News123 escribió: I wrote a small xmlrpc client on Windows 7 with python 2.6 srv = xmlrpclib.S

Re: Your beloved python features

2010-02-05 Thread Martin P. Hellwig
On 02/04/10 23:03, Julian wrote: For those guys would be a poster quite cool which describes the most popular and beloved python features. That it is ego-orientated programming ;-) http://mail.python.org/pipermail/python-announce-list/2009-April/007419.html -- mph -- http://mail.python.org/m

Re: Your beloved python features

2010-02-05 Thread Jean-Michel Pichavant
Ethan Furman wrote: Julian wrote: Hello, I've asked this question at stackoverflow a few weeks ago, and to make it clear: this should NOT be a copy of the stackoverflow-thread "hidden features of Python". I want to design a poster for an open source conference, the local usergroup will have a

Re: Building a multiline string

2010-02-05 Thread lallous
@Ulrich: On Feb 4, 1:09 pm, Ulrich Eckhardt wrote: > Just for the record: Neither of the below methods actually produce a > multiline string. They only spread a string containing one line over > multiple lines of source code. > I meant: "Note" -> "Note: I don't want to use new lines" I did not

Re: C:\Python25\Lib\IDLELIB\idle.pyw won't start

2010-02-05 Thread Duncan Booth
Anthra Norell wrote: > Hi, > >I upgraded from 2.4 to 2.5 and am unable to start an 2.5 idle >window. > > This is the command I have been using: >C:\Python24\pythonw.exe C:\Python24\Lib\IDLELIB\idle.pyw -n -c > execfile('C:\\Python24\\i') > > And this is the command that doesn't s

Re: Your beloved python features

2010-02-05 Thread Daniel Fetchinson
>> I've asked this question at stackoverflow a few weeks ago, and to make >> it clear: this should NOT be a copy of the stackoverflow-thread >> "hidden features of Python". >> >> I want to design a poster for an open source conference, the local >> usergroup will have a table there, and in the past

Repost: Read a running process output

2010-02-05 Thread Ashok Prabhu
Hi, I very badly need this to work. I have been googling out for a week with no significant solution. I open a process p1 which does keeps running for 4+ hours. It gives some output in stdout now and then. I open this process with subprocess.Popen and redirect the stdout to PIPE. However when I re

Re: Python and Ruby

2010-02-05 Thread mk
Steve Holden wrote: Jeez, Steve, you're beginning to sound like some kind of fallacy zealot... ;) Death to all those who confuse agumentum ad populum with argumentum ad verecundiam!!! Yeah, what did the zealots ever do for us? They produced Python? . . . Oh Python! Shut up! -- http://

Re: Repost: Read a running process output

2010-02-05 Thread Alain Ketterlin
Ashok Prabhu writes: > from subprocess import * > p1=Popen('/usr/sunvts/bin/64/vtsk -d',stdout=PIPE,shell=True) Use Popen(['/usr/...','-d'],stdout=PIPE), i.e., no shell. -- Alain. -- http://mail.python.org/mailman/listinfo/python-list

Re: Your beloved python features

2010-02-05 Thread bartc
"R Fritz" wrote in message news:e97ff208-d08e-4934-8e38-a40d668cd...@l24g2000prh.googlegroups.com... My favorite feature is its readability. It's as near to pseudo-code as any language we have, and that's valuable in open source projects or when I return to code to modify it. That might be

Simple question about Queue.Queue and threads

2010-02-05 Thread Frank Millman
Hi all Assume you have a server process running, a pool of worker threads to perform tasks, and a Queue.Queue() to pass the tasks to the workers. In order to shut down the server cleanly, you want to ensure that the workers have all finished their tasks. I like the technique of putting a Non

Re: Repost: Read a running process output

2010-02-05 Thread Ashok Prabhu
On Feb 5, 5:12 pm, Alain Ketterlin wrote: > Ashok Prabhu writes: > > from subprocess import * > > p1=Popen('/usr/sunvts/bin/64/vtsk -d',stdout=PIPE,shell=True) > > Use Popen(['/usr/...','-d'],stdout=PIPE), i.e., no shell. > > -- Alain. Hi Alain, Thanks for the response. However it throws an err

Re: Repost: Read a running process output

2010-02-05 Thread Alain Ketterlin
Ashok Prabhu writes: >> > p1=Popen('/usr/sunvts/bin/64/vtsk -d',stdout=PIPE,shell=True) >> >> Use Popen(['/usr/...','-d'],stdout=PIPE), i.e., no shell. >> >> -- Alain. > Thanks for the response. However it throws an error. Please find > below. > from subprocess import * p1=Popen('/usr/

Re: C:\Python25\Lib\IDLELIB\idle.pyw won't start

2010-02-05 Thread Anthra Norell
Thank you both (Alf and Duncan) for your comments. I answer Duncan's questions interleaved: Duncan Booth wrote: Anthra Norell wrote: Hi, I upgraded from 2.4 to 2.5 and am unable to start an 2.5 idle window. This is the command I have been using: C:\Python24\pythonw.exe C:\Pyt

Re: Repost: Read a running process output

2010-02-05 Thread Ashok Prabhu
On Feb 5, 5:58 pm, Alain Ketterlin wrote: > Ashok Prabhu writes: > >> > p1=Popen('/usr/sunvts/bin/64/vtsk -d',stdout=PIPE,shell=True) > > >> Use Popen(['/usr/...','-d'],stdout=PIPE), i.e., no shell. > > >> -- Alain. > > Thanks for the response. However it throws an error. Please find > > below. >

Re: Repost: Read a running process output

2010-02-05 Thread Ashok Prabhu
On Feb 5, 6:33 pm, Ashok Prabhu wrote: > On Feb 5, 5:58 pm, Alain Ketterlin > wrote: > > > > > Ashok Prabhu writes: > > >> > p1=Popen('/usr/sunvts/bin/64/vtsk -d',stdout=PIPE,shell=True) > > > >> Use Popen(['/usr/...','-d'],stdout=PIPE), i.e., no shell. > > > >> -- Alain. > > > Thanks for the re

Re: Your beloved python features

2010-02-05 Thread Roald de Vries
On Feb 5, 2010, at 12:03 AM, Julian wrote: Hello, I've asked this question at stackoverflow a few weeks ago, and to make it clear: this should NOT be a copy of the stackoverflow-thread "hidden features of Python". I want to design a poster for an open source conference, the local usergroup wil

Re: Your beloved python features

2010-02-05 Thread Bruno Desthuilliers
Julian a écrit : Hello, I've asked this question at stackoverflow a few weeks ago, and to make it clear: this should NOT be a copy of the stackoverflow-thread "hidden features of Python". I want to design a poster for an open source conference, the local usergroup will have a table there, and i

Re: C:\Python25\Lib\IDLELIB\idle.pyw won't start

2010-02-05 Thread Duncan Booth
Anthra Norell wrote: >> Using pythonw.exe will start the program with all error output dumped in >> the bit bucket. Running from a command prompt with python.exe will at >> least let you see if there are any errors. >> > python.exe from the command line works all right in a DOS window. The >

which

2010-02-05 Thread mk
if isinstance(cmd, str): self.cmd = cmd.replace(r'${ADDR}',ip) else: self.cmd = cmd or self.cmd = cmd if isinstance(cmd, str): self.cmd = cmd.replace(r'${ADDR}',ip) -- http://mail.python.org/mailman/listinfo/python-list

Re: YAML (was: Python and Ruby)

2010-02-05 Thread Lou Pecora
In article <00f4bb3a$0$15566$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: > On Thu, 04 Feb 2010 09:57:59 -0500, Lou Pecora wrote: > > > Well, that looks a bit more complicated than I would like, but maybe > > it's doing more stuff than I can grok. Here's what I needed and how I > > did i

Re: which

2010-02-05 Thread KDr2
cmd= isinstance(cmd,str) and c.replace('${ADDR}',ip) or cmd Best Regards, -- KDr2 http://kdr2.net On Fri, Feb 5, 2010 at 10:21 PM, mk wrote: > > if isinstance(cmd, str): >self.cmd = cmd.replace(r'${ADDR}',ip) > else: >self.cmd = cmd > > or > > self.cmd = cmd > if isinstance(cmd

Pickling an extension type subclasses problems

2010-02-05 Thread Gaetan de Menten
Hi all, I am trying to write an (optional!) C extension for SQLAlchemy, and I am struggling to make an extension type picklable *and* using the same format as the pure Python version (so that computers with the C extension can unpickle pickles from computers without it and vice-versa). Also the ex

Re: which

2010-02-05 Thread Steve Holden
mk wrote: > > if isinstance(cmd, str): > self.cmd = cmd.replace(r'${ADDR}',ip) > else: > self.cmd = cmd > > or > > self.cmd = cmd > if isinstance(cmd, str): > self.cmd = cmd.replace(r'${ADDR}',ip) > > My own preference is for the latter, but I am sure you will find that opinions ar

Re: which

2010-02-05 Thread Jean-Michel Pichavant
mk wrote: if isinstance(cmd, str): self.cmd = cmd.replace(r'${ADDR}',ip) else: self.cmd = cmd or self.cmd = cmd if isinstance(cmd, str): self.cmd = cmd.replace(r'${ADDR}',ip) I would vote for the first one. But I could use the second as well, I would'nt fight for it. What is w

Re: Your beloved python features

2010-02-05 Thread Jean-Michel Pichavant
Bruno Desthuilliers wrote: Julian a écrit : Hello, I've asked this question at stackoverflow a few weeks ago, and to make it clear: this should NOT be a copy of the stackoverflow-thread "hidden features of Python". I want to design a poster for an open source conference, the local usergroup wi

method to intercept string formatting % operations

2010-02-05 Thread bradallen
Hello, For container class derived from namedtuple, but which also behaves like a dictionary by implementing __getitem__ for non-integer index values, is there a special reserved method which allows intercepting % string formatting operations? I would like for my container type to behave appropria

Re: which

2010-02-05 Thread mk
Jean-Michel Pichavant wrote: What is worrying me the most in your code sample is that self.cmd can hold diferrent types (str, and something else). That is usually a bad thing to do (putting None aside). However, my remark could be totally irrelevant of course, that depends on the context. T

Re: which

2010-02-05 Thread mk
KDr2 wrote: cmd= isinstance(cmd,str) and c.replace('${ADDR}',ip) or cmd Perlish, but I like that. :-) Regards, mk -- http://mail.python.org/mailman/listinfo/python-list

Re: Your beloved python features

2010-02-05 Thread Grant Edwards
On 2010-02-04, Julian wrote: > I've asked this question at stackoverflow a few weeks ago, and > to make it clear: this should NOT be a copy of the > stackoverflow-thread "hidden features of Python". > > I want to design a poster for an open source conference, the > local usergroup will have a tab

Re: which

2010-02-05 Thread Jean-Michel Pichavant
mk wrote: Jean-Michel Pichavant wrote: What is worrying me the most in your code sample is that self.cmd can hold diferrent types (str, and something else). That is usually a bad thing to do (putting None aside). However, my remark could be totally irrelevant of course, that depends on the c

Terminating threaded programs

2010-02-05 Thread mk
Hello everyone, I have a problem with a threaded program: it frequently hangs on sys.exit. The problem is that my program uses threads which in turn use paramiko library, which itself is threaded. I try to gracefully close the threads (below), but it doesn't always work, if paramiko calls ha

Re: ANN: ActivePython 2.6.4.10 is now available

2010-02-05 Thread Tommy Grav
On Feb 5, 2010, at 12:01 AM, Sridhar Ratnakumar wrote: > I'm happy to announce that ActivePython 2.6.4.10 is now available for > download from: > On what platforms does ActivePython run? > > > ActivePython includes installers for the following platforms

Drawing a zig-zag Trail in Python?

2010-02-05 Thread W. eWatson
I'd like to draw something like an animal track. Between each point is a line. Perhaps the line would have an arrow showing the direction of motion. There should be x-y coordinates axises. PIL? MatPlotLib, ?? -- http://mail.python.org/mailman/listinfo/python-list

Re: which

2010-02-05 Thread John Posner
On 2/5/2010 9:21 AM, mk wrote: if isinstance(cmd, str): self.cmd = cmd.replace(r'${ADDR}',ip) else: self.cmd = cmd or self.cmd = cmd if isinstance(cmd, str): self.cmd = cmd.replace(r'${ADDR}',ip) (lunatic fringe?) Last August [1], I offered this alternative: self.cmd = (cmd

Re: method to intercept string formatting % operations

2010-02-05 Thread Jean-Michel Pichavant
bradallen wrote: Hello, For container class derived from namedtuple, but which also behaves like a dictionary by implementing __getitem__ for non-integer index values, is there a special reserved method which allows intercepting % string formatting operations? I would like for my container type

Re: Your beloved python features

2010-02-05 Thread Bruno Desthuilliers
Jean-Michel Pichavant a écrit : Bruno Desthuilliers wrote: My all-time favorite Python feature : it fits my brain. Python is simple ... no offense Bruno :D !-) But FWIW, that's exactly the point : even a stoopid like me can manage to learn and use Python, and proceed to write working apps

Re: which

2010-02-05 Thread mk
Jean-Michel Pichavant wrote: If you can change your program interface, then do it, if not then you're right you don't have much choice as you are suffering from the program poor interface. You can fix this problem by explicitly asking for the thing you want to do, instead of guessing by inspect

Re: which

2010-02-05 Thread Jean-Michel Pichavant
John Posner wrote: On 2/5/2010 9:21 AM, mk wrote: if isinstance(cmd, str): self.cmd = cmd.replace(r'${ADDR}',ip) else: self.cmd = cmd or self.cmd = cmd if isinstance(cmd, str): self.cmd = cmd.replace(r'${ADDR}',ip) (lunatic fringe?) Last August [1], I offered this alternative

Re: list.extend([]) Question

2010-02-05 Thread Aahz
In article <088e7a24-b0d0-4d43-bee7-193e5eaef...@b7g2000pro.googlegroups.com>, Dan Brown wrote: > >Why does extending a list with the empty list result in None? It >seems very counterintuitive to me, at least --- I expected ['a'].extend >([]) to result in ['a'], not None. http://www.python.org/

xmlrcp - how to marshall objects

2010-02-05 Thread Jean-Michel Pichavant
Deos anyone knows where to find an code sample describing how to implement the interface to marshall one object into XMLRPC compliant structures ? I googled without any success, and what google does not find does not exist. Let say I have this very simple class: class Point: def __init__(s

Re: which

2010-02-05 Thread Bruno Desthuilliers
mk a écrit : (snip) So in this context this is fine. But I wanted to make the class more robust. Perhaps I should do smth like this before setting self.cmd? assert isinstance(cmd, basestring) or cmd is None, "cmd should be string or None" and then: if cmd: self.cmd = cmd.replace.. And

Re: which

2010-02-05 Thread Gerald Britton
[snip] > Last August [1], I offered this alternative: > >  self.cmd = (cmd.replace(r'${ADDR}',ip) >              if isinstance(cmd, str) else >              cmd) > > But it didn't get much love in this forum! I'd probably go for that one as well though I might consider removing the outer parenthe

Re: which

2010-02-05 Thread Bruno Desthuilliers
mk a écrit : if isinstance(cmd, str): self.cmd = cmd.replace(r'${ADDR}',ip) else: self.cmd = cmd What could "cmd" be except a string ? From other posts here, I guess it's either a string or None ? If yes, then I'd go for this: if cmd: cmd = cmd.replace(r'${ADDR}',ip) self.cmd = c

Import question

2010-02-05 Thread Andrew Degtiariov
Code of our project has split into several packages and we deploy the project using buildout. All worked fine until I need to dynamically inspect python modules. Here is structure of our src directory ├───project.api.config │ ├───project │ │ └───api │ │ └───config │ │ └

Re: which

2010-02-05 Thread John Posner
On 2/5/2010 11:06 AM, Gerald Britton wrote: [snip] Last August [1], I offered this alternative: self.cmd = (cmd.replace(r'${ADDR}',ip) if isinstance(cmd, str) else cmd) But it didn't get much love in this forum! I'd probably go for that one as well though I mig

Re: Wrap a function

2010-02-05 Thread Aahz
In article , Dennis Lee Bieber wrote: >On 4 Feb 2010 16:18:04 -0800, a...@pythoncraft.com (Aahz) declaimed the >following in gmane.comp.python.general: >> >> But in bash scripting, you'd just use rsync or cp or rm -- maybe an >> example would make clearer how REXX differs from bash. > > I

Re: Drawing a zig-zag Trail in Python?

2010-02-05 Thread mk
W. eWatson wrote: I'd like to draw something like an animal track. Between each point is a line. Perhaps the line would have an arrow showing the direction of motion. There should be x-y coordinates axises. PIL? MatPlotLib, ?? Pycairo? -- http://mail.python.org/mailman/listinfo/python-list

Re: list.extend([]) Question

2010-02-05 Thread Gerald Britton
I think it's because when you do ['a'].extend([]) or whatever, the result is whatever the method "extend" returns. But "extend" has no return value, hence you will see None if you do this interactively. On Fri, Feb 5, 2010 at 10:55 AM, Aahz wrote: > In article <088e7a24-b0d0-4d43-bee7-193e5eaef.

Re: which

2010-02-05 Thread mk
Bruno Desthuilliers wrote: if cmd: self.cmd = cmd.replace.. And what if cmd happens to be the empty string ?-) ok, me --->[] Right, I didn't think much when I wrote that. Anyway, that's back to square one. I will probably go for this anyway: assert isinstance(cmd, basestring)

Re: Python's Reference And Internal Model Of Computing Languages

2010-02-05 Thread David Thole
I read thisand am a tiny bit confused about the actual problem. It's not exactly complex to realize that something like: a = b = array that a and b both point to the array. Logically speaking, I'm not sure how one could assume that the same assignment would yield a and b point to the same dup

Re: Repost: Read a running process output

2010-02-05 Thread Helmut Jarausch
On 02/05/10 14:39, Ashok Prabhu wrote: > On Feb 5, 6:33 pm, Ashok Prabhu wrote: >> On Feb 5, 5:58 pm, Alain Ketterlin >> wrote: >> >> >> >>> Ashok Prabhu writes: >> p1=Popen('/usr/sunvts/bin/64/vtsk -d',stdout=PIPE,shell=True) >> > Use Popen(['/usr/...','-d'],stdout=PIPE), i.e., no shell

Re: which

2010-02-05 Thread Jean-Michel Pichavant
mk wrote: Jean-Michel Pichavant wrote: If you can change your program interface, then do it, if not then you're right you don't have much choice as you are suffering from the program poor interface. You can fix this problem by explicitly asking for the thing you want to do, instead of guessing

Re: Drawing a zig-zag Trail in Python?

2010-02-05 Thread Jean-Michel Pichavant
mk wrote: W. eWatson wrote: I'd like to draw something like an animal track. Between each point is a line. Perhaps the line would have an arrow showing the direction of motion. There should be x-y coordinates axises. PIL? MatPlotLib, ?? Pycairo? turtle http://docs.python.org/library/turtle

Re: Python's Reference And Internal Model Of Computing Languages

2010-02-05 Thread J�rgen Exner
David Thole wrote in comp.lang.perl.misc: >I read thisand am a tiny bit confused about the actual problem. > >It's not exactly complex to realize that something like: >a = b = array >that a and b both point to the array. ??? What are you talking about? First of all you should post actual code

Re: ANN: ActivePython 2.6.4.10 is now available

2010-02-05 Thread Sridhar Ratnakumar
On 2010-02-05, at 6:31 AM, Tommy Grav wrote: > > On Feb 5, 2010, at 12:01 AM, Sridhar Ratnakumar wrote: > >> I'm happy to announce that ActivePython 2.6.4.10 is now available for >> download from: > >> On what platforms does ActivePython run? >> >> >>

Re: which

2010-02-05 Thread John Posner
On 2/5/2010 11:26 AM, Gerald Britton wrote: sure, but it will fit nicely on one line if you like On Fri, Feb 5, 2010 at 11:22 AM, John Posner wrote: On 2/5/2010 11:06 AM, Gerald Britton wrote: [snip] Last August [1], I offered this alternative: self.cmd = (cmd.replace(r

Re: which

2010-02-05 Thread Gerald Britton
> > Did you mean to take this off-list? Nope -- just hit the wrong key  Also, I'm contractually obligated to > admonish you not to "top post". Contract? > > At any rate, I proposed the 3-line format specifically because it separates > the data values from the if-then-else machinery, making it e

Re: xmlrcp - how to marshall objects

2010-02-05 Thread Adam Tauno Williams
On Fri, 2010-02-05 at 17:03 +0100, Jean-Michel Pichavant wrote: > Deos anyone knows where to find an code sample describing how to > implement the interface to marshall one object into XMLRPC compliant > structures ? > I googled without any success, and what google does not find does not exist. >

Re: xmlrcp - how to marshall objects

2010-02-05 Thread mk
Jean-Michel Pichavant wrote: Why not dump the whole thing and use Pyro, which works beautifully and handles all the serialization business by itself, you get a Python object on the other side? Unless xmlrpc has to be at the other end, that is. -- http://mail.python.org/mailman/listinfo/pytho

Re: which

2010-02-05 Thread mk
Jean-Michel Pichavant wrote: > To be honest I have not enough courrage to dive into yout 1000 lines of > script :-) Understandable. > What I can say however: > > 1/ your interface is somehow broken. You ask actions through options (-c > -y -s), meaning one can possibly use all these 3 options

Re: Drawing a zig-zag Trail in Python?

2010-02-05 Thread mk
Jean-Michel Pichavant wrote: mk wrote: W. eWatson wrote: I'd like to draw something like an animal track. Between each point is a line. Perhaps the line would have an arrow showing the direction of motion. There should be x-y coordinates axises. PIL? MatPlotLib, ?? Pycairo? turtle http://

Re: pyclutter anyone?

2010-02-05 Thread donn
No one uses pyClutter? I have some code, it does not work, but maybe this will start to help solve the problem: import clutter from clutter import cogl x,y=0,0 def boo(tl,frame,obj):#,evt): global x,y obj.set_position(x, y) def xy(obj,evt): global x,y x,y = ev

timer for a function

2010-02-05 Thread mk
I have the following situation: 1. self.conobj = paramiko.SSHClient() self.conobj.connect(self.ip, username=self.username, key_filename=self.sshprivkey, port=self.port, timeout=opts.timeout) 2. very slow SSH host that is hanging for 30+ seconds on key exchange. The timeout in the options re

Re: xmlrcp - how to marshall objects

2010-02-05 Thread Jean-Michel Pichavant
Jean-Michel Pichavant wrote: Deos anyone knows where to find an code sample describing how to implement the interface to marshall one object into XMLRPC compliant structures ? I googled without any success, and what google does not find does not exist. Let say I have this very simple class:

Re: Dreaming of new generation IDE

2010-02-05 Thread Arnaud Delobelle
Robert Kern writes: > I prefer Guido's formulation (which, naturally, I can't find a direct > quote for right now): if you expect that a boolean argument is only > going to take *literal* True or False, then it should be split into > two functions. So rather than three boolean arguments, would y

Re: Your beloved python features

2010-02-05 Thread mk
Ethan Furman wrote: http://www1.american.edu/academic.depts/cas/econ/faculty/isaac/choose_python.pdf Choose to get your difficult questions about threads in Python ignored. Oh well.. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's Reference And Internal Model Of Computing Languages

2010-02-05 Thread Tad McClellan
["Followup-To:" header set to comp.lang.perl.misc.] Jürgen Exner wrote: > David Thole wrote in comp.lang.perl.misc: >>I read thisand am a tiny bit confused about the actual problem. >> >>It's not exactly complex to realize that something like: >>a = b = array >>that a and b both point to th

Re: xmlrcp - how to marshall objects

2010-02-05 Thread Jean-Michel Pichavant
mk wrote: Jean-Michel Pichavant wrote: Why not dump the whole thing and use Pyro, which works beautifully and handles all the serialization business by itself, you get a Python object on the other side? Unless xmlrpc has to be at the other end, that is. Company stuff. We are all using the

Re: Drawing a zig-zag Trail in Python?

2010-02-05 Thread Grant Edwards
On 2010-02-05, W. eWatson wrote: > I'd like to draw something like an animal track. Between each > point is a line. Perhaps the line would have an arrow showing > the direction of motion. There should be x-y coordinates > axises. PIL? MatPlotLib, ?? I'd probably use gnuplot-py, but I'm probably

Re: which

2010-02-05 Thread mk
mk wrote: > What I can say however: > > 1/ your interface is somehow broken. You ask actions through options (-c > -y -s), meaning one can possibly use all these 3 options together. Your > code won't handle it (you are using elif statements). What happens if I > use no option at all ?

Re: Your beloved python features

2010-02-05 Thread mk
Julian wrote: For those guys would be a poster quite cool which describes the most popular and beloved python features. Dictionaries. A workhorse of Python, by far the most useful data structure. -- http://mail.python.org/mailman/listinfo/python-list

Re: method to intercept string formatting % operations

2010-02-05 Thread Brad Allen
On Fri, Feb 5, 2010 at 9:49 AM, Jean-Michel Pichavant wrote: > Anyway why would you want to use the tuple form ? it's beaten in every > aspect by the dictionary form. I'm subclassing a namedtuple, and adding some additional functionality such as __getitem__, __setitem__, so that the namedtuple a

Re: Modules failing to add runtime library path info at link time

2010-02-05 Thread cjblaine
On Feb 1, 11:35 pm, cjblaine wrote: > On Feb 1, 11:04 pm, cjblaine wrote: > > > > > On Feb 1, 8:00 pm, Christian Heimes wrote: > > > > cjblaine wrote: > > > > Where/how can I configure the appropriate portion of our Python > > > > install to do 100% the right thing instead of just 50% (-L)? > >

Editor for Python

2010-02-05 Thread Laszlo Nagy
Hi All, I know that this question was put up on this list a thousand times. I know that most of the editors are listed here: http://wiki.python.org/moin/PythonEditors I already tried most of them. But still, I need something that is not listed there. Requirements: * starts and works

Re: xmlrcp - how to marshall objects

2010-02-05 Thread MRAB
Jean-Michel Pichavant wrote: Jean-Michel Pichavant wrote: Deos anyone knows where to find an code sample describing how to implement the interface to marshall one object into XMLRPC compliant structures ? I googled without any success, and what google does not find does not exist. Let say

Re: which

2010-02-05 Thread John Posner
On 2/5/2010 11:53 AM, Gerald Britton wrote: Also, I'm contractually obligated to admonish you not to "top post". Contract? Joke. (I know it's hard to tell.) At any rate, I proposed the 3-line format specifically because it separates the data values from the if-then-else machinery, mak

Re: Editor for Python

2010-02-05 Thread Gerald Britton
2010/2/5 Laszlo Nagy : > >   Hi All, > > I know that this question was put up on this list a thousand times. I know > that most of the editors are listed here: > http://wiki.python.org/moin/PythonEditors > > I already tried most of them. But still, I need something that is not listed > there. Requi

Exception class documentation

2010-02-05 Thread Charles Yeomans
I am so far unable to find the information I want about the Exception class. Information like the signature of __init__ seems to be unavailable. Any suggestions where I might find such information? Charles Yeomans -- http://mail.python.org/mailman/listinfo/python-list

Re: How Uninstall MatPlotLib?

2010-02-05 Thread W. eWatson
On 2/5/2010 8:17 AM, W. eWatson wrote: See Subject. I'm working in IDLE in Win7. It seems to me it gets stuck in site-packages under C:\Python25. Maybe this is as simple as deleting the entry? Well, yes there's a MPL folder under site-packages and an info MPL file of 540 bytes. There are a

Re: Exception class documentation

2010-02-05 Thread Gerald Britton
On Fri, Feb 5, 2010 at 12:55 PM, Charles Yeomans wrote: > I am so far unable to find the information I want about the Exception class. >  Information like the signature of __init__ seems to be unavailable.  Any > suggestions where I might find such information? > > > Charles Yeomans > -- > http://

method names nounVerb or verbNoun

2010-02-05 Thread Wanderer
Which is the more accepted way to compose method names nounVerb or verbNoun? For example voltageGet or getVoltage? getVoltage sounds more normal, but voltageGet is more like voltage.Get. I seem to mix them and I should probably pick one way and stick with it. Thanks -- http://mail.python.org/mai

Re: Dreaming of new generation IDE

2010-02-05 Thread Steve Holden
Arnaud Delobelle wrote: > Robert Kern writes: > >> I prefer Guido's formulation (which, naturally, I can't find a direct >> quote for right now): if you expect that a boolean argument is only >> going to take *literal* True or False, then it should be split into >> two functions. > > So rather t

Re: method names nounVerb or verbNoun

2010-02-05 Thread Gerald Britton
On Fri, Feb 5, 2010 at 2:53 PM, Wanderer wrote: > Which is the more accepted way to compose method names nounVerb or > verbNoun? > > For example voltageGet or getVoltage? getVoltage sounds more normal, > but voltageGet is more like voltage.Get. I seem to mix them and I > should probably pick one w

Re: How to guard against bugs like this one?

2010-02-05 Thread John Nagle
kj wrote: ... Through a *lot* of trial an error I finally discovered that the root cause of the problem was the fact that, in the same directory as buggy.py, there is *another* innocuous little script, totally unrelated, whose name happens to be numbers.py. The right answer to this is to m

Last M digits of expression A^N

2010-02-05 Thread mukesh tiwari
Hello everyone. I am kind of new to python so pardon me if i sound stupid. I have to find out the last M digits of expression.One thing i can do is (A**N)%M but my A and N are too large (10^100) and M is less than 10^5. The other approach was repeated squaring and taking mod of expression. Is t

Re: xmlrcp - how to marshall objects

2010-02-05 Thread Adam Tauno Williams
On Fri, 2010-02-05 at 18:24 +0100, Jean-Michel Pichavant wrote: > Jean-Michel Pichavant wrote: > > Deos anyone knows where to find an code sample describing how to > > implement the interface to marshall one object into XMLRPC compliant > > structures ? > > I googled without any success, and what

Re: How to guard against bugs like this one?

2010-02-05 Thread Stephen Hansen
On Fri, Feb 5, 2010 at 12:16 PM, John Nagle wrote: > kj wrote: > >> Through a *lot* of trial an error I finally discovered that the >> root cause of the problem was the fact that, in the same directory >> as buggy.py, there is *another* innocuous little script, totally >> unrelated, whose name ha

Re: Last M digits of expression A^N

2010-02-05 Thread Mark Dickinson
On Feb 5, 8:14 pm, mukesh tiwari wrote: > Hello everyone. I am kind of new to python so pardon me if i sound > stupid. > I have to find out the last M digits of expression.One thing i can do > is (A**N)%M but my  A and N are too large (10^100) and M is less than > 10^5. The other approach   was  r

Re: Last M digits of expression A^N

2010-02-05 Thread Gerald Britton
On Fri, Feb 5, 2010 at 3:14 PM, mukesh tiwari wrote: > Hello everyone. I am kind of new to python so pardon me if i sound > stupid. > I have to find out the last M digits of expression.One thing i can do > is (A**N)%M but my  A and N are too large (10^100) and M is less than > 10^5. The other appr

Re: method names nounVerb or verbNoun

2010-02-05 Thread Chris Rebert
On Fri, Feb 5, 2010 at 11:53 AM, Wanderer wrote: > Which is the more accepted way to compose method names nounVerb or > verbNoun? > > For example voltageGet or getVoltage? getVoltage sounds more normal, > but voltageGet is more like voltage.Get. I seem to mix them and I > should probably pick one

Re: method names nounVerb or verbNoun

2010-02-05 Thread MRAB
Wanderer wrote: Which is the more accepted way to compose method names nounVerb or verbNoun? For example voltageGet or getVoltage? getVoltage sounds more normal, but voltageGet is more like voltage.Get. I seem to mix them and I should probably pick one way and stick with it. I would use the 'n

Re: Last M digits of expression A^N

2010-02-05 Thread Mensanator
On Feb 5, 2:18 pm, Mark Dickinson wrote: > On Feb 5, 8:14 pm, mukesh tiwari wrote: > > > Hello everyone. I am kind of new to python so pardon me if i sound > > stupid. > > I have to find out the last M digits of expression.One thing i can do > > is (A**N)%M but my  A and N are too large (10^100)

  1   2   >