Re: Getting a list of all modules

2014-07-30 Thread Leo Jay
understanding of cross- > platform issues, fails to include built-in modules that don't live in the > file system, and probably more). > > Is this problem already solved? Can anyone make any suggestions? > > > > -- > Steven > -- > https://mail.python.org/mailman/listinfo/python-list -- Best Regards, Leo Jay -- https://mail.python.org/mailman/listinfo/python-list

Re: Distributing python applications as a zip file

2014-07-23 Thread Leo Jay
as a single file that users can just copy and run. > But if you use windows and you happen to use multiprocessing, please be aware of this bug I encountered several years ago. https://mail.python.org/pipermail/python-dev/2011-December/115071.html -- Best Regards, Leo Jay -- https://mail.python.org/mailman/listinfo/python-list

Cannot use multiprocessing and zip together on windows

2011-12-11 Thread Leo Jay
ta) File "C:\python27\lib\multiprocessing\forking.py", line 454, in prepare assert main_name not in sys.modules, main_name AssertionError: __main__ It seems that the situation described here is similar: http://bugs.python.org/issue10128 But the patch doesn't work for me.

Re: Convert '165.0' to int

2011-07-21 Thread Leo Jay
s of them!) ? I > know I can write a function to do this, but is there anything built-in? > > Thanks > > Frank Millman > How about int(x[:-2])? -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

How do you find out what's happening in a process?

2010-11-28 Thread Leo Jay
Hi all, I'd like to know how do you guys find out what's happening in your code if the process seems not work. In java, I will use jstack to check stacks of threads and lock status. But I don't know how to do it in python. -- Best Regards, Leo Jay -- http://mail.python.org/m

Why the inconsistent of those two base64 methods?

2010-05-11 Thread Leo Jay
ult of 'aaa'.encode('base64') has a '\n' at the end, but the other method doesn't. Why the inconsistent? Thanks. -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows installer of Python

2010-04-14 Thread Leo Jay
gt; dont know how to catch them. >> > The files and subfolders of Python are all installed into a single > folder, for example C:\Python26, and none into the system folder or > other places, if you are worried about that. > I don't think so. At least, the pythonXX.d

Re: Why %e not in time.strftime directives?

2008-12-13 Thread Leo Jay
on, and platform variations are common. > > So if your underlying C implementation of strftime() supports "%e", then > Python will. My guess is that the same applies to time.strftime as it does > to datetime.strftime > > The docs list ones that are fairly cross-platform. However, it would seem > that not all platforms support "%e" > > > -tkc > > > [1] > http://docs.python.org/library/datetime.html#module-datetime > > -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Why %e not in time.strftime directives?

2008-12-13 Thread Leo jay
Any special reasons? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Equivalent of 'wget' for python?

2008-12-11 Thread Leo Jay
indows. I'm hoping the core python library has > a library for this. Note that I'll be using Python 3.0. > You can get Wget for Windows here: http://gnuwin32.sourceforge.net/packages/wget.htm -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Why optimization mode is slower than normal mode?

2008-12-11 Thread Leo Jay
1) time for 50 passes = 6.00515 This machine benchmarks at 83261.8 pystones/second I tried many times, and get the same result. Why optimization mode is slower than normal mode? -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: Equivalents of Ruby's "!" methods?

2008-08-25 Thread Leo Jay
this is not an accepted > and pythonic way of doing things then please let me know... and I'll > stop! > how about this one: >>> h = { "1" : "a\r", "2" : "b\n" } >>> dict((k, h[k].strip()) for k in h) {'1': 'a', '2': 'b'} >>> -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: Generate alphabet?

2008-08-23 Thread Leo Jay
gt; ','.join(string.ascii_lowercase) 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z' >>> -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: How to read and write the same socket in different threads?

2008-08-22 Thread Leo Jay
On Sat, Aug 23, 2008 at 1:58 AM, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Sat, 23 Aug 2008 01:47:23 +0800, Leo Jay <[EMAIL PROTECTED]> wrote: >> >> I'd like to read and write the same socket in different threads. >> one thread is only used to read

How to read and write the same socket in different threads?

2008-08-22 Thread Leo Jay
te port, the program works. But if the first element of the tuple is 's', the program doesn't work. Is it possible to read and write the same socket in different threads? Thanks in advance. -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: How to stop iteration with __iter__() ?

2008-08-19 Thread Leo Jay
ntation it should. But catching an exception > can't be the standard way to stop iterating right? > you can use for loop: for line in movie_iter: ... -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: Does '!=' equivelent to 'is not'

2008-06-16 Thread Leo Jay
r of python: >>> a = 10 >>> b = 10 >>> a is b False >>> a == b True >>> a = 5 >>> b = 5 >>> a is b True >>> a == b True >>> which is caused by small object cache mechanism. -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

why can i still able to reproduce the SimpleHTTPServer bug which is said fixed 3 years ago?

2008-06-13 Thread Leo Jay
r("Content-Length", str(fs[6]))# <-- obviously, this is not the same with len(f.read()) in windows. -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: C++ equivalent of comp.lang.python?

2008-01-06 Thread Leo Jay
y one manually. > > For those of you who work in C++, where do you go to discuss it > online? I'm interested in any newsgroups, mailing lists, or web > boards you can recommend. > -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: anyone has experience on cross-compile python 2.5.1?

2007-05-04 Thread Leo Jay
On 4/30/07, Leo Jay <[EMAIL PROTECTED]> wrote: > i have a development board based on s3c2410 arm cpu. and i want to > port python on it. > after googling some threads, i successfully cross compiled python. > but i still encountered a weird issue that when i ran > /lib/pyth

default config has no md5 module?

2007-05-04 Thread Leo Jay
i want to compile a python by myself, but after configure and make, it seems that md5 is not built by default. what should i do to compile md5 as an module? -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

anyone has experience on cross-compile python 2.5.1?

2007-04-30 Thread Leo Jay
push("world\n") asyncore.loop() s.join() but the weirdest thing is, if i run python test_asynchat.py directly, everything is ok. anybody could help me? thanks in advance. ps, my linux box is an ubuntu 6.10. -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I write code using FP

2007-01-16 Thread Leo Jay
rint foo1(3) print foo2(3) -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

how to use xmlrpc properly in windows xp

2007-01-16 Thread Leo Jay
"; % ('192.168.0.92', 31281)) start = datetime.now() print server.test() print server.test() print server.test() print server.test() print 'total: ', datetime.now() - start -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

how to use python com server in c++?

2006-08-19 Thread Leo Jay
ing this com server in viusal c++? a detailed sample of early binding would be better, thanks. -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

is there any lib can split string in this way?

2006-01-08 Thread Leo Jay
I want to split a string like this: 'abc def "this is a test" ok' into: ['abc', 'def', 'this is a test', 'ok'] is there any lib meet my need? thanks -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: about install wxPython in Redhat Linux AS 4

2005-09-28 Thread Leo Jay
wxwindow correctly, i encountered dozens of errors when installing wxpython. i'm just a rookie that i have no idea about how to handle these errors. -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

about install wxPython in Redhat Linux AS 4

2005-09-28 Thread Leo Jay
i do now? i tried to import wx in python, but python just returned an error: Traceback (most recent call last): File "", line 1, in ? ImportError: No module named wx Anyone can help me, please? Thanks -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing an HTML a tag

2005-09-24 Thread Leo Jay
> connect = urllib.urlopen(url) > data = connect.read() > connect.close() > return data > > -- > http://mail.python.org/mailman/listinfo/python-list > -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: How to decompile an exe file compiled by py2exe?

2005-09-24 Thread Leo Jay
et/crew/theller/moin.cgi/Py2Exe correctly). > Bytecode files extracted should be decompilable to something resembling > original python code by a python decompiler (quick Googling finds > "decompyle": http://www.crazy-compilers.com/). > -- > http://mail.python.org/mailman/listinfo/python-list > -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

How to decompile an exe file compiled by py2exe?

2005-09-23 Thread Leo Jay
Dear All, I lost my source code because of my incaution. so anyone can tell me how to decompile the exe file compiled by py2exe? Thanks. -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

how to get the return value of a thread?

2005-09-09 Thread Leo Jay
est Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question about lists

2005-07-20 Thread Leo Jay
IMO, python should use the decimal for default. .25 is right for Decimal(".25"). isn't that better? -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question about lists

2005-07-20 Thread Leo Jay
you may use the decimal module which was introduced in Python2.4 >>> from decimal import * >>> li = [Decimal(".25"), Decimal(".10"), Decimal(".05"), Decimal(".01")] >>> print li [Decimal("0.25"), Decimal("0.10"), Decimal("0.05"), Decimal("0.01")] >>> -- http://mail.python.org/mailman/listinfo/p

how to get rate of pop3 receiving progress?

2005-07-14 Thread Leo Jay
when i use POP3.retr() in poplib module, the retr() function will not return until the receiving progress is finished so, is there any way to get the rate of receiving progress? Thanks -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list