Re: How about adding rational fraction to Python?

2008-02-26 Thread Jeff Schwab
Mark Dickinson wrote: > On Feb 26, 9:00 pm, Paul Rubin wrote: >> Certainly, I'd expect that if x and y are both integers and x is an >> exact multiple of y, then x/y will be computable and not overflow. >> But try computing 10**5000 / 10**4000 under future division (that

Re: network programming: how does s.accept() work?

2008-02-26 Thread Micah Cowan
Grant Edwards wrote: > On 2008-02-26, Micah Cowan <[EMAIL PROTECTED]> wrote: > >> 7stud, what you seem to be missing, and what I'm not sure if anyone has >> clarified for you (I have only skimmed the thread), is that in TCP, >> connections are uniquely identified by a /pair/ of sockets (where >> "

Re: network programming: how does s.accept() work?

2008-02-26 Thread Micah Cowan
Gabriel Genellina wrote: > En Tue, 26 Feb 2008 07:53:24 -0200, 7stud <[EMAIL PROTECTED]> > escribió: > >> --- >> When you surf the Web, say to http://www.google.com, your Web browser >> is a client. The program you contact at Google is a server. When a >> server is run, it sets up business at a ce

Re: How about adding rational fraction to Python?

2008-02-26 Thread Paul Rubin
Mark Dickinson <[EMAIL PROTECTED]> writes: > def mean(number_list): > return sum(number_list)/len(number_list) > > If you pass a list of floats, complex numbers, Fractions, or Decimal > instances to mean() then it'll work just fine. But if you pass > a list of ints or longs, it'll silently r

Re: Documentation - which format

2008-02-26 Thread Ben Finney
Jumping Arne <[EMAIL PROTECTED]> writes: > I'm considering using plain text file for documenting certain things > (nothing to do with Python) and I'm looking at different "formatting > systems" ... preferable with a python implementation to render the > text at least as HTML - preferable also othe

Unknown locale error for Malayalam language in Python

2008-02-26 Thread maxinbjohn
Dear friends, I am a Python programmer from Kerala, India. When I tried to run a simple python program which uses the Malayalam language (ml), import os import locale os.environ['LANG']='ml' print locale.getdefaultlocale() It throws the following error : Traceback (most recent call last): F

library

2008-02-26 Thread Raj kumar
hi, how to open python api documetation in linux machine? i think there should be a way to open installed library as a HTML pages. Thanks in advance. Did you know? You can CHAT without downloading messenger. Go to http://in.messenger.yahoo.com/webmessengerpromo.php/ -- http://mail.py

Re: How about adding rational fraction to Python?

2008-02-26 Thread Gabriel Genellina
En Wed, 27 Feb 2008 00:39:09 -0200, Mark Dickinson <[EMAIL PROTECTED]> escribió: > On Feb 26, 9:00 pm, Paul Rubin wrote: >> Certainly, I'd expect that if x and y are both integers and x is an >> exact multiple of y, then x/y will be computable and not overflow. >> But t

Re: How about adding rational fraction to Python?

2008-02-26 Thread Paul Rubin
Mark Dickinson <[EMAIL PROTECTED]> writes: > > So use:  return sum(number_list) / float(len(number_list)) > > That makes it somewhat more explicit what you want.  Otherwise > > But that fails for a list of Decimals... Again, that depends on what your application considers to be failure. Heck, int

Re: How about adding rational fraction to Python?

2008-02-26 Thread Mark Dickinson
On Feb 26, 11:55 pm, Paul Rubin wrote: > So use:  return sum(number_list) / float(len(number_list)) > That makes it somewhat more explicit what you want.  Otherwise But that fails for a list of Decimals... Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: How about adding rational fraction to Python?

2008-02-26 Thread Paul Rubin
"Gabriel Genellina" <[EMAIL PROTECTED]> writes: > They exist since this semantic change was introduced *seven* *years* > ago, in 2001, so it's not that suddenly the Python world is going to > be upside down... I can't believe how long this thread is by now... I don't think it's a sudden uproar a

Re: time.time() strangeness

2008-02-26 Thread Gabriel Genellina
En Tue, 26 Feb 2008 17:37:22 -0200, Nitro <[EMAIL PROTECTED]> escribió: > today I encountered a very odd situation. I am on Windows Vista and using > Python 2.5.2. Here's a code snippet to illustrate my problem: > > # uncomment the next line to trigger the problem > # myExtensionModule.CreateDirec

How, python with Tk extensions enabled to import Tkinter

2008-02-26 Thread Murat Gunduz
Dear list member, I am using a Linux machine (Fedora Core 7, 64 bit): Linux 2.6.21-1.3228.fc7 #1 SMP Tue Jun 12 14:56:37 EDT 2007 x86_64 I tried to compile a software (ncvtk) with the simple command below % python setup.py install ERROR: could not import Tkinter. You need python with Tk exten

Re: __getattribute__ meta class?

2008-02-26 Thread bambam
Thank you both. If I understand correctly, I have two new ways to creating my new classes: class _Communicate(commandset2.CommandSet_Communicate): __metaclass__ = My_meta or _Communicate = create_wrapper_class |('_Communicate',commandset2.CommandSet_Communicate) and also two new ways to ch

Re: Documentation - which format

2008-02-26 Thread Jumping Arne
On Wed, 27 Feb 2008 05:51:11 +0100, Ben Finney wrote (in article <[EMAIL PROTECTED]>): > Your needs are met amply with reStructuredText. It's still under > active development is http://docutils.sourceforge.net/ still the official site (I didn't find anything else) -- http://mail.python.org/mai

Re: Unknown locale error for Malayalam language in Python

2008-02-26 Thread Jeroen Ruigrok van der Werven
-On [20080227 06:03], maxinbjohn ([EMAIL PROTECTED]) wrote: >ValueError: unknown locale: ml This is highly dependent on the operating system you are on. Last I remember Debian, for example, required a locale package. FreeBSD already has all locales installed, your mileage may vary. Try ls /usr/sh

How to pass shell variable to shell script from python

2008-02-26 Thread Rockins Chen
Hi all, I encountered a problem: I have a python script, let's just name it caller.py, It calls a shell script, which is named callee.sh. In callee.sh, it need a shell variable $target, which should be supplied by caller.py(cannot pass by argument). I try to use os.environ to do this, as follows:

Re: bribery tax-deductible in Netherlands?

2008-02-26 Thread castironpi
> > Netherlands - 2006 Investment Climate Statement - The Netherlands > >         This has NOTHING to do with comp.lang.python, and posts such as this > are the signs of spammers and trolls, and will rapidly lead to one being > kill-filed. Biography Van Rossum was born and grew up in the Netherlan

Re: Unknown locale error for Malayalam language in Python

2008-02-26 Thread Terry Reedy
"maxinbjohn" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Dear friends, | | I am a Python programmer from Kerala, India. When I tried to run a | simple python program which uses the Malayalam language (ml), | | import os | import locale | os.environ['LANG']='ml' | print locale.ge

Hyphenation module PyHyphen-0.4 released - good news for Windows users

2008-02-26 Thread Dr. leo
Thank you very much for your interest, helpful comments and suggestions. Two of you have even sent me .pyd files one of which (arguably compiled with MSVC 2003) is contained in version 0.4 for manual installation. This has spared me the hazzle to install cygwin etc. I have made the following chang

Re: Documentation - which format

2008-02-26 Thread Ben Finney
Jumping Arne <[EMAIL PROTECTED]> writes: > On Wed, 27 Feb 2008 05:51:11 +0100, Ben Finney wrote > (in article <[EMAIL PROTECTED]>): > > > Your needs are met amply with reStructuredText. It's still under > > active development > > is http://docutils.sourceforge.net/ still the official site (I > d

Re: is there enough information?

2008-02-26 Thread Gabriel Genellina
En Wed, 27 Feb 2008 00:50:19 -0200, <[EMAIL PROTECTED]> escribió: > On Feb 26, 8:31 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> En Tue, 26 Feb 2008 15:49:00 -0200, <[EMAIL PROTECTED]> escribió: >> >> > I'm not quite sure a semaphore is exactly the synchronization object >> > I'm lookin

Re: How to pass shell variable to shell script from python

2008-02-26 Thread Rockins Chen
Clearly, I made some typing mistake, it's the shbang line! it should be: #!/usr/bin/python then, just set os.environ is okay: os.environ["target"] = "localhost.localdomain.org" according python's documentation, setting os.environ will implicitly call os.putenv(). 2008/2/27, Rockins Chen <[EMAIL

Re: is there enough information?

2008-02-26 Thread Paul McGuire
On Feb 26, 8:50 pm, [EMAIL PROTECTED] wrote: > > Doesn't Queue.Queue operate by side effect? Are you sure you aren't a Turing testbot? What does that question even *mean*? Wait! Don't bother answering, I'm already bored with this thread. I agree with Gabriel. Instead of randomly sprinkling lock

<    1   2   3