About wmi

2008-07-13 Thread patrol
I want to prevent some process from running. The code is in the following. I encounter some unexpected troubles. Probelm1: This program cannot terminate scrcons.exe and FNPLicensingService.exe,which are system processes. Problem2:After a while, this program will abort by error File

Re: About wmi

2008-07-13 Thread patrol
On 7月13日, 下午10时26分, Larry Bates [EMAIL PROTECTED] wrote: patrol wrote: I want to prevent some process from running. The code is in the following. I encounter some unexpected troubles. Probelm1: This program cannot terminate scrcons.exe and FNPLicensingService.exe,which are system

Re: About wmi

2008-07-14 Thread patrol
On 7月14日, 下午12时29分, Larry Bates [EMAIL PROTECTED] wrote: patrol wrote: On 7月13日, 下午10时26分, Larry Bates [EMAIL PROTECTED] wrote: patrol wrote: I want to prevent some process from running. The code is in the following. I encounter some unexpected troubles. Probelm1: This program cannot

Re: About wmi

2008-07-14 Thread patrol
Situation (1): result = new_process.terminate() TypeError: 'int' object is not callable Situation (2): result = new_process.terminate() File C:\Python25\lib\wmi.py, line 494, in __getattr__ handle_com_error (error_info) File C:\Python25\lib\wmi.py, line 190, in handle_com_error

Re: About wmi

2008-07-15 Thread patrol
http://timgolden.me.uk/wmi-project/wmi.py It cannot work either. which is a copy of the svn trunk to see if that improves the UnicodeDecode error, please? I'll try to get an install of a non-English edition of Windows but, as you might imagine, I normally run the UK version so don't hit

Re: About wmi

2008-07-15 Thread patrol
At any rate, try using: result, = new_process.Terminate () Windows is sometime case insensitive,but the python is case sensitive. I also encountered this kind of problems. Thanks for Tim's help. Patrol -- http://mail.python.org/mailman/listinfo/python-list

Re: About wmi

2008-07-16 Thread patrol
On 7月16日, 下午3时29分, Tim Golden [EMAIL PROTECTED] wrote: patrol wrote: http://timgolden.me.uk/wmi-project/wmi.py It cannot work either. Oh well. It was only a quick fix! I'll try to get some kind of non-ASCII edition of Windows to test against. As I understand it, the situation

Re: About wmi

2008-07-16 Thread patrol
On 7月16日, 下午10时39分, Tim Golden [EMAIL PROTECTED] wrote: patrol wrote: The errors are in the following: Traceback (most recent call last): File D:\My Documents\code\python\wmi\test.py, line 5, in module c = wmi.WMI (non-existent computer) File C:\Python25\lib\wmi.py, line 1199

Re: About wmi

2008-07-16 Thread patrol
On 7月16日, 下午11时59分, Tim Golden [EMAIL PROTECTED] wrote: patrol wrote: -2147023174 'RPC \xb7\xfe\xce\xf1\xc6\xf7\xb2\xbb\xbf\xc9\xd3\xc3\xa1\xa3' None None -- import pythoncom import win32com.client try

Re: About wmi

2008-07-16 Thread patrol
use the CP936.Every Chinese word utilizes two bytes.Maybe you can fix this bug by modifying handle_com_error. Patrol -- http://mail.python.org/mailman/listinfo/python-list

Re: About wmi

2008-07-16 Thread patrol
On 7月17日, 上午3时20分, Tim Golden [EMAIL PROTECTED] wrote: patrol wrote: On 7月17日, 上午12时16分, Tim Golden [EMAIL PROTECTED] wrote: Assuming that the error comes back in the sys.stdout encoding, the following version *should* work ok. I still haven't got a non-English set up to test

Re: About wmi

2008-07-16 Thread patrol
I will try to modify the wmi.py ,however I'm a novice.It will take a long time. You can give it up temporarily. If you don't mind ,can you tell me where needs modifying and how? Just unicode? Or Other? -- http://mail.python.org/mailman/listinfo/python-list

Re: About wmi

2008-07-18 Thread patrol
On 7月17日, 下午4时22分, Tim Golden [EMAIL PROTECTED] wrote: patrol wrote: I will try to modify the wmi.py ,however I'm a novice.It will take a long time. You can give it up temporarily. If you don't mind ,can you tell me where needs modifying and how? Just unicode? Or Other? OK. Thanks

Re: Looking out a module for Subversion

2008-08-12 Thread Patrol Sun
Eclipse with PyDev extension cannot debug. Ulipad is able to debug,but it needs wxpython to support. 2008/8/12 Alexandru Palade [EMAIL PROTECTED] As for the open source IDE you can always try Eclipse with PyDev extension. Dudeja, Rajat wrote: Hi, I'm new to Python. I only have read Byte

Re: Manipulating Python Source

2008-08-12 Thread Patrol Sun
This idea recalls Spring's Bean binding to me. Good idea. Is there similar thing? 2008/8/12 Wilson [EMAIL PROTECTED] Hi, I'm wondering if there are any tools available or simple methods for taking a python source file and parsing into some hierarchical format, like the ConfigParser. I'd

Re: Looking out a module for Subversion

2008-08-12 Thread Patrol Sun
Sorry for my wrong information. But the Eclipse is very huge, Ulipad is very small. http://code.google.com/p/ulipad/downloads/list 2008/8/13 Fabio Zadrozny [EMAIL PROTECTED] On Tue, Aug 12, 2008 at 6:50 AM, Patrol Sun [EMAIL PROTECTED] wrote: Eclipse with PyDev extension cannot debug. Ulipad

Re: Logging library unicode problem

2008-08-13 Thread Patrol Sun
What's your system? Simple Chinese Windows??? 2008/8/13 Victor Lin [EMAIL PROTECTED] Hi, I'm writting a application using python standard logging system. I encounter some problem with unicode message passed to logging library. I found that unicode message will be messed up by logging

how many nested for can we utilize?

2008-08-17 Thread Patrol Sun
when I use 20 for ,SystemError: too many statically nested blocks When I use 100 for ,IndentationError: too many levels of indentation How to handle these errors? -- http://mail.python.org/mailman/listinfo/python-list

Re: how many nested for can we utilize?

2008-08-17 Thread Patrol Sun
with SAPIEN Technologies PrimalScript 4.1 # # NAME: Problem 52 # # AUTHOR: patrol , ustc # DATE : 2008-8-7 # # COMMENT: # # URL:http://projecteuler.net/index.php?section=problemsid=52 # Result:142857 #= import sys import string def

Re: how many nested for can we utilize?

2008-08-17 Thread Patrol Sun
I found that the recursive function run very slowly 2008/8/18 Paul Boddie [EMAIL PROTECTED] On 17 Aug, 17:17, Fredrik Lundh [EMAIL PROTECTED] wrote: required reading: The Effects of Moore's Law and Slacking on Large Computations http://arxiv.org/abs/astro-ph/9912202 Or maybe

Re: how many nested for can we utilize?

2008-08-17 Thread Patrol Sun
Yes, I can solve the problem by recursive function. I guess Function Call consume more resources than nested For. So I use the nested For by using exec function. 2008/8/18 Paul Boddie [EMAIL PROTECTED] On 17 Aug, 19:36, Fredrik Lundh [EMAIL PROTECTED] wrote: and functions will solve the

Re: how many nested for can we utilize?

2008-08-17 Thread Patrol Sun
I use the exec function. my code's levels are less than 3. BTW,Linus Torvalds is NOT always right. 2008/8/18 Roel Schroeven [EMAIL PROTECTED] Nick Dumas schreef: A good quote I read (I can't remember who it was from, though) is If you need more than three levels of indentation, then

Re: how many nested for can we utilize?

2008-08-18 Thread Patrol Sun
I test the exec function. As we all know, we can set the recursive levels. How to handle it? 2008/8/17 Fredrik Lundh [EMAIL PROTECTED] Patrol Sun wrote: when I use 20 for ,SystemError: too many statically nested blocks When I use 100 for ,IndentationError: too many levels of indentation

Re: how many nested for can we utilize?

2008-08-18 Thread Patrol Sun
Thanks, I cannot utilize the String Class completely. I'm a newbie for python 2008/8/18 Gabriel Genellina [EMAIL PROTECTED] En Sun, 17 Aug 2008 21:57:46 -0300, Patrol Sun [EMAIL PROTECTED] escribió: Of course We needn't 100 levels,but I use the exec function can concise the code. See

Re: extending dictonary

2009-12-11 Thread InvisibleRoads Patrol
On Sat, 21 Nov 2009 09:25:38 +0100, nospam knutjbj(nospam)@online.no wrote: Is there any way to extend the dictonary in such manner that I can insert muliplay value to each keys and return one of the value as the default value. I would like to have similar syste that I drawed out below.

Re: extending dictonary

2009-12-11 Thread InvisibleRoads Patrol
On Sat, 21 Nov 2009 09:25:38 +0100, nospam knutjbj(nospam)@online.no wrote: Is there any way to extend the dictonary in such manner that I can insert muliplay value to each keys and return one of the value as the default value. I would like to have similar syste that I drawed out below.

Re: Zlib: correct checksum but error decompressing

2009-08-26 Thread InvisibleRoads Patrol
On Wed, 26 Aug 2009 07:19:42 -0700 (PDT), Andre andre.co...@gmail.com wrote: I have been trying to solve this issue for a while now. I receive data from a TCP connection which is compressed. I know the correct checksum for the data and both the client and server generate the same checksum.