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,

Re: pyserial: Unexpected Local Echo

2010-01-17 Thread Steven Woody
2010/1/16 John Nagle na...@animats.com: Grant Edwards wrote: On 2010-01-11, Steven Woody narkewo...@gmail.com 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 local echo.  Is the data coming out

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

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 dbod...@trolltech.comwrote: On Thursday 10 September 2009, Steven Woody wrote: On Wed, Sep 9, 2009 at 9:33 PM, David Boddie dbod...@trolltech.com wrote: See this page for the links: http://www.qtrac.eu/pyqtbook.html but the URL

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 dbod...@trolltech.com 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 please give me a non

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

Re: Blank Line at Program Exit

2009-08-23 Thread Steven Woody
On Sat, Aug 22, 2009 at 11:25 PM, Nitebirdz nitebi...@sacredchaos.comwrote: 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's the reason

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

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

Re: OptionParser How to: prog cmd [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 cmd [options] [arguments]

2009-08-14 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 cmd [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 p...@freehackers.org wrote: On Jan 19, 4:10 am, Steven Woody narkewo...@gmail.com 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++ toolkit

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.

Re: Event Handling and Signal-Slot Mechanism

2009-01-18 Thread Steven Woody
On Mon, Jan 19, 2009 at 11:29 AM, James Mills prolo...@shortcircuit.net.au wrote: On Mon, Jan 19, 2009 at 1:10 PM, Steven Woody narkewo...@gmail.com wrote: Python has Signal-Slot mechanism, why he still need another mechanism Event Handling? And, in some cases, it seems only Event Handling

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 bruno.42.desthuilli...@websiteburo.invalid wrote: Steven Woody a écrit : On Fri, Jan 9, 2009 at 1:02 PM, James Mills prolo...@shortcircuit.net.au wrote: On Fri, Jan 9, 2009 at 2:57 PM, Steven Woody narkewo...@gmail.com wrote: In C++/Java

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

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 prolo...@shortcircuit.net.au wrote: On Fri, Jan 9, 2009 at 2:57 PM, Steven Woody narkewo...@gmail.com 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

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 st...@holdenweb.com wrote: Chris Rebert wrote: On Thu, Jan 8, 2009 at 9:09 PM, Steven Woody narkewo...@gmail.com wrote: On Fri, Jan 9, 2009 at 1:02 PM, James Mills prolo...@shortcircuit.net.au wrote: On Fri, Jan 9, 2009 at 2:57 PM, Steven Woody

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: 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 p...@riverbankcomputing.com wrote: On Fri, 9 Jan 2009 15:15:28 +0800, Steven Woody narkewo...@gmail.com wrote: Hi, I am considering using PyQt for GUI programs, and I notices that both of them include threading supports, so which one should I

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

__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: __builtin__ quote

2009-01-06 Thread Steven Woody
On Tue, Jan 6, 2009 at 4:42 PM, James Stroud jstr...@mbi.ucla.edu 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. It saves typing. This might help your

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

Re: message of Exception

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

Re: message of Exception

2009-01-06 Thread Steven Woody
On Wed, Jan 7, 2009 at 12:02 PM, Terry Reedy tjre...@udel.edu wrote: Steven Woody wrote: 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

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: 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

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 prolo...@shortcircuit.net.au wrote: On Mon, Dec 22, 2008 at 4:56 PM, Steven Woody narkewo...@gmail.com 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

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 st...@remove-this-cybersource.com.au 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 Tue, Dec 23, 2008 at 5:05 AM, John Machin sjmac...@lexicon.net wrote: On Dec 23, 1:52 am, Steven Woody narkewo...@gmail.com wrote: On Mon, Dec 22, 2008 at 6:44 PM, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Mon, 22 Dec 2008 14:56:45 +0800, Steven Woody wrote

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 represent a sequence of raw bytes

2008-12-21 Thread Steven Woody
On Mon, Dec 22, 2008 at 10:27 AM, Michiel Overtoom mot...@xs4all.nl 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\x22\33 for b in buf: print ord(b) ... 17 34 27

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 --

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 bruno.42.desthuilli...@websiteburo.invalid 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 ... into a list of integers on which I