about Frame.__init__(self)

2005-04-27 Thread yang
.. the line "Frame.__init__(self)" puzzle me. why use it like this? can some one explain it? regards, yang -- http://mail.python.org/mailman/listinfo/python-list

about Frame.__init__(self)

2005-04-27 Thread yang
.. the line "Frame.__init__(self)" puzzle me. why use it like this? can some one explain it? regards, yang -- http://mail.python.org/mailman/listinfo/python-list

Assertion failure on hotshot.stats.load()

2006-10-27 Thread Yang
Note: I realize hotshot is obsoleted by cProfile, but 2.5 breaks several packages I depend on. I'm using Python 2.4.3. I'm getting an AssertionError on "assert not self._stack" when calling hotshot.stats.load() on my app's hotshot profile. The app consistently causes hotshot to generate such a pro

Re: Assertion failure on hotshot.stats.load()

2006-10-27 Thread Yang
I fell back onto the old profile module, but got the following error when trying to use zope.interface. I am now without any way to profile my application. Traceback (most recent call last): File "/home/yang/local/bin/profile.py", line 611, in ? run('execfile(%r)

Re: Assertion failure on hotshot.stats.load()

2006-10-27 Thread Yang
;"" error i get: Traceback (most recent call last): File "/home/yang/local/bin/profile.py", line 611, in ? run('execfile(%r)' % (sys.argv[0],), options.outfile, options.sort) File "/home/yang/local/bin/profile.py", line 72, in run prof = prof

Determining cause of termination

2007-03-16 Thread Yang
ssible what happened? For starters, I'm now checking exit status and periodically running 'top' to monitor memory consumption, but are there any other ideas? Thanks in advance, Yang -- http://mail.python.org/mailman/listinfo/python-list

Closing socket file descriptors

2007-05-19 Thread Yang
Hi, I'm experiencing a problem when trying to close the file descriptor for a socket, creating another socket, and then closing the file descriptor for that second socket. I can't tell if my issue is about Python or POSIX. In the following, the first time through, everything works. On the sec

Re: Closing socket file descriptors

2007-05-20 Thread Yang
eadable( self ): ... "js " <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Hello, Yang. > > You're not supposed to use os.open there. > See the doc at http://docs.python.org/lib/os-fd-ops.html > > Is there any reason you want to use os.close? > >

spawn* or exec* and fork, what should I use and how ?

2004-12-15 Thread Lingyun Yang
Hi, I want to use python as a "shell like" program, and execute an external program in it( such as mv, cp, tar, gnuplot) I tried: os.execv("/bin/bash",("/usr/bin/gnuplot",'-c "gnuplot < plot.tmp"')) since it's in a for-loop, it should be executed many times, but It exits after the first time runn

Re: spawn* or exec* and fork, what should I use and how ?

2004-12-15 Thread Lingyun Yang
Peter Hansen wrote: Lingyun Yang wrote: I want to use python as a "shell like" program, and execute an external program in it( such as mv, cp, tar, gnuplot) os.execv("/bin/bash",("/usr/bin/gnuplot",'-c "gnuplot < plot.tmp"')) I would sugges

Python v.s. c++

2005-02-10 Thread xiaobin yang
Hi, if i am already skillful with c++. Is it useful to learn python? thanks! -- http://mail.python.org/mailman/listinfo/python-list

How many web framework for python ?

2006-02-17 Thread Bo Yang
Hello everybody , I am a student major in software engeering . I need to do something for my course . There are very good web framework for java and ruby , Is there one for python ? I want to write a web framework for python based on mod_python as my course homework , could you give some advise ?

Re: How many web framework for python ?

2006-02-18 Thread Bo Yang
Thank you very much ! -- http://mail.python.org/mailman/listinfo/python-list

make a class instance from a string ?

2006-02-23 Thread Bo Yang
Hi, I know in java , we can use class.ForName("classname") to get an instance of the class 'classname' from a string , in python , how do I do that ? Thanks in advance ! -- http://mail.python.org/mailman/listinfo/python-list

Re: reusing parts of a string in RE matches?

2006-05-10 Thread Bo Yang
John Salerno 写道: > I probably should find an RE group to post to, but my news server at > work doesn't seem to have one, so I apologize. But this is in Python > anyway :) > > So my question is, how can find all occurrences of a pattern in a > string, including overlapping matches? I figure it ha

An algorithm problem

2006-05-30 Thread Bo Yang
Hi , I have writen a python program to slove a problem described as below: (Forgive my poor English !) Put the 2^n 0 or 1 to form a ring , and we can select any continuous n ones from the ring to constitute a binary number . And obviously we can get 2^n selections , so the question is : Given a n

Re: An algorithm problem

2006-05-31 Thread Bo Yang
as a ring , and fetch any continuous 2 numbers from it , finally get four combinations : 11 , 10 , 00 , 01 and they are 3 , 2 , 0 , 1 . I hope this time it is clear for all to understand what problem confront me . And again I am sorry for the trouble , thanks for you again ! Best Regard Bo

Re: An algorithm problem

2006-05-31 Thread Bo Yang
rd Bo Yang #This is the file for the solution of the 0-1 ring problem #in the csdn algorithm forum #The input to this program is a integer n , #The ouuput of the algorithm is the a list of 2^n elements #in which every number in the range of 0~2^n-1 just appear #once exactly . flag = 0# wheth

Re: do design patterns still apply with Python?

2006-03-04 Thread Bo Yang
Paul Novak 写道: > A lot of the complexity of design patterns in Java falls away in > Python, mainly because of the flexibility you get with dynamic typing. > I agree with this very much ! In java or C++ or all such static typing and compiled languages , the type is fixed on in the compile phrase ,

Re: do design patterns still apply with Python?

2006-03-04 Thread Bo Yang
Paul Novak : > A lot of the complexity of design patterns in Java falls away in > Python, mainly because of the flexibility you get with dynamic typing. > I agree with this very much ! In java or C++ or all such static typing and compiled languages , the type is fixed on in the compile phrase ,

Re: Learning different languages

2006-03-08 Thread Bo Yang
Rich said : > Hi, > > (this is a probably a bit OT here, but comp.lang seems rather > desolated, so I'm not sure I would get an answer there. And right now > I'm in the middle of learning Python anyway so...) > > Anyway, my question is: what experience you people have with working > with different

How can I get the text under the cusor ?

2006-04-06 Thread Bo Yang
Hello , I want to develop an application to record some of the best words and ideas in the web when I surfing with the Firefox or IE . I would like the application have such a GUI : 1.it appear in the system tray area in the Windows ; 2.whenever I select some words (ether in an IE or MS word),I hop

A question about the urllib2 ?

2006-04-11 Thread Bo Yang
Hi , Recently I use python's urllib2 write a small script to login our university gateway . Usually , I must login into the gateway in order to surf the web . So , every time I start my computer , it is my first thing to do that open a browser to login the gateway ! So , I decide to write such a s

Re: A question about the urllib2 ?

2006-04-12 Thread Bo Yang
Fuzzyman 写道: > Bo Yang wrote: > >> Hi , >> Recently I use python's urllib2 write a small script to login our >> university gateway . >> Usually , I must login into the gateway in order to surf the web . So , >> every time I >> start my computer ,

Re: A question about the urllib2 ?

2006-04-14 Thread Bo Yang
Serge Orlov 写道: > Bo Yang wrote: > >> Hi , >> Recently I use python's urllib2 write a small script to login our >> university gateway . >> Usually , I must login into the gateway in order to surf the web . So , >> every time I >> start my co

Re: Kross - Start of a Unified Scripting Approach

2006-04-15 Thread Bo Yang
RM 写道: > This is from the new KOffice Announcement. > > http://www.koffice.org/announcements/announce-1.5.php > > '''This version of KOffice features a start of a unified scripting > solution called Kross. Kross provides cross-language support for > scripting (thus its name) and at present supports

Python 2.5 "make install" bug?

2006-10-10 Thread Yang Zhang
All the site-packages/*.so files get copied to the directory specified in my ~/.pydistutils.cfg instead of lib-dynload under the prefix dir, then proceeds to chmod 755 all the files in that directory (including ones that existed before install). Please advise. -- http://mail.python.org/mailman/lis

using PyUnit to test with multiple threads

2007-03-28 Thread winston . yang
Is it possible to use PyUnit to test with multiple threads? I want to send many commands to a database at the same time. The order of execution of the commands is indeterminate, and therefore, so is the status message returned. For example, say that I send the commands "get" and "delete" for a gi

PyImport_Import() failed

2006-08-02 Thread Yang Fan
Hello,   I'm new to Python.I want to embed Python interpreter into my C++ application powered by Borland C++ Builder 2006.   I have written some C++ code in order to evaluate Python script file, but PyImport_Import() calls failed.I really don't know what's wrong with my cpp code.It always return a

How to download a web page just like a web browser do ?

2006-08-23 Thread Bo Yang
Hi , It is about one month passed since I post to this list last time . Yes , I use python , I used it in every day normal work , whenever I need to do some scripts or other little-scale works , python is the first one I took consideration in . I must say it is a powerful tool for me , and wha

Re: How to download a web page just like a web browser do ?

2006-08-24 Thread Bo Yang
Thank you , Max ! I think HarvestMan is just what I need ! Thanks again ! -- http://mail.python.org/mailman/listinfo/python-list

reading argv argument of unittest.main()

2007-05-10 Thread winston . yang
I've read that unittest.main() can take an optional argv argument, and that if it is None, it will be assigned sys.argv. Is there a way to pass command line arguments through unittest.main() to the setUp method of a class derived from unittest.TestCase? Thank you in advance. Winston -- http://

An error ?

2006-06-11 Thread Bo Yang
Hi , I am confronted with an odd question in the python cgi module ! Below is my code : import cgitb ; cgitb.enable() import cgi print "Hello World !" How easy the script is , and the url is 202.113.239.51/vote/cgi/a.py but apache give me a 'Server internal error !' and the error log is : [Fr

Re: An error ?

2006-06-12 Thread Bo Yang
It works , thank you everyone ! I think there is much more I need to learn before I can grasp a full understand of the C/S modle ! Thanks again ! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python or Ajax?

2006-06-12 Thread Bo Yang
I think if you know java language very well but feel suffering with the error prone javascript , GWT is good choose for AJAX development . With the well-known IDE Eclipse your development time efficiency will promote fast ! -- http://mail.python.org/mailman/listinfo/python-list

How do you use this list ?

2006-06-27 Thread Bo Yang
Hi everyone , I have join this list for about 4 months , and everyday I receive hundreds of mails . There is no means to read all of them , so I just read something interesting for me . But if so , there are too much mails pile up in my inbox , I want to ask how do you use this list , reading every