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 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. However, in Python wh

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 us

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

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

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

Re: how many nested for can we utilize?

2008-08-17 Thread Patrol Sun
g/mailman/listinfo/python-list > #===== # # Python Source File -- Created with SAPIEN Technologies PrimalScript 4.1 # # NAME: Problem 52 # # AUTHOR: patrol

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

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

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

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 h

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 an

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

Re: About wmi

2008-07-16 Thread patrol
e(128) -- yup,error_info contains the Chinese encoded string. All of the Simple Chinese Windows 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月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 > > > --

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 > > c = wmi.WMI ("non-exi

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 tes

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

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_erro

Re: About wmi

2008-07-14 Thread patrol
Hi, > 1) I'm not sure if WMI can be forced to close down system processes, > but if it can it's probably by means of specifying one or more > privileges when you connect. Try looking in the WMI newsgroups > for a more general (non-Python) answer to this and I'll happily > explain how to apply it in

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.

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

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 "C:\Pytho