Re: Some questions about atexit

2012-09-13 Thread Roy Smith
In article , Terry Reedy wrote: > On 9/12/2012 8:58 PM, Roy Smith wrote: > > The atexit docs (http://docs.python.org/library/atexit.html) are very > > confusing. In one place they say, "The order in which the functions are > > called is not defined". In another place, "all functions registered

Re: Some questions about atexit

2012-09-12 Thread Terry Reedy
On 9/12/2012 8:58 PM, Roy Smith wrote: The atexit docs (http://docs.python.org/library/atexit.html) are very confusing. In one place they say, "The order in which the functions are called is not defined". In another place, "all functions registered are called in last in, first out order". Whic

Re: Some questions on pow and random

2011-03-27 Thread joy99
On Mar 27, 8:52 pm, Mark Dickinson wrote: > On Mar 27, 3:00 pm, joy99 wrote: > > > (i) Suppose we have 8 which is 2^3 i.e., 3 is the power of 2, which we > > are writing in Python as, > > variable1=2 > > variable2=3 > > result=pow(variable1,variable2) > > > In my first problem p(x) a list of floa

Re: Some questions on pow and random

2011-03-27 Thread Mark Dickinson
On Mar 27, 3:00 pm, joy99 wrote: > (i) Suppose we have 8 which is 2^3 i.e., 3 is the power of 2, which we > are writing in Python as, > variable1=2 > variable2=3 > result=pow(variable1,variable2) > > In my first problem p(x) a list of float/decimals and f(x) is another > such. > Here, > variable1=

Re: Some questions on pow and random

2011-03-27 Thread joy99
On Mar 27, 4:36 pm, Mark Dickinson wrote: > On Mar 27, 11:07 am, joy99 wrote: > > > (b) Suppose we have two distributions p(x1) and p(x2), of the Model M, > > the E of EM algorithm, without going into much technical details is, > > P0(x1,x2), P1(x1,x2) > > > Now I am taking random.random() t

Re: Some questions on pow and random

2011-03-27 Thread Mark Dickinson
On Mar 27, 11:07 am, joy99 wrote: > (b) Suppose we have two distributions p(x1) and p(x2), of the Model M, > the E of EM algorithm, without going into much technical details is, > P0(x1,x2), P1(x1,x2) > > Now I am taking random.random() to generate both x1 and x2 and trying > to multiply the

Re: Some questions on pow and random

2011-03-27 Thread Mark Dickinson
On Mar 27, 11:07 am, joy99 wrote: > (i) By standard definition of Likelihood Estimation, we get if x EURO X, > where X is a countable set of types, p is probability and f is > frequency. > L(f;p)=Ðp(x)f(x) > > My question is python provides two functions, > (a)     pow for power. > (b)     reduce(

Re: Some questions on pow and random

2011-03-27 Thread Jason Swails
2011/3/27 joy99 > Dear Group, > > I have two questions one related to pow() and other is related to > random. > My questions are as below: > > (i) By standard definition of Likelihood Estimation, we get if x EURO X, > where X is a countable set of types, p is probability and f is > frequency. > L

Re: Some questions about PyOpenGL and wxPython

2008-09-21 Thread Mike C. Fletcher
Clay Hobbs wrote: I am making a program with wxPython that renders objects in 3D using PyOpenGL, and I am having some problems. For one thing, I forgot how to make a double-buffered hardware surface. http://bazaar.launchpad.net/~mcfletch/openglcontext/trunk/annotate/1?file_id=wxcontext.py-20080

Re: some questions about ejabberd,spark and psi

2008-02-24 Thread Mr Shore
the url missed http://allforces.com/2005/05/06/ichat-to-msn-through-jabber/ On 2月25日, 上午12时01分, Mr Shore <[EMAIL PROTECTED]> wrote: > hi,every buddy > I've now installed a jabber server,right it's ejabberd mentioned above > and 2 jabber client,right again it's spark and psi > and I can connect to j

Re: Some questions about decode/encode

2008-01-28 Thread glacier
On Jan 28, 2:31 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jan 28, 2:53 pm, glacier <[EMAIL PROTECTED]> wrote: > > > > > Thanks,John. > > It's no doubt that you proved SAX didn't support GBK encoding. > > But can you give some suggestion on how to make SAX parse some GBK > > string? > > Yes, t

Re: Some questions about decode/encode

2008-01-27 Thread John Machin
On Jan 28, 2:53 pm, glacier <[EMAIL PROTECTED]> wrote: > > Thanks,John. > It's no doubt that you proved SAX didn't support GBK encoding. > But can you give some suggestion on how to make SAX parse some GBK > string? Yes, the same suggestion as was given to you by others very early in this thread,

Re: Some questions about decode/encode

2008-01-27 Thread glacier
On 1月28日, 上午5时50分, John Machin <[EMAIL PROTECTED]> wrote: > On Jan 28, 7:47 am, "Mark Tolonen" <[EMAIL PROTECTED]> > wrote: > > > > > > > >"John Machin" <[EMAIL PROTECTED]> wrote in message > > >news:[EMAIL PROTECTED] > > >On Jan 27, 9:17 pm, glacier <[EMAIL PROTECTED]> wrote: > > >> On 1月24日, 下午3时

Re: Some questions about decode/encode

2008-01-27 Thread John Machin
On Jan 28, 7:47 am, "Mark Tolonen" <[EMAIL PROTECTED]> wrote: > >"John Machin" <[EMAIL PROTECTED]> wrote in message > >news:[EMAIL PROTECTED] > >On Jan 27, 9:17 pm, glacier <[EMAIL PROTECTED]> wrote: > >> On 1月24日, 下午3时29分, "Gabriel Genellina" <[EMAIL PROTECTED]> > >> wrote: > > >*IF* the file is w

Re: Some questions about decode/encode

2008-01-27 Thread Mark Tolonen
>"John Machin" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] >On Jan 27, 9:17 pm, glacier <[EMAIL PROTECTED]> wrote: >> On 1月24日, 下午3时29分, "Gabriel Genellina" <[EMAIL PROTECTED]> >> wrote: > >*IF* the file is well-formed GBK, then the codec will not mess up when >decoding it to Un

Re: Some questions about decode/encode

2008-01-27 Thread Martin v. Löwis
>> Is there any way to solve this better? >> I mean if I shouldn't convert the GBK string to unicode string, what >> should I do to make SAX work? > > Decode it and then encode it to utf-8 before feeding it to the parser. The tricky part is that you also need to change the encoding declaration in

Re: Some questions about decode/encode

2008-01-27 Thread glacier
On 1月27日, 下午7时20分, John Machin <[EMAIL PROTECTED]> wrote: > On Jan 27, 9:17 pm, glacier <[EMAIL PROTECTED]> wrote: > > > > > > > On 1月24日, 下午3时29分, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > > > En Thu, 24 Jan 2008 04:52:22 -0200, glacier <[EMAIL PROTECTED]> escribió: > > > > > According to

Re: Some questions about decode/encode

2008-01-27 Thread glacier
On 1月27日, 下午7时04分, John Machin <[EMAIL PROTECTED]> wrote: > On Jan 27, 9:18 pm, glacier <[EMAIL PROTECTED]> wrote: > > > > > > > On 1月24日, 下午4时44分, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > > > On Wed, 23 Jan 2008 19:49:01 -0800, glacier wrote: > > > > My second question is: is there

Re: Some questions about decode/encode

2008-01-27 Thread John Machin
On Jan 27, 9:17 pm, glacier <[EMAIL PROTECTED]> wrote: > On 1月24日, 下午3时29分, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > > > > En Thu, 24 Jan 2008 04:52:22 -0200, glacier <[EMAIL PROTECTED]> escribió: > > > > According to your reply, what will happen if I try to decode a long > > > string sep

Re: Some questions about decode/encode

2008-01-27 Thread John Machin
On Jan 27, 9:18 pm, glacier <[EMAIL PROTECTED]> wrote: > On 1月24日, 下午4时44分, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > > On Wed, 23 Jan 2008 19:49:01 -0800, glacier wrote: > > > My second question is: is there any one who has tested very long mbcs > > > decode? I tried to decode a long

Re: Some questions about decode/encode

2008-01-27 Thread Marc 'BlackJack' Rintsch
On Sun, 27 Jan 2008 02:18:48 -0800, glacier wrote: > Yepp. I feed SAX with the unicode string since SAX didn't support my > encoding system(GBK). If the `decode()` method supports it, IMHO SAX should too. > Is there any way to solve this better? > I mean if I shouldn't convert the GBK string to

Re: Some questions about decode/encode

2008-01-27 Thread glacier
On 1月24日, 下午5时51分, John Machin <[EMAIL PROTECTED]> wrote: > On Jan 24, 2:49 pm, glacier <[EMAIL PROTECTED]> wrote: > > > I use chinese charactors as an example here. > > > >>>s1='你好吗' > > >>>repr(s1) > > > "'\\xc4\\xe3\\xba\\xc3\\xc2\\xf0'" > > > >>>b1=s1.decode('GBK') > > > My first question is :

Re: Some questions about decode/encode

2008-01-27 Thread glacier
On 1月24日, 下午4时44分, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 23 Jan 2008 19:49:01 -0800, glacier wrote: > > My second question is: is there any one who has tested very long mbcs > > decode? I tried to decode a long(20+MB) xml yesterday, which turns out > > to be very strange and

Re: Some questions about decode/encode

2008-01-27 Thread glacier
On 1月24日, 下午3时29分, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 24 Jan 2008 04:52:22 -0200, glacier <[EMAIL PROTECTED]> escribió: > > > According to your reply, what will happen if I try to decode a long > > string seperately. > > I mean: > > ## > > a

Re: Some questions about decode/encode

2008-01-24 Thread 7stud
On Jan 24, 1:44 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 23 Jan 2008 19:49:01 -0800, glacier wrote: > > My second question is: is there any one who has tested very long mbcs > > decode? I tried to decode a long(20+MB) xml yesterday, which turns out > > to be very strange an

Re: Some questions about decode/encode

2008-01-24 Thread John Machin
On Jan 24, 2:49 pm, glacier <[EMAIL PROTECTED]> wrote: > I use chinese charactors as an example here. > > >>>s1='你好吗' > >>>repr(s1) > > "'\\xc4\\xe3\\xba\\xc3\\xc2\\xf0'" > > >>>b1=s1.decode('GBK') > > My first question is : what strategy does 'decode' use to tell the way > to seperate the words. I

Re: Some questions about decode/encode

2008-01-24 Thread Marc 'BlackJack' Rintsch
On Wed, 23 Jan 2008 19:49:01 -0800, glacier wrote: > My second question is: is there any one who has tested very long mbcs > decode? I tried to decode a long(20+MB) xml yesterday, which turns out > to be very strange and cause SAX fail to parse the decoded string. That's because SAX wants bytes,

Re: Some questions about decode/encode

2008-01-23 Thread glacier
On 1月24日, 下午1时49分, [EMAIL PROTECTED] wrote: > On Jan 23, 8:49 pm, glacier <[EMAIL PROTECTED]> wrote: > > > I use chinese charactors as an example here. > > > >>>s1='你好吗' > > >>>repr(s1) > > > "'\\xc4\\xe3\\xba\\xc3\\xc2\\xf0'" > > > >>>b1=s1.decode('GBK') > > > My first question is : what strategy

Re: Some questions about decode/encode

2008-01-23 Thread Gabriel Genellina
En Thu, 24 Jan 2008 04:52:22 -0200, glacier <[EMAIL PROTECTED]> escribió: > According to your reply, what will happen if I try to decode a long > string seperately. > I mean: > ## > a='你好吗'*10 > s1 = u'' > cur = 0 > while cur < len(a): > d = min(len(a)-i

Re: Some questions about decode/encode

2008-01-23 Thread glacier
On 1月24日, 下午1时41分, Ben Finney <[EMAIL PROTECTED]> wrote: > Ben Finney <[EMAIL PROTECTED]> writes: > > glacier <[EMAIL PROTECTED]> writes: > > > > I use chinese charactors as an example here. > > > > >>>s1='你好吗' > > > >>>repr(s1) > > > "'\\xc4\\xe3\\xba\\xc3\\xc2\\xf0'" > > > >>>b1=s1.decode('GBK')

Re: Some questions about decode/encode

2008-01-23 Thread bbtestingbb
On Jan 23, 8:49 pm, glacier <[EMAIL PROTECTED]> wrote: > I use chinese charactors as an example here. > > >>>s1='你好吗' > >>>repr(s1) > > "'\\xc4\\xe3\\xba\\xc3\\xc2\\xf0'" > > >>>b1=s1.decode('GBK') > > My first question is : what strategy does 'decode' use to tell the way > to seperate the words.

Re: Some questions about decode/encode

2008-01-23 Thread Ben Finney
Ben Finney <[EMAIL PROTECTED]> writes: > glacier <[EMAIL PROTECTED]> writes: > > > I use chinese charactors as an example here. > > > > >>>s1='你好吗' > > >>>repr(s1) > > "'\\xc4\\xe3\\xba\\xc3\\xc2\\xf0'" > > >>>b1=s1.decode('GBK') > > > > My first question is : what strategy does 'decode' use to

Re: Some questions about decode/encode

2008-01-23 Thread Ben Finney
glacier <[EMAIL PROTECTED]> writes: > I use chinese charactors as an example here. > > >>>s1='你好吗' > >>>repr(s1) > "'\\xc4\\xe3\\xba\\xc3\\xc2\\xf0'" > >>>b1=s1.decode('GBK') > > My first question is : what strategy does 'decode' use to tell the way > to seperate the words. I mean since s1 is an

Re: some questions about Python and tkinter

2007-10-18 Thread fabdeb
On Oct 16, 9:17 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Tue, 16 Oct 2007 11:52:22 -0700, fabdeb wrote: > > the first: what is the differences between a function and a classe? > > A class bundles data and functions into one object. > > > In which case i should use a function ? >

Re: some questions about Python and tkinter

2007-10-16 Thread Marc 'BlackJack' Rintsch
On Tue, 16 Oct 2007 11:52:22 -0700, fabdeb wrote: > the first: what is the differences between a function and a classe? A class bundles data and functions into one object. > In which case i should use a function ? > In which case i should use a class ? If you have several functions that operate

Re: some questions about Python and tkinter

2007-10-16 Thread kyosohma
On Oct 16, 1:52 pm, fabdeb <[EMAIL PROTECTED]> wrote: > Hi every one, > I m a sysadmin who want to know how to use python. > I dont know anything about oriented object programation, i only know > bash and a little perl. > I have some simple questions about python. > > the first: what is the differe

Re: some questions about Python and tkinter

2007-10-16 Thread Bruno Desthuilliers
fabdeb a écrit : > Hi every one, > I m a sysadmin who want to know how to use python. > I dont know anything about oriented object programation, i only know > bash and a little perl. > I have some simple questions about python. > > the first: what is the differences between a function and a classe

Re: some questions on how to study the bittorent.

2006-07-08 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Moore Liu wrote: > Hi all, > > I am very interesting in the detailed implement of bittorrent and have > read some p2p protocol document, but I want to know more of the > technique implementation. It's time-consuming to reverse-engineering > the code to understand the desig

Re: Some questions

2005-08-20 Thread Jorgen Grahn
On Thu, 18 Aug 2005 08:53:56 GMT, Alessandro Bottoni <[EMAIL PROTECTED]> wrote: > Titi Anggono wrote: ... >> 2. I use gnuplot.py module for interfacing with >> gnuplot in linux. Can we make the plot result shown in >> web ? I tried using cgi, and it didn't work. > > The ability to display a image (

Re: Some questions

2005-08-19 Thread Magnus Lycka
Thomas Ganss wrote: > My blind guess would have been that Tkinter was *not* the GUI of choice > for *J*ython. With Jython you'd probably use Swing or SWT. It's certainly less coding to get something working in Jython/Swing than with Java/Swing, but I suspect that there is a cost in runtime perfor

Re: Some questions

2005-08-18 Thread Thomas Ganss
Cameron Laird schrieb: > In article <[EMAIL PROTECTED]>, > Alessandro Bottoni <[EMAIL PROTECTED]> wrote: > >>Titi Anggono wrote: >>>1. Can we use Tkinter for web application such as Java? ... > ... or, if you mean, "is Python an apt language for client-side > Web development in the way Java is, w

Re: Some questions

2005-08-18 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Alessandro Bottoni <[EMAIL PROTECTED]> wrote: >Titi Anggono wrote: >> 1. Can we use Tkinter for web application such as Java? > >What do you mean? If you want to build up a GUI (something like a HTML page) >for a web-based application, you can do it with TKinter. Yo

Re: Some questions

2005-08-18 Thread Alessandro Bottoni
Titi Anggono wrote: > 1. Can we use Tkinter for web application such as Java? What do you mean? If you want to build up a GUI (something like a HTML page) for a web-based application, you can do it with TKinter. Your TKinter app can connect to a web server (or any other kind of server) using the s

Re: Some questions...

2005-02-10 Thread bruno modulix
Mario Lacunza wrote: Hello, Im new in Python, please I need some information: - Somebody know if: is possible use Python within Net Framework in windows environment?? http://www.ironpython.com/ http://www.zope.org/Members/Brian/PythonNet/ - Where found info about reports in Python? exist some prog