Took too long time to start before executing my first line of code

2015-04-23 Thread Steven Woody
Hi, I got a problem and hope your gurus can show me some clues. I run python on an embedded ARM system. Everything is fine except that it seems every program need 3s+ time to load -- I mean it took 3s before executing the first line of every program. I run strace but cannot identify the true

How to find an COM object in using of pywin32

2010-03-01 Thread Steven Woody
Hi, I want to interactive with an OLE application with pywin32. The problem is I get totally no idea how to find the object in OLEView and how to figure out it's interface. With pywin32's example, I even don't understand that in the below statement, win32com.client.Dispatch('Excel.Application

Re: pyserial: Unexpected Local Echo

2010-01-17 Thread Steven Woody
2010/1/16 John Nagle : > Grant Edwards wrote: >> >> On 2010-01-11, Steven Woody wrote: >> >>> I am using pyserial.  But I always get the local echo after I >>> write some characters onto serial port >> >> I really doubt you're getting a loc

pyserial: Unexpected Local Echo

2010-01-11 Thread Steven Woody
Hi, I am using pyserial. But I always get the local echo after I write some characters onto serial port and I find no way to disable this behavior. When I say 'local echo', I mean the next read operation will get characters that was just write to the same port. I run my program on cygwin (pyseri

Re: "Rapid GUI Programming with Python and Qt" source code

2009-09-11 Thread Steven Woody
On Thu, Sep 10, 2009 at 10:18 PM, David Boddie wrote: > On Thursday 10 September 2009, Steven Woody wrote: > > On Wed, Sep 9, 2009 at 9:33 PM, David Boddie > wrote: > > > > See this page for the links: > > > > > > http://www.qtrac.eu/pyqtbook.html >

Re: "Rapid GUI Programming with Python and Qt" source code

2009-09-10 Thread Steven Woody
On Wed, Sep 9, 2009 at 9:33 PM, David Boddie wrote: > On Wed Sep 9 07:11:26 CEST 2009, Steven Woody wrote: > > > *I've searched google and cannot find a valid link for the source code of > > the book "Rapid GUI Programming with Python and Qt". Could anyone pl

"Rapid GUI Programming with Python and Qt" source code

2009-09-08 Thread Steven Woody
*Hi, * *I've searched google and cannot find a valid link for the source code of the book "Rapid GUI Programming with Python and Qt". Could anyone please give me a non-broken URL?* Thanks. * *-- Life is the only flaw in an otherwise perfect nonexistence -- Schopenhauer narke public key at htt

How to distribute an application

2009-08-23 Thread Steven Woody
Hi, My application contains a main python source file as well as a set of modules (also .py files). Now, I am considering distribute my application to others. But the distutils seems made for distributing packages not for main applications. Am I right? Thanks. -- Life is the only flaw in an o

Re: Blank Line at Program Exit

2009-08-23 Thread Steven Woody
On Sat, Aug 22, 2009 at 11:25 PM, Nitebirdz wrote: > On Thu, Aug 20, 2009 at 01:31:14PM +0800, Steven Woody wrote: > > Hi, > > Any python program, even that does absolutely nothing in the code, will > > cause a blank line printed out when the program exit. What'

line completion

2009-08-22 Thread Steven Woody
Hi, I wrote a program that takes some user input. Many inputs are quit often used by user, so when a user launch the program, and type in "The Sha", he wants to get "wshank Redemption" displayed automatically in reversed color (black text on white background) along his cursor. When he decided to

Blank Line at Program Exit

2009-08-22 Thread Steven Woody
Hi, Any python program, even that does absolutely nothing in the code, will cause a blank line printed out when the program exit. What's the reason? Thanks. -- Life is the only flaw in an otherwise perfect nonexistence -- Schopenhauer narke public key at http://subkeys.pgp.net:11371 (narke

Re: OptionParser How to: prog [options] [arguments]

2009-08-15 Thread Steven Woody
Thanks for all you suggestions! -- http://mail.python.org/mailman/listinfo/python-list

OptionParser How to: prog [options] [arguments]

2009-08-13 Thread Steven Woody
Hi, I am using OptionParser, but I've not managed figure out a way to support what I wanted command line format "prog [options] [arguments]". E.g., "svn ls -r123 http://hello.world";. Can I do this using OptionParser? Thanks. -- Life is the only flaw in an otherwise perfect nonexistence --

Re: Event Handling and Signal-Slot Mechanism

2009-01-19 Thread Steven Woody
On Tue, Jan 20, 2009 at 1:03 AM, BlueBird wrote: > On Jan 19, 4:10 am, Steven Woody wrote: >> Hi, >> >> Python has Signal-Slot mechanism, > > Python does not have signal/slot mechanism. You are talking about the > Qt toolkit, which is initially a (nice) C++ toolk

Re: Event Handling and Signal-Slot Mechanism

2009-01-18 Thread Steven Woody
On Mon, Jan 19, 2009 at 11:29 AM, James Mills wrote: > On Mon, Jan 19, 2009 at 1:10 PM, Steven Woody wrote: >> Python has Signal-Slot mechanism, why he still need another mechanism >> Event Handling? And, in some cases, it seems only Event Handling >> mechanism is a

Event Handling and Signal-Slot Mechanism

2009-01-18 Thread Steven Woody
Hi, Python has Signal-Slot mechanism, why he still need another mechanism Event Handling? And, in some cases, it seems only Event Handling mechanism is available, for example closeEvent(). For what case and for what reason, the python think Signal Slot is not enough and will not work? Thanks. -

File layout in development stage

2009-01-11 Thread Steven Woody
Hi, Adapted your kindly suggestions in a previous post, I now decide to organize my source tree in a pattern like below: prj: src: lib: foomodule.py barmodule.py scripts: prj_main.py test: footest.py bartest.py

Re: Best practice in organize classes into modules

2009-01-09 Thread Steven Woody
On Fri, Jan 9, 2009 at 4:54 PM, Bruno Desthuilliers wrote: > Steven Woody a écrit : >> >> On Fri, Jan 9, 2009 at 1:02 PM, James Mills >> wrote: >>> >>> On Fri, Jan 9, 2009 at 2:57 PM, Steven Woody >>> wrote: >>>> >>>&

Re: threading in PyQt vs threading in standard library

2009-01-08 Thread Steven Woody
On Fri, Jan 9, 2009 at 3:32 PM, Phil Thompson wrote: > On Fri, 9 Jan 2009 15:15:28 +0800, "Steven Woody" > wrote: >> Hi, >> >> I am considering using PyQt for GUI programs, and I notices that both >> of them include threading supports, so which one s

threading in PyQt vs threading in standard library

2009-01-08 Thread Steven Woody
Hi, I am considering using PyQt for GUI programs, and I notices that both of them include threading supports, so which one should I pick up? Similar also applies 'socket'. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Best practice in organize classes into modules

2009-01-08 Thread Steven Woody
On Fri, Jan 9, 2009 at 2:52 PM, Steve Holden wrote: > Chris Rebert wrote: >> On Thu, Jan 8, 2009 at 9:09 PM, Steven Woody wrote: >>> On Fri, Jan 9, 2009 at 1:02 PM, James Mills >>> wrote: >>>> On Fri, Jan 9, 2009 at 2:57 PM, Steven Woody wrote: >>

Re: Best practice in organize classes into modules

2009-01-08 Thread Steven Woody
On Fri, Jan 9, 2009 at 1:02 PM, James Mills wrote: > On Fri, Jan 9, 2009 at 2:57 PM, Steven Woody wrote: >> In C++/Java, people usually put one class into one file. What's the >> suggestion on this topic in Python? I so much interesting this >> especially when excep

Best practice in organize classes into modules

2009-01-08 Thread Steven Woody
Hi, In C++/Java, people usually put one class into one file. What's the suggestion on this topic in Python? I so much interesting this especially when exception classes also involved. Thanks. - narke -- http://mail.python.org/mailman/listinfo/python-list

frontend + backend style application design

2009-01-07 Thread Steven Woody
Hi, I am considering write an application, its core functionalities should be implemented in a command-line application with which a user can interact via its command line interface. This kind of command line interface can help batch usage of the application. On the other hand, I still want a GUI

Re: message of Exception

2009-01-06 Thread Steven Woody
On Wed, Jan 7, 2009 at 12:02 PM, Terry Reedy wrote: > Steven Woody wrote: >> >> Hi, >> >> I am trying define an Exception as below: >> >> class MyError(Exception): >>def __init__(self, message): >>self.message = message >> &g

Re: message of Exception

2009-01-06 Thread Steven Woody
On Wed, Jan 7, 2009 at 11:09 AM, Chris Rebert wrote: > On Tue, Jan 6, 2009 at 6:56 PM, Steven Woody wrote: >> Hi, >> >> I am trying define an Exception as below: >> >> class MyError(Exception): >>def __init__(self, message): >>self.mess

message of Exception

2009-01-06 Thread Steven Woody
Hi, I am trying define an Exception as below: class MyError(Exception): def __init__(self, message): self.message = message And, I expect that when I raise a MyError as raise MyError, "my message" the python should print a line such as MyError: my message But I did not get th

Re: __builtin__ quote

2009-01-06 Thread Steven Woody
On Tue, Jan 6, 2009 at 4:42 PM, James Stroud wrote: > Steven Woody wrote: >> >> Hi, >> >> I am a new leaner and I get a question: abs() is a member of >> __builtin__ module, but why should I use abs() rather than >> __builtin__.abs() ? Thanks. > &

__builtin__ quote

2009-01-06 Thread Steven Woody
Hi, I am a new leaner and I get a question: abs() is a member of __builtin__ module, but why should I use abs() rather than __builtin__.abs() ? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Multi-dimension list

2008-12-23 Thread Steven Woody
Hi, In the book Python Essential Reference, Chapter 3, when talking about extended slicing, it gives an example: a = m[0:10, 3:20]. But I don't understand how the 'm' was defined. What should it looks like? Thanks. - narke -- http://mail.python.org/mailman/listinfo/python-list

Multi-dimension list

2008-12-23 Thread Steven Woody
Hi, In the book Python Essential Reference, Chapter 3, I see an example: -- http://mail.python.org/mailman/listinfo/python-list

Re: How to represent a sequence of raw bytes

2008-12-22 Thread Steven Woody
On Tue, Dec 23, 2008 at 5:05 AM, John Machin wrote: > On Dec 23, 1:52 am, "Steven Woody" wrote: >> On Mon, Dec 22, 2008 at 6:44 PM, Steven D'Aprano >> >> wrote: >> > On Mon, 22 Dec 2008 14:56:45 +0800, Steven Woody wrote: >> >> >

Re: How to represent a sequence of raw bytes

2008-12-22 Thread Steven Woody
On Mon, Dec 22, 2008 at 6:44 PM, Steven D'Aprano wrote: > On Mon, 22 Dec 2008 14:56:45 +0800, Steven Woody wrote: > >> The intension is to allocate 200 undefined bytes in memory. > > You *want* undefined bytes? Out of curiosity, what do you intend to do > with them?

Re: How to represent a sequence of raw bytes

2008-12-22 Thread Steven Woody
On Mon, Dec 22, 2008 at 4:35 PM, James Mills wrote: > On Mon, Dec 22, 2008 at 4:56 PM, Steven Woody wrote: >> I thing "\x11\x22\x33" in python is not the {0x11, 0x22, 0x33} in C. >> Since, a string in python is immutable, I can _not_ do something like: >> b[1]

Re: How to represent a sequence of raw bytes

2008-12-21 Thread Steven Woody
On Mon, Dec 22, 2008 at 10:27 AM, Michiel Overtoom wrote: > On Monday 22 December 2008 03:23:03 Steven Woody wrote: > >> 2. char buf[] = {0x11, 0x22, 0x33, ... } >> >> What's the equivalent representation for above in Python? > >>>> buf="\x11\x

How to represent a sequence of raw bytes

2008-12-21 Thread Steven Woody
Hi, What's the right type to represent a sequence of raw bytes. In C, we usually do 1. char buf[200] or 2. char buf[] = {0x11, 0x22, 0x33, ... } What's the equivalent representation for above in Python? Thanks. - narke -- http://mail.python.org/mailman/listinfo/python-list

Re: How to parsing a sequence of integers

2008-12-19 Thread Steven Woody
On Fri, Dec 19, 2008 at 9:33 PM, Bruno Desthuilliers wrote: > Steven Woody a écrit : >> >> Hi, >> >> I am a newbie and is reading the python book. Could anyone tell me, >> how to parsing the following string >> "123 100 12 37 ..." > >

How to parsing a sequence of integers

2008-12-19 Thread Steven Woody
Hi, I am a newbie and is reading the python book. Could anyone tell me, how to parsing the following string "123 100 12 37 ..." into a list of integers on which I can then apply max()/min()? In additional to max/min, is there something like average()? Thanks in advance. - narke -- http://ma