Re: Python dynamic attribute creation

2010-07-01 Thread WANG Cong
On 07/01/10 22:53, Stephen Hansen me+list/pyt...@ixokai.io wrote: One uses assignment syntax when the name of the attribute they are setting is known at the time when one writes the code. One uses the setattr function when the name of the attribute is not known until runtime. The

Re: Python dynamic attribute creation

2010-07-01 Thread WANG Cong
On 07/01/10 23:19, Stephen Hansen me+list/pyt...@ixokai.io wrote: As long as setattr() exists in Python, that will be not so ordinary. :) setattr is perfectly ordinary. If you think setattr() is as ordinary as a trivial assignment, I will argue with you, this is personal taste. However, I

Re: Python dynamic attribute creation

2010-06-29 Thread WANG Cong
On 06/29/10 17:48, Andre Alexander Bell p...@andre-bell.de wrote: On 06/25/2010 03:15 PM, WANG Cong wrote: 1) Modifying a class attribute is metaprogramming, and this is modifying a class, i.e. adding a new attribute to it, thus this should belong to metaprogramming. (I know, strictly

Re: Python dynamic attribute creation

2010-06-29 Thread WANG Cong
On 06/27/10 12:01, Carl Banks pavlovevide...@gmail.com wrote: On Jun 25, 8:24 pm, WANG Cong xiyou.wangc...@gmail.com wrote: Understand, but please consider my proposal again, if we switched to: setattr(foo, 'new_attr', blah) by default, isn't Python still dynamic as it is? (Please teach me

Python dynamic attribute creation

2010-06-25 Thread WANG Cong
Hi, list! I have a doubt about the design of dynamic attribute creation by assignments in Python. As we know, in Python, we are able to create a new attribute of a class dynamically by an assignment: class test: pass ... test.a = hello test.a 'hello' However, I still don't get the

Re: Python dynamic attribute creation

2010-06-25 Thread WANG Cong
On 06/25/10 17:25, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Fri, 25 Jun 2010 14:15:12 +0100, WANG Cong wrote: Hi, list! I have a doubt about the design of dynamic attribute creation by assignments in Python. As we know, in Python, we are able to create a new

Re: Python dynamic attribute creation

2010-06-25 Thread WANG Cong
On 06/25/10 15:34, Bruno Desthuilliers bruno.42.desthuilli...@websiteburo.invalid wrote: WANG Cong a écrit : Hi, list! I have a doubt about the design of dynamic attribute creation by assignments in Python. As we know, in Python, we are able to create a new attribute of a class

Re: Python dynamic attribute creation

2010-06-25 Thread WANG Cong
On 06/25/10 14:31, Richard Thomas chards...@gmail.com wrote: snip If you desperately want to limit the attribute assignments that can be performed on an object you can set the __slots__ attribute of its type. However, the Python ethos has always been to restrict as little as necessary to

Re: Python dynamic attribute creation

2010-06-25 Thread WANG Cong
On 06/26/10 03:31, Carl Banks pavlovevide...@gmail.com wrote: On Jun 25, 6:15 am, WANG Cong xiyou.wangc...@gmail.com wrote: Hi, list! I have a doubt about the design of dynamic attribute creation by assignments in Python. As we know, in Python, we are able to create a new attribute

Re: Python dynamic attribute creation

2010-06-25 Thread WANG Cong
On 06/26/10 00:11, Neil Hodgson nyamatongwe+thun...@gmail.com wrote: WANG Cong: 4) Also, this will _somewhat_ violate the OOP princples, in OOP, this is and should be implemented by inherence. Most object oriented programming languages starting with Smalltalk have allowed adding

Re: Python dynamic attribute creation

2010-06-25 Thread WANG Cong
On 06/25/10 19:38, Ethan Furman et...@stoneleaf.us wrote: WANG Cong wrote: On 06/25/10 15:34, Bruno Desthuilliers bruno.42.desthuilli...@websiteburo.invalid wrote: WANG Cong a écrit : Hi, list! I have a doubt about the design of dynamic attribute creation by assignments in Python

Re: Python dynamic attribute creation

2010-06-25 Thread WANG Cong
On 06/25/10 22:11, Mark Lawrence breamore...@yahoo.co.uk wrote: On 25/06/2010 19:23, WANG Cong wrote: On 06/25/10 14:31, Richard Thomaschards...@gmail.com wrote: snip If you desperately want to limit the attribute assignments that can be performed on an object you can set the __slots__

Re: Python dynamic attribute creation

2010-06-25 Thread WANG Cong
On 06/25/10 20:22, Ian Kelly ian.g.ke...@gmail.com wrote: On Fri, Jun 25, 2010 at 12:51 PM, Stephen Hansen me+list/pyt...@ixokai.io wrote: Using assignments to create an attribute hides metaprogramming behide, while using delattr() exposes it. I don't understand what you're saying here

Re: how to debug python application crashed occasionally

2010-04-25 Thread jacky wang
could anyone help me? On Apr 21, 2:55 pm, jacky wang bugking.w...@gmail.com wrote: Hello   recently, I met a problem with one python application running with python2.5 | debian/lenny adm64 system: it crashed occasionally in our production environment. The problem started to happen just

how to debug python application crashed occasionally

2010-04-21 Thread jacky wang
, and not all of them provides -dbg package in Debian/Lenny. So it still doesn't make any progress yet. I will be really appreciated if somebody can help me about how to debug the python crashes. Thanks in advance! BR Jacky Wang -- http://mail.python.org/mailman/listinfo/python-list

How to login https sever with inputing account name and password?

2010-03-04 Thread Karen Wang
) Below is my code: import urllib2 values = { 'user' : myusername, pass' : mypassword } data = urllib2.urlencode(values) t = urllib2.urlopen('https://212.218.229.10/chinatest/',data) print t.read() where I am wrong ? Thank you very much. Best Regards Karen Wang image001

[issue7852] [PATCH] Drop Computer from Apple Computer in plistlib

2010-02-05 Thread Wang Chun
Wang Chun yaohua2...@gmail.com added the comment: plutil is a command shipped with every Mac. See the example in my original post. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7852

[issue7852] [PATCH] Drop Computer from Apple Computer in plistlib

2010-02-04 Thread Wang Chun
New submission from Wang Chun yaohua2...@gmail.com: Apple's official utilities had been dropped the word Computer. We should follow them. imac:~$ cat test.py __import__('plistlib').writePlist({}, 'test.plist') imac:~$ python test.py imac:~$ cat test.py __import__('plistlib').writePlist

[issue7581] incomplete doc of zlib

2009-12-27 Thread WANG Lu
New submission from WANG Lu coolwan...@gmail.com: Python version: 2.6.4 r264:75706 (ubuntu 9.10) I'm working on zlib, and have been busy in finding a way of specify the window size of compression. After wasting minutes in python online doc, I google and find the way: zlib.compressobj(level

[issue7581] incomplete doc of zlib

2009-12-27 Thread WANG Lu
WANG Lu coolwan...@gmail.com added the comment: Oh I found this is mentioned in msg94409(http://bugs.python.org/issue7191#msg94409) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7581

How to keep permission bits when including package data in distutils

2009-10-30 Thread Olli Wang
Hi, I want to include some binary package data into my distribution and I define these binary in MANIFEST.in. However, all binary lose the `x` permissions so they can't be executed in my program. Is there any way to remedy this situation? Thanks. --

ANN: Jump 0.9.5.1 released!

2009-10-29 Thread Olli Wang
I am proud to announce that Jump 0.9.5.1 is released! You can find the Jump project at http://gitorious.org/jump, and its documentation at http://gitorious.org/jump/pages/Home. Jump is a build tool for distributing Jython applications in a really easy step. Features: * Distributing Jython

ANN: Jump 0.9.0 released!

2009-10-24 Thread Olli Wang
I am proud to announce that Jump 0.9.0 is released! You can find the Jump project at http://gitorious.org/jump, and its documentation at http://gitorious.org/jump/pages/Home. This version is the Jump's first release. The goal of Jump is to make a distribution for Jython application in a really

[issue7128] cPickle looking for non-existent package copyreg

2009-10-14 Thread Joseph C Wang
New submission from Joseph C Wang joequ...@gmail.com: When running cPickle in restricted mode, the module tries to import copyreg which does not appear to exist anywhere. The problem is in cPickle.c 2980 if (PyEval_GetRestricted()) { 2981 /* Restricted execution, get private

[issue5483] [PATCH]Add FastDbfilenameShelf: shelf nerver sync cache even when writeback=True

2009-09-16 Thread Zhigang Wang
Zhigang Wang w1z...@gmail.com added the comment: Thanks Robert for pointing out issue553171. After read that issue, I still think we paid too much to make shelf less surprising. We should at lease provide a option for the *smart* programmers to get better speed and less exceptions. The write

Re: Python for professsional Windows GUI apps?

2009-08-29 Thread Vivian Wang
On Aug 24, 8:08 pm, Gilles Ganault nos...@nospam.com wrote: Hello         I was wondering if some people in this ng use Python and some GUI toolkit (PyWin32, wxWidgets, QT, etc.) to build professional applications, and if yes, what it's like, the pros and cons, etc. I'm especially concerned

Re: IDE for python similar to visual basic

2009-08-29 Thread Vivian Wang
On Aug 29, 6:19 am, qwe rty hkh00...@gmail.com wrote: i have been searching for am IDE for python that is similar to Visual Basic but had no luck.shall you help me please? You can try biform: http://www.bilive.com/download/Setup_BiForm_V2.1_en.msi.zip Demo:

[issue6559] [PATCH]add pass_fds paramter to subprocess.Popen()

2009-07-24 Thread Zhigang Wang
New submission from Zhigang Wang w1z...@gmail.com: The current subprocess.Popen() has a boolean close_fds parameter, which cannot satisfy all the requirements. Eg. want to pass specific fd to child process, but close others. This patch adds a extra parameter pass_fds to subprocess.Popen's

[issue6237] Build errors when using LDFLAGS=-Wl,--no-undefined

2009-06-28 Thread Funda Wang
Funda Wang fundaw...@gmail.com added the comment: How is this issue going? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6237 ___ ___ Python

[issue6237] Build errors when using LDFLAGS=-Wl,--no-undefined

2009-06-12 Thread Funda Wang
Funda Wang fundaw...@gmail.com added the comment: Regarding python binary target, the actual command when linking is: gcc -pthread -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -lstdc++ - Xlinker -export-dynamic -o python \ Modules/python.o \ -LL. -lpython2.6 -lpthread -ldl -lutil -lm

[issue6237] Build errors when using LDFLAGS=-Wl,--no-undefined

2009-06-07 Thread Funda Wang
New submission from Funda Wang fundaw...@gmail.com: gcc -pthread -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -lstdc++ - Xlinker -export-dynamic -o python \ Modules/python.o \ -L. -lpython2.6 -lpthread -ldl -lutil

[issue6105] json.dumps doesn't respect OrderedDict's iteration order

2009-05-25 Thread Wang Chun
New submission from Wang Chun yaohua2...@gmail.com: PEP-0372 and Issue 5381 both say json.dumps respect OrderedDict's iteration order, but the example in them do not work on my latest trunk build. $ uname -a Linux 12.38 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64

Re: Python 2.6, File read() problems in Windows Xp

2009-05-08 Thread Li Wang
2009/5/8 Chris Rebert c...@rebertia.com: On Thu, May 7, 2009 at 10:04 PM, Li Wang li.wan...@gmail.com wrote: Hi all: the file, e.g. open(the_file.xls, rb) Unlike *nix, Windows differentiates between binary and text files, hence the need for the b flag to specify which you're dealing

Re: Python 2.6, File read() problems in Windows Xp

2009-05-08 Thread Li Wang
Hi: Problem solved Thank you very much, it works, It is my own problem:) All the best, Li 2009/5/8 Li Wang li.wan...@gmail.com: 2009/5/8 Chris Rebert c...@rebertia.com: On Thu, May 7, 2009 at 10:04 PM, Li Wang li.wan...@gmail.com wrote: Hi all: the file, e.g. open(the_file.xls, rb

Re: Python 2.6, File read() problems in Windows Xp

2009-05-08 Thread Li Wang
Hi Dave: Thank you very much for you explanation:) Chances are you forgot the b parameter to open(). Unnecessary in Unix, it tells the library to *not* translate \r\n to \n upon read, or the inverse on write. In other words, with the b parameter, the file is read in unchanged. So, if I

Re: Python 2.6, File read() problems in Windows Xp

2009-05-08 Thread Li Wang
2009/5/8 Scott David Daniels scott.dani...@acm.org: Li Wang wrote: So, if I am using python in Linux, do open('file', 'r') and open('file', 'rb') work the same way? You get identical results, but you ar lying to the reader of your code. you should include the 'b' if what you want is bytes

Re: Python 2.6, File read() problems in Windows Xp

2009-05-08 Thread Li Wang
2009/5/8 prueba...@latinmail.com: On May 8, 5:08 am, Li Wang li.wan...@gmail.com wrote: Hi Dave: Thank you very much for you explanation:) Chances are you forgot the b parameter to open(). Unnecessary in Unix, it tells the library to *not* translate \r\n to \n upon read

Re: Python 2.6, File read() problems in Windows Xp

2009-05-08 Thread Li Wang
(my smtp mail server has been down for a few hours, so you have some other responses.) yes, as far as I can tell from the docs, the 'b' flag doesn't matter in Unix/Linux. Note that I haven't actually been on a Unix machine since starting with Python, but it matches what else I know. And if

Re: What would YOU like to see in a txt to html converter?

2009-05-07 Thread Will Wang
Florian == Florian Wollenschein florian.wollensch...@fernuni-hagen.de writes: Florian As you might have mentioned I'm just working on a txt to html converter called Florian thc. This project is intended for me to learn Python and now pyQT4 to which I Florian changed a few days

Python 2.6, File read() problems in Windows Xp

2009-05-07 Thread Li Wang
Hi all: I am trying to read a non-text file as a string by using Python read(), however, it seems there is some thing wrong with it. I can use read() on text file correctly, but unable to read .xls file correctly. (The program can read any file correctly in Fedora 10) Any idea how to solve this

How to measure the memory cost in Python?

2009-05-01 Thread Li Wang
Hi everyone: I want to measure the actual memory cost of a particular step in my program (Python program), does anyone know if there is some function in Python could help me to do this job? Or should I seek other tools to help me? Thank you very much! -- Li -- Time is all we have and you

Measure the memory cost in Python

2009-04-30 Thread Li Wang
Hi everyone: I want to measure the actual memory cost of a particular step in my program (Python program), does anyone know if there is some function in Python could help me to do this job? Or should I seek other tools to help me? Thank you very much! -- Li -- Time is all we have and you

[issue5885] uuid.uuid1() is too slow

2009-04-30 Thread Wang Chun
New submission from Wang Chun yaohua2...@gmail.com: uuid.uuid1() currently uses two different ways to generate a uuid. If the system call uuid_generate_time is available, uuid1() uses the system call via the ctypes interface, otherwise, it uses pure Python code to generate a uuid. The problem

[issue5885] uuid.uuid1() is too slow

2009-04-30 Thread Wang Chun
Wang Chun yaohua2...@gmail.com added the comment: This is my test on another faster machine. $ cat test.py import sys, time, uuid N = int(sys.argv[1]) t = time.time() for x in xrange(N): uuid.uuid1() print('%.3f microseconds' % ((time.time() - t) * 100.0 / N)) $ cat test.c #include

Efficient bits manipulation in Python

2009-04-28 Thread Li Wang
Hi: I have a bit-code :'1011011', how can I reverse it to '1101101'? Another question is I know how to transform the string '110' into integer 6, does anyone know how to transform integer 6 to a string '110'? Thank you very much:) -- Li -- Time is all we have and you may find one day you

Re: Efficient bits manipulation in Python

2009-04-28 Thread Li Wang
I have a bit-code :'1011011', how can I reverse it to '1101101'? Another question is I know how to transform the string '110' into integer 6, does anyone know how to transform integer 6 to a string '110'? Thank you very much:) Assuming that you are using 2.6: a = 0b1011011 print

How to locate the bit in bits string?

2009-04-28 Thread Li Wang
Hi: If I use an integer to represent bits: e.g. 99 represents '1100011' How can I locate, say the second bit of 99(i.e. '1')? Although bin(99)[4] could be used to locate it, this transform cost too much memory (99 only needs 2Bytes, while string '1100011' needs 7Bytes). Anyone knows how to

Re: How to locate the bit in bits string?

2009-04-28 Thread Li Wang
2009/4/29 Tim Chase python.l...@tim.thechases.com: Li Wang wrote: Hi: If I use an integer to represent bits: e.g. 99 represents '1100011' How can I locate, say the second bit of 99(i.e. '1')? Although bin(99)[4] could be used to locate it, this transform cost too much memory (99 only

Re: How to locate the bit in bits string?

2009-04-28 Thread Li Wang
2009/4/29 Tim Chase python.l...@tim.thechases.com: I want to concatenate two bits string together: say we have '1001' and '111' which are represented in integer. I want to concatenate them to '100' (also in integer form), my method is: ('1001' 3) | 111 which is very time consuming. You

Re: How to locate the bit in bits string?

2009-04-28 Thread Li Wang
2009/4/29 Tim Chase python.l...@tim.thechases.com: You omit some key details -- namely how do you know that 1001 is 4 bits and not 1001 (8-bits)? If it's a string (as your current code shows), you can determine the length. However, if they are actually ints, your code should work fine

[issue5483] [PATCH]Add FastDbfilenameShelf: shelf nerver sync cache even when writeback=True

2009-03-13 Thread Zhigang Wang
New submission from Zhigang Wang w1z...@gmail.com: shelf without writeback=True is too slow, while shelves with writeback=True takes too much time to close. And even worse, these codes can not run: $ cat test_shelve.py #!/usr/bin/env python import shelve store = shelve.open(/tmp/shelve.db

[issue5483] [PATCH]Add FastDbfilenameShelf: shelf nerver sync cache even when writeback=True

2009-03-13 Thread Zhigang Wang
Zhigang Wang w1z...@gmail.com added the comment: Add some errata of the patch: add the new class to __all__. -- Added file: http://bugs.python.org/file13318/fast_shelf-v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue5289] ctypes.util.find_library does not work under Solaris

2009-02-18 Thread Ke Wang
Ke Wang ke.w...@sun.com added the comment: Above patch failed in a TabError. Attached a new one. Added file: http://bugs.python.org/file13133/util.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5289

[issue5289] ctypes.util.find_library does not work under Solaris

2009-02-17 Thread Ke Wang
New submission from Ke Wang ke.w...@sun.com: Under Solaris, find_library can not give the correct path. Solaris does not have /sbin/ldconfig, so _findLib_gcc is used. def _findLib_gcc(name): expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) fdout, ccout = tempfile.mkstemp

[issue5289] ctypes.util.find_library does not work under Solaris

2009-02-17 Thread Ke Wang
Ke Wang ke.w...@sun.com added the comment: I tested the command 'gcc -Wl,-t' on Ubuntu, it works fine. But on Solaris, it doesn't work as expected. Finally I find that gcc does not use GNU ld on Solaris, instead, it uses SUN ld. ___ Python tracker rep

Re: how to update python on gnu emacs?

2009-01-29 Thread Wang Lei
If you means python-mode, you can add this line to you .emacs: (setq py-python-command python3.0) On 1/29/09, John Seales praxbaf...@hotmail.com wrote: I've updated to python 2.6. My terminal application finds the new python just fine, but my gnu-emacs still is on python 2.3. Does anyone know

Re: how to update python on gnu emacs?

2009-01-29 Thread Wang Lei
Sorry. Mine is python3.0. Yours maybe is: (setq py-python-command python2.6) -- Regards Lei -- http://mail.python.org/mailman/listinfo/python-list

Re: self-aware list of objects able to sense constituent member alterations?

2009-01-28 Thread Peter Wang
On Jan 27, 3:16 pm, Reckoner recko...@gmail.com wrote: I'm not sure this is possible, but I would like to have a list of  objects A=[a,b,c,d,...,z] where,  in the midst of a lot of processing I might do something like, A[0].do_something_which_changes_the_properties() which alter the

[issue5090] import tkinter library Visual C++ Concepts:C Run-Time Error R6034 when embeded python in c++

2009-01-28 Thread wang
New submission from wang zev...@gmail.com: import tkinter library Visual C++ Concepts:C Run-Time Error R6034 when embeded python in c++ -- components: Tkinter messages: 80710 nosy: guxianminer severity: normal status: open title: import tkinter library Visual C++ Concepts:C Run-Time

[issue5090] import tkinter library Visual C++ Concepts:C Run-Time Error R6034 when embeded python in c++

2009-01-28 Thread wang
wang zev...@gmail.com added the comment: my compile is gcc 4.2.1 system is windows xp some other library can be import. such as:sys os c++ code line: Py_Initialize(); Py_SetProgramName(LMyProgram); module=PyImport_ImportModule(__main__); moduledict=PyModule_GetDict(dodule

[issue4944] os.fsync() doesn't work as expect in Windows

2009-01-22 Thread Javen Wang
Javen Wang jave...@gmail.com added the comment: I don't have Python2.6 installed. I just have ever read a bench article comparing the performance between different version of Python, including 2.5, 2.6 and 3.0. That article shows, for the same script, Python2.6 has longer running time than

[issue4944] os.fsync() doesn't work as expect in Windows

2009-01-21 Thread Javen Wang
Javen Wang jave...@gmail.com added the comment: I'm using Python2.5 in which close_fds is not available in Windows. And I cannot use Python2.6 because I need to redirect the stdout and stderr and there's performance concern. I have questions on the root cause: a. why doesn't fopen() has

[issue4944] os.fsync() doesn't work as expect in Windows

2009-01-20 Thread Javen Wang
Javen Wang jave...@gmail.com added the comment: I did trace the order of file creation and process launch. It shows the file is indeed created before the process launch. I did another investigation. I added a new process, cmd.exe /c copy Makefile NewMakefile, to copy the the Makefile created

[issue4944] os.fsync() doesn't work as expect in Windows

2009-01-20 Thread Javen Wang
Javen Wang jave...@gmail.com added the comment: The test code and script which can reproduce the problem has been uploaded. Added file: http://bugs.python.org/file12808/test_file_flush.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue4944] os.fsync() doesn't work as expect in Windows

2009-01-19 Thread Javen Wang
Javen Wang jave...@gmail.com added the comment: I'm quite certain that the makefile is generated before the make program is launched in separated process. Follow is the original code where the makefile is created (line 14) and a task is put in queue (line 19). It's executed in the main thread

[issue4944] os.fsync() doesn't work as expect in Windows

2009-01-14 Thread Javen Wang
Javen Wang jave...@gmail.com added the comment: gagenellina, My application is a little bit different from your test code. It won't wait for the exit of new process and there're file writing operations during makefile running. I changed the test code to be real multi-process and tried many file

[issue4944] os.fsync() doesn't work as expect in Windows

2009-01-14 Thread Javen Wang
Javen Wang jave...@gmail.com added the comment: The created files are on local drive. I saw the problem on the laptop (XP-SP2), desktop(XP-SP3) and server (Win2003). But there's no such problem on the Linux and Mac boxes. I tried to use fopen/fwrite in my extension according to your suggestion

[issue4944] os.fsync() doesn't work as expect in Windows

2009-01-14 Thread Javen Wang
Javen Wang jave...@gmail.com added the comment: There would be more chances to see the problem by doing this: C:\test\edk2 python.exe C:\test\tools\Source\Python\build\build.py -n 2 -p IntelFrameworkModulePkg\IntelFrameworkModulePkg.dsc -a IA32 -s ___ Python

[issue4944] os.fsync() doesn't work as expect in Windows

2009-01-14 Thread Javen Wang
Javen Wang jave...@gmail.com added the comment: I agree multithread programming is kind of difficult and tricky. But I don't think there's a race condition in _MultiThreadBuildPlatform method, because I do have only one producer. And the consumer consumes the product only when it's done (i.e

[issue4944] os.fsync() doesn't work as expect in Windows

2009-01-13 Thread Javen Wang
New submission from Javen Wang jave...@gmail.com: I encountered a very strange issue in file flush operation in Windows. Here's the scenario of my application: 1. The main thread of my application will create makefiles sequentially. 2. Once a makefile is generated, launch a separate

[issue4650] getopt need re-factor...

2008-12-12 Thread Wang Chun
New submission from Wang Chun yaohua2...@gmail.com: I created #4629 a couple of days ago. And besides that issue, for Python 3.x, I guess we can remove getopt.error since Python 3.x does not have to backward compatible with Python 2.x. And another issue is, GetoptError does not render right

[issue4651] getopt need re-factor...

2008-12-12 Thread Wang Chun
New submission from Wang Chun yaohua2...@gmail.com: I created #4629 a couple of days ago. And besides that issue, for Python 3.x, I guess we can remove getopt.error since Python 3.x does not have to backward compatible with Python 2.x. And another issue is, GetoptError does not render right

[issue4629] getopt should not accept no_argument that ends with '='

2008-12-10 Thread Wang Chun
New submission from Wang Chun [EMAIL PROTECTED]: Consider the following program tmp.py: import sys, getopt print(getopt.getopt(sys.argv[1:], '', ['help'])) The program accept --help without a value: python helloworld.py --help But if someone invoke the program like: python helloworld.py

[issue4629] getopt should not accept no_argument that ends with '='

2008-12-10 Thread Wang Chun
Changes by Wang Chun [EMAIL PROTECTED]: -- keywords: +patch Added file: http://bugs.python.org/file12325/getopt.py.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4629

[issue4515] Formatting error in What's New in Python 3.0

2008-12-03 Thread Peter Wang
New submission from Peter Wang [EMAIL PROTECTED]: In the section Removed Syntax, there is some ReST markup that leaked through into the output: The only acceptable syntax for relative imports is from .``[*module*] :keyword:`import` *name*; :keyword:`import` forms not starting

[issue4516] Another formatting error in What's New in Python 3.0

2008-12-03 Thread Peter Wang
New submission from Peter Wang [EMAIL PROTECTED]: In the Library Changes section, the next to last bullet point about string.letters has leaked through some ReST markup into the final output: :data:string.letters` -- assignee: georg.brandl components: Documentation messages: 76866 nosy

Documenation for yum and rpmUtils modules

2008-11-13 Thread Peter Wang
Hi All, I'm new to Python. I troubleshoot a yum install error. so i'm studying yum and rmpUtils module and try to understand how yum works. Do you know where can I find the documenation for yum and rpmUtils module? Thanks, Peter -- http://mail.python.org/mailman/listinfo/python-list

[issue2173] Python fails silently on bad locale

2008-11-12 Thread Wang Chun
Wang Chun [EMAIL PROTECTED] added the comment: This issue remains unsolved in the latest python 3.0rc2+ subversion repository as of 2008-11-13. -- nosy: +wangchun ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2173

[issue1982] Feature: extend strftime to accept milliseconds

2008-10-29 Thread Wang Chun
Wang Chun [EMAIL PROTECTED] added the comment: Ruby recently added support of millisecond and nanosecond to strftime. This is their changeset: http://redmine.ruby-lang.org/repositories/revision/ruby-19?rev=18731 To use the extended strftime, one can do: Time.now.strftime('%Y-%m-%dT%H:%M:%S

[issue4227] unicode_literals and print_function do not work together.

2008-10-29 Thread Wang Chun
New submission from Wang Chun [EMAIL PROTECTED]: If from __future__ import unicode_literals, print_function, unicode_literals works, but not print_function; If from __future__ import print_function, unicode_literals, print_function works, but not unicode_literals. -- components

Can i use this script as a python evaluator?

2008-10-20 Thread Peter Wang
code #! /bin/sh python -c import sys;exec(sys.stdin) /code Emacs has a function `shell-command-on-region', which takes region as input for the evaluator (script above), and output its result. I have tried and found it works, is there any problems for this, or any other better solution for it?

Re: Can i use this script as a python evaluator?

2008-10-20 Thread Peter Wang
Bruno Desthuilliers [EMAIL PROTECTED] writes: Peter Wang a �crit : code #! /bin/sh python -c import sys;exec(sys.stdin) /code Emacs has a function `shell-command-on-region', which takes region as input for the evaluator (script above), and output its result. I have tried and found

Re: Can i use this script as a python evaluator?

2008-10-20 Thread Peter Wang
Nathan Seese [EMAIL PROTECTED] writes: #! /bin/sh python -c import sys;exec(sys.stdin) I know this isn't your question, but I think you could write that more cleanly with: #!/usr/bin/python import sys exec(sys.stdin) thanks. What's the difference between this and mine? I think what i

[issue4027] wrong page index number in reference book of python documentation

2008-10-17 Thread Ray Wang
Ray Wang [EMAIL PROTECTED] added the comment: Thanks for your big efforts! ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4027 ___ ___ Python-bugs-list mailing

[issue4027] wrong page index number in reference book of python documentation

2008-10-16 Thread Ray Wang
Ray Wang [EMAIL PROTECTED] added the comment: ah, thanks goodness, what a fortune that you are not ignoring this problem. I expect the fix could be happen in the near future. :) ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4027

[issue4027] wrong page index number in reference book of python documentation

2008-10-16 Thread Ray Wang
Ray Wang [EMAIL PROTECTED] added the comment: Woohoo, you are awesome, thanks a lot! ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4027 ___ ___ Python-bugs-list

[issue4027] wrong page index number in reference book of python documentation

2008-10-15 Thread Ray Wang
Ray Wang [EMAIL PROTECTED] added the comment: any feedback here? ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4027 ___ ___ Python-bugs-list mailing list

[issue4027] wrong page index number in reference book of python documentation

2008-10-15 Thread Ray Wang
Ray Wang [EMAIL PROTECTED] added the comment: We are all volunteers here, and I see three replies. This may or may not be trivial to fix, and may take some time. Python docs are written in rst format and translated by Sphinx to various formats. The main translation is to html, as viewed

Re: automatically insert text in ms-word properties

2008-10-07 Thread Peter Wang
gita ziabari [EMAIL PROTECTED] writes: All, I wanna use python to automatically insert text in ms-word properties. Anyone could help me? Why not use VBA for that work? Thanks -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list

[issue4027] wrong page index number in reference book of python documentation

2008-10-03 Thread Ray Wang
New submission from Ray Wang [EMAIL PROTECTED]: the Glossary's index number is 3, which should be 75, so people could not navigate Glossary by clicking the title showed in Table of Content, or index link which is beside the content in Evince. -- assignee: georg.brandl components

pause between the loops

2008-09-21 Thread Jackie Wang
Hi all, For a loop like: for i = range (0,10); can I ask python to stop for, say, 5mins, after it go through loop i=0 before it starts loop i=1? Thank you very much! Jackie -- http://mail.python.org/mailman/listinfo/python-list

Use BeautifulSoup to delete certain tag while keeping its content

2008-09-06 Thread Jackie Wang
Dear all, I have the following html code: td valign=top headers=col1 font size=2 Center Bank br / Los Angeles, CA /font /td td valign=top headers=col1 font size=2 Salisbury Bank and Trust Company font face=arial, helvetica size=2 color=#000 br / Lakeville, CT /font

Extract Information from Tables in html

2008-09-05 Thread Jackie Wang
Dear all, Here is a html code: td valign=top headers=col4 Premier Community Bank of Southwest Florida br / Fort Myers, FL /td My question is how I can extract the strings and get the results: Premier Community Bank of Southwest Florida; Fort Myers, FL Thanks a lot

How to convert DocBook sect1 to html by Python?

2008-08-10 Thread Younger Wang
Hi, Is there any way to convert from DocBook to html in Python? Thanks! BR Younger Wang -- http://mail.python.org/mailman/listinfo/python-list

Re: os.system question

2008-08-06 Thread Larry Wang
os.system() simply executes the command in a subshell, and returns the command's exit status which in your case is '0'. If you need to capture the stdout, stderr, etc. stuff, subprocess module is preferred which offers more powerful functionalities over os.system(). Nessus Kevin Walzer

RE: How to package a logging.config file?

2008-07-14 Thread Younger Wang
, format='%(levelname)s %(module)s:%(lineno)d: %(message)s') return logging.getLogger(name) I had to make this helper function because calling logging.getLogger will fail in an exception without configuring logging module. I wish it is not like that. BR Younger Wang -Original Message

[issue3058] Let SimpleXMLRPCServer pass client_address to called functions.

2008-06-07 Thread Kunshan Wang
New submission from Kunshan Wang [EMAIL PROTECTED]: I recently wrote a program making use of SimpleXMLRPCServer. It has a function that responds to the caller according to the caller's IP address. However the current SimpleXMLRPCServer does not allow me to do this (directly). For example: def

Is Leo better than Vim and emacs?

2008-04-09 Thread wang frank
Hi, Thanks for developing Leo. I have been using Vim for long time to write code. Is it a good time to switch to Leo? what is the advantage of Leo against vim and emacs? Thanks Frank _

Automatically fill in forms on line

2008-03-31 Thread Jackie Wang
Dear all, I want to automatically complete the following task: 1. Go to http://www.ffiec.gov/Geocode/default.aspx; 2. Fill in an address in the form Street Address: . e.g. 1316 State Highway 102; 3. Fill in a ZIPcode in the form Zip Code: . e.g. 04609; 4. Click the bottom search; 5. In the

Re: Fast 2D Raster Rendering with GUI

2008-03-18 Thread Peter Wang
On Mar 18, 6:51 pm, Ivan Illarionov [EMAIL PROTECTED] wrote: That's another new step for me. Any ideas where to start? http://docs.python.org/ext/simpleExample.html And look into the source of existing extensions. PIL and PyCairo are the best in your situation. You shouldn't be afraid of

<    1   2   3   4   >