Re: Calendar GUI

2010-02-05 Thread Michael Torrie
Gabriel wrote: > On Fri, Feb 5, 2010 at 9:08 PM, William Gaggioli wrote: >> I'm working on setting up some software for a Peruvian non-profit to help >> them organize their incoming volunteers. One of the features I'd like to add >> is a calendar-like view of the different volunteers arrival dates

Re: Simple question about Queue.Queue and threads

2010-02-05 Thread Frank Millman
On Feb 6, 7:59 am, "Gabriel Genellina" wrote: En Fri, 05 Feb 2010 09:45:30 -0300, Frank Millman escribió: [...] > However, the queue is not empty - it still has the final None in it. Yes - but who cares? :) That was my point. I didn't think I needed to care, but I wanted to be sure I w

Re: Simple question about Queue.Queue and threads

2010-02-05 Thread Gabriel Genellina
En Fri, 05 Feb 2010 09:45:30 -0300, Frank Millman escribió: 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 fi

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

2010-02-05 Thread Gabriel Genellina
En Fri, 05 Feb 2010 10:23:57 -0300, Anthra Norell escribió: I upgraded from 2.4 to 2.5 and am unable to start an 2.5 idle window. The OS is Windows ME. The download of 2.5 finished with a warning saying that 2.5 was the highest version for Windows 9* Any tips? I'd suggest a couple more

Re: Dreaming of new generation IDE

2010-02-05 Thread Gabriel Genellina
En Fri, 05 Feb 2010 19:22:39 -0300, bartc escribió: "Steve Holden" wrote in message news:mailman.1998.1265399766.28905.python-l...@python.org... 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 e

Re: Import question

2010-02-05 Thread Gabriel Genellina
En Fri, 05 Feb 2010 13:21:47 -0300, Andrew Degtiariov escribió: 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. Entirely by luck, I'd say :) ├───project.api.config │ ├───proje

Re: merge stdin, stdout?

2010-02-05 Thread Gabriel Genellina
En Fri, 05 Feb 2010 17:39:07 -0300, jonny lowe escribió: On Feb 4, 8:20 pm, exar...@twistedmatrix.com wrote: On 01:56 am, jonny.lowe.12...@gmail.com wrote: >What I want is to have an easy way to merge input.txt and thestdout >so that output.txt look like: >Enter a number: 42 >You entered 42

WCK and PIL

2010-02-05 Thread darnzen
I've written an app using the wck library (widget construction kit, see http://www.effbot.org), in addition to the wckGraph module. What I'd like to do, is take the output of one of my windows (happens to be a graph), and save it as a *.png or *.gif. I was planning on using the PIL for this. I'd li

Re: [PyOpenGL-Users] Mouse wheel events?

2010-02-05 Thread Gary Herron
Craig Berry wrote: Is there any way to get mouse wheel events from glut in PyOpenGL? Use Linux. (On Linux, Glut returns mouse wheel events as buttons 4 and 5), or use FreeGlut. On both Windows and Linux freeglut returns mouse wheel events as buttons 4 and 5. Gary Herron -- http://mai

Re: Google AI Challenge at U of Waterloo

2010-02-05 Thread Man-wai Chang to The Door (24000bps)
On 06-Feb-10 08:02, Forthminder wrote: Contest runs from 4 February to 26 February 2010. http://csclub.uwaterloo.ca/contest/problem_description.php Bonne Chance! It's definitely *not* exactly a programming challenge, but algorithm challenge. A programming (only) challenge should only require

"Nim" game being created, no GUI used... Need tips...

2010-02-05 Thread Jordan Uchima
I am creating a game called Nim, but cannot get a loop going no matter what I do. What i am trying to do is get it to only accept input from 1 to 4, and keep asking for input from the same player if he/she enters in an invalid number. I also want it to stop when there is 1 or no piece(s) left, and

Re: Drawing a zig-zag Trail in Python?

2010-02-05 Thread W. eWatson
On 2/5/2010 9:30 AM, Grant Edwards wrote: 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 prob

Re: how to make a SimpleXMLRPCServer abort at CTRL-C under windows

2010-02-05 Thread Gabriel Genellina
En Fri, 05 Feb 2010 20:03:51 -0300, News123 escribió: I'm using an XMLRPC server under Windows. What I wonder is how I could create a server, that can be killed with CTRL-C The server aborts easily with CTRL-BREAK but not with CTRL-C (under Windows) If I press CTRL-C it will only abort

can pydoc display doc for local funcs? or other doc tools for own code

2010-02-05 Thread News123
Hi, often I start "pydoc -g" in a projects working directory in order to view the docstrings of my own project and in order to get a quick overview of the code structure In some cases I would like to see also to see private methods (especially when trying to understand the internals of a collegu

Re: Exception class documentation

2010-02-05 Thread Charles Yeomans
On Feb 5, 2010, at 2:13 PM, Gerald Britton wrote: 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 s

Re: Google AI Challenge at U of Waterloo

2010-02-05 Thread **Group User**
On Feb 6, 7:02 am, Forthminder wrote: > Contest runs from 4 February to 26 February 2010. > > You may choose a programming language, such as > Java, C++, Python, Ruby or Haskell. > > See details at > > http://csclub.uwaterloo.ca/contest/problem_description.php > > Bonne Chance! > > Mentifex > --ht

Re: Calendar GUI

2010-02-05 Thread Gabriel
On Fri, Feb 5, 2010 at 9:08 PM, William Gaggioli wrote: > Hello Everyone, > > I'm working on setting up some software for a Peruvian non-profit to help > them organize their incoming volunteers. One of the features I'd like to add > is a calendar-like view of the different volunteers arrival dates

Calendar GUI

2010-02-05 Thread William Gaggioli
Hello Everyone, I'm working on setting up some software for a Peruvian non-profit to help them organize their incoming volunteers. One of the features I'd like to add is a calendar-like view of the different volunteers arrival dates and staying time, with potentially some other info through some d

Re: Your beloved python features

2010-02-05 Thread Tim Chase
Steven D'Aprano wrote: Trailing spaces and tabs, on the other hand, *are* invisible. But they're also insignificant, and so don't matter. (Except for one little tiny corner case, which I shall leave as an exercise for the advanced reader.) Drat, now I'm gonna be up at odd hours tonight dredg

Re: list.extend([]) Question

2010-02-05 Thread Jack Diederich
On Fri, Feb 5, 2010 at 11:31 AM, Gerald Britton wrote: > 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. > That sums it up. In Python th

Re: method names nounVerb or verbNoun

2010-02-05 Thread Chris Rebert
On Fri, Feb 5, 2010 at 2:45 PM, Steven D'Aprano wrote: > On Fri, 05 Feb 2010 12:26:38 -0800, Chris Rebert wrote: >> 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

Re: Dreaming of new generation IDE

2010-02-05 Thread Steven D'Aprano
On Fri, 05 Feb 2010 22:22:39 +, bartc wrote: > "Steve Holden" wrote in message > news:mailman.1998.1265399766.28905.python-l...@python.org... >> Arnaud Delobelle wrote: >>> Robert Kern writes: >>> I prefer Guido's formulation (which, naturally, I can't find a direct quote for right

Re: execute sqlite3 dot commands in python

2010-02-05 Thread Steve Holden
gintare statkute wrote: > Does anybody know if it possible to execute sqlite3 dot commands in python? > > dovanotas:/pages/links# python > Python 2.5.2 (r252:60911, Jan 4 2009, 17:40:26) > [GCC 4.3.2] on linux2 > Type "help", "copyright", "credits" or "license" for more information. import s

Re: Dreaming of new generation IDE

2010-02-05 Thread Steve Holden
bartc wrote: > > "Steve Holden" wrote in message > news:mailman.1998.1265399766.28905.python-l...@python.org... >> 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 boolea

Re: SQLite3: preventing new file creation

2010-02-05 Thread Aahz
In article <6cf467a9-99d7-4fda-99da-075b4b38e...@k6g2000prg.googlegroups.com>, Gnarlodious wrote: > >Every time I say something like: > >connection=sqlite3.connect(file) > >sqlite creates a new database file. Can this behavior be suppressed >through SQLite? Or am I forced to check for the file ex

how to make a SimpleXMLRPCServer abort at CTRL-C under windows

2010-02-05 Thread News123
Hi, I'm using an XMLRPC server under Windows. What I wonder is how I could create a server, that can be killed with CTRL-C The server aborts easily with CTRL-BREAK but not with CTRL-C (under Windows) If I press CTRL-C it will only abort when the next RPC call occurs. It seems it is blocking i

Re: Your beloved python features

2010-02-05 Thread Steven D'Aprano
On Fri, 05 Feb 2010 15:22:25 -0600, Bruce C. Baker wrote: > GvR got it right when he discarded the superfluous semicolons from the > ends of statements--and then he ADDS superfluous colons to the ends of > control statements? They're not superfluous, they have a real, practical use. > It will

Re: xmlrpc slow in windows 7 if hostnames are used

2010-02-05 Thread Steve Holden
News123 wrote: > Hi Gabriel, > > 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://localhost:80') >>> >>> I was able to perform about 1 rpc call per second >>>

Re: Your beloved python features

2010-02-05 Thread Steven D'Aprano
On Fri, 05 Feb 2010 18:29:07 +0100, mk wrote: > 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.. With an attitude like that, you're damn lucky i

Re: reconstruct the source of a lambda from its func_code, func_name, etc

2010-02-05 Thread Steven D'Aprano
On Fri, 05 Feb 2010 14:19:36 -0800, Phlip wrote: > Thy Pon: > > Has anyone figured out how to reflect a passed function, such as a > lambda, all the way back to its source? Use the dis module to disassemble the byte code to human readable form, then write some sort of decompiler to translate it

Re: method names nounVerb or verbNoun

2010-02-05 Thread Steven D'Aprano
On Fri, 05 Feb 2010 12:26:38 -0800, Chris Rebert wrote: > 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

Re: Dreaming of new generation IDE

2010-02-05 Thread Robert Kern
On 2010-02-05 16:22 PM, bartc wrote: "Steve Holden" wrote in message news:mailman.1998.1265399766.28905.python-l...@python.org... 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 boo

Re: Repost: Read a running process output

2010-02-05 Thread Nobody
On Fri, 05 Feb 2010 03:57:17 -0800, Ashok Prabhu wrote: > 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 subproc

execute sqlite3 dot commands in python

2010-02-05 Thread gintare statkute
Does anybody know if it possible to execute sqlite3 dot commands in python? dovanotas:/pages/links# python Python 2.5.2 (r252:60911, Jan 4 2009, 17:40:26) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sqlite3 >>> sqlite3 .help Traceback (

Re: method names nounVerb or verbNoun

2010-02-05 Thread Steven D'Aprano
On Fri, 05 Feb 2010 11:53:08 -0800, Wanderer wrote: > Which is the more accepted way to compose method names nounVerb or > verbNoun? > > For example voltageGet or getVoltage? getVoltage sounds more normal, +0.5 for getVoltage +1 get_voltage -1 for voltageGet or voltage_get > but > voltageGe

Re: xmlrpc slow in windows 7 if hostnames are used

2010-02-05 Thread News123
Hi JM, Jean-Michel Pichavant wrote: >> 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://localhost:80') I was able to perform about

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

2010-02-05 Thread Steven D'Aprano
On Fri, 05 Feb 2010 09:53:33 -0600, David Thole wrote: > 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 assum

Re: Dreaming of new generation IDE

2010-02-05 Thread bartc
"Steve Holden" wrote in message news:mailman.1998.1265399766.28905.python-l...@python.org... 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 *

Re: method names nounVerb or verbNoun

2010-02-05 Thread Wanderer
On Feb 5, 4:53 pm, Chris Rebert wrote: > On Fri, Feb 5, 2010 at 1:49 PM, Wanderer wrote: > > On Feb 5, 3:26 pm, Chris Rebert wrote: > >> 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 examp

Re: which

2010-02-05 Thread Steven D'Aprano
On Fri, 05 Feb 2010 15:21:05 +0100, 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) Whichever one you like. The differences are insi

Re: xmlrpc slow in windows 7 if hostnames are used

2010-02-05 Thread News123
Hi Gabriel, 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://localhost:80') >> >> I was able to perform about 1 rpc call per second >> >> After changing to >> srv

reconstruct the source of a lambda from its func_code, func_name, etc

2010-02-05 Thread Phlip
Thy Pon: Has anyone figured out how to reflect a passed function, such as a lambda, all the way back to its source? I am aware than func_code knows the file name and line number; I would rather not use them to read the file because the lambda might not start in the first column. I will go with th

Re: method to intercept string formatting % operations

2010-02-05 Thread Steven D'Aprano
On Fri, 05 Feb 2010 16:49:00 +0100, Jean-Michel Pichavant wrote: > Anyway why would you want to use the tuple form ? it's beaten in every > aspect by the dictionary form. Except convenience, efficiency and readability. "%s %s" % (1, 2) versus "%(a)s %(b)s" % {'a': 1, 'b': 2} I'm all in favou

Re: which

2010-02-05 Thread Steven D'Aprano
On Fri, 05 Feb 2010 16:52:19 +0100, mk wrote: > assert isinstance(cmd, basestring) or cmd is None, "cmd should be string > or None" Do not use assertions for input validation. That's not what they're for. assert is compiled away when you run your code with the -O switch, which means that the te

Re: YAML (was: Python and Ruby)

2010-02-05 Thread Steven D'Aprano
On Fri, 05 Feb 2010 09:22:03 -0500, Lou Pecora wrote: [...] >> > That's what I needed. 3 lines to write or read a inhomogeneous >> > collection of variables. >> >> Easy, but also quick and dirty -- good enough for small scripts, but >> not really good enough for production applications. [...] >

Re: Your beloved python features

2010-02-05 Thread CM
> GvR got it right when he discarded the superfluous semicolons from the ends > of statements--and then he ADDS superfluous colons to the ends of control > statements? It will probably be as much of a shock to you as it was to me > when I learned after studying parsing that colons, semicolons, "th

Re: method names nounVerb or verbNoun

2010-02-05 Thread Alf P. Steinbach
* Wanderer: On Feb 5, 3:26 pm, Chris Rebert wrote: 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

Re: method names nounVerb or verbNoun

2010-02-05 Thread Chris Rebert
On Fri, Feb 5, 2010 at 1:49 PM, Wanderer wrote: > On Feb 5, 3:26 pm, Chris Rebert wrote: >> 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

Re: method names nounVerb or verbNoun

2010-02-05 Thread Wanderer
On Feb 5, 3:26 pm, Chris Rebert wrote: > 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

Re: How to guard against bugs like this one?

2010-02-05 Thread Ethan Furman
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 happens to be numbers.py. The right ans

Re: Python and Ruby

2010-02-05 Thread Ethan Furman
Robert Kern wrote: On 2010-02-04 17:46 PM, Ethan Furman wrote: 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 anyon

Re: Editor for Python

2010-02-05 Thread Alan Harris-Reid
Hi Laszlo, I use Wing IDE (not free, $35 for personal edition) and PyScripter (free). I find both good, for different reasons. Regards, Alan Laszlo Nagy wrote: Hi All, I know that this question was put up on this

Re: Your beloved python features

2010-02-05 Thread Bruce C. Baker
"George Sakkis" wrote in message news:de06116c-e77c-47c4-982d-62b48bca5...@j31g2000yqa.googlegroups.com... I'll give the benefit of doubt and assume you're joking rather than trolling. George * Not trolling, my friend! GvR got it

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

2010-02-05 Thread Anthra Norell
Duncan Booth wrote: 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

Re: Python and Ruby

2010-02-05 Thread Robert Kern
On 2010-02-04 17:46 PM, Ethan Furman wrote: 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 al

Re: method to intercept string formatting % operations

2010-02-05 Thread Raymond Hettinger
On Feb 5, 6:57 am, 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 woul

Re: How to guard against bugs like this one?

2010-02-05 Thread MRAB
Stephen Hansen wrote: 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 *an

Re: merge stdin, stdout?

2010-02-05 Thread jonny lowe
On Feb 4, 8:20 pm, exar...@twistedmatrix.com wrote: > On 01:56 am, jonny.lowe.12...@gmail.com wrote: > > > > >Hi everyone, > > >Is there an easy way to mergestdinandstdout? For instance suppose I > >havescriptthat prompts for a number and prints the number. If you > >execute this with redirection f

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)

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: 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: 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: 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: 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: 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

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: 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

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: 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

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: 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://

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

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: 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

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: 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

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: 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)? > >

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: 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: 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: 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: 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: 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: 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: 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: 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:

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: 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

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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

  1   2   >