Re: Little novice program written in Python

2008-04-25 Thread hellt
Rogério Brito: Hi, All. I'm just getting my feet wet on Python and, just for starters, I'm coding some elementary number theory algorithms (yes, I know that most of them are already implemented as modules, but this is an exercise in learning the language idioms). As you can see from the

Re: Little novice program written in Python

2008-04-25 Thread hellt
also, i would recommend you to visit projecteuler.net you can solve math tasks and then see how others have done the same. you can fetch very good and pythonic solution there. -- http://mail.python.org/mailman/listinfo/python-list

Re: Little novice program written in Python

2008-04-25 Thread hellt
On 25 апр, 13:29, Arnaud Delobelle [EMAIL PROTECTED] wrote: hellt [EMAIL PROTECTED] writes: my variant of the sieve Since you posted it, you are also looking for advice to improve your code ;) def GetPrimes(N): arr = [] for i in range(1,N+1): arr.append(i

Re: Little novice program written in Python

2008-04-25 Thread hellt
On 25 апр, 15:02, Max M [EMAIL PROTECTED] wrote: Rogério Brito skrev: Hi, All. What I would like is to receive some criticism to my code to make it more Python'esque and, possibly, use the resources of the computer in a more efficient way (the algorithm implemented below is the Sieve of

Re: Can you recommend a book?

2008-04-25 Thread hellt
On 25 апр, 15:09, Malcolm Greene [EMAIL PROTECTED] wrote: My two favorites: - Core Python Programming by Chun - Learning Python by Lutz Malcolm Learning Python (Lutz) is very good, reading right now. -- http://mail.python.org/mailman/listinfo/python-list

winreg module, need help to understand why i'm getting exception

2008-04-19 Thread hellt
HI all, i found winreg module from http://www.rutherfurd.net/python/winreg/index.html very useful and simple, instead _winreg. But i have a problem with this module, in its iterable part. look at the following code key = Key(HKLM,rSYSTEM\CurrentControlSet\Services\Tcpip\Enum) for i in

Re: Filtering a Python list to uniques

2008-03-26 Thread hellt
On 26 мар, 02:30, kellygreer1 [EMAIL PROTECTED] wrote: What is the best way to filter a Python list to its unique members? I tried some method using Set but got some unhashable error. lstone = [ 1, 2, 3, 3, 4, 5, 5, 6 ] # how do i reduce this to lsttwo = [ 1, 2, 3, 4, 5, 6 ] Is there a

Need help with OptionParser

2008-03-25 Thread hellt
today i've decided to use optionparser instead of GetOpt and unfortunately i've got an error which i cant handle my pice of code: from optparse import OptionParser def main(): usage = usage: %prog [options] parser = OptionParser(usage) parser.add_option(-f, --file, dest=filename,

Re: Need help with OptionParser

2008-03-25 Thread hellt
On 25 мар, 15:42, hellt [EMAIL PROTECTED] wrote: today i've decided to use optionparser instead of GetOpt and unfortunately i've got an error which i cant handle my pice of code: from optparse import OptionParser def main(): usage = usage: %prog [options] parser = OptionParser

Strange behavior of the Eclipse embedded console

2008-03-20 Thread hellt
i've faced with some strangeness while executing this sample: choice = raw_input(your choice: ) print len(choice) when i run this sample in my eclipse console with CPython and print Yes, i have this output 4 #trailing \t is the fourth element but when i use command line method python sample.py

Re: Strange behavior of the Eclipse embedded console

2008-03-20 Thread hellt
On 20 мар, 14:31, hellt [EMAIL PROTECTED] wrote: i've faced with some strangeness while executing this sample: choice = raw_input(your choice: ) print len(choice) when i run this sample in my eclipse console with CPython and print Yes, i have this output 4 #trailing \t is the fourth

Re: About reading Python code

2008-03-18 Thread hellt
On 18 мар, 03:57, sturlamolden [EMAIL PROTECTED] wrote: On 17 Mar, 04:54, WaterWalk [EMAIL PROTECTED] wrote: So I'm curious how to read code effectively. I agree that python code is clear, but when it becomes long, reading it can still be a hard work. First, I recommend that you write

py2exe + pywinauto + sendkeys issue

2008-03-17 Thread hellt
Hi all i have a problem with this modules py2exe + pywinauto + sendkeys used together. In my script i'm using this expression app.window_(title=SJphone).Edit.TypeKeys(Test is running,with_spaces=True) TypeKeys is using SendKeys module i suppose. my setup.py looks like that: from distutils.core

Re: py2exe + pywinauto + sendkeys issue

2008-03-17 Thread hellt
On 17 мар, 15:48, Gabriel Genellina [EMAIL PROTECTED] wrote: En Mon, 17 Mar 2008 08:56:26 -0200, hellt [EMAIL PROTECTED] escribi�: i have a problem with this modules py2exe + pywinauto + sendkeys used together. In my script i'm using this expression app.window_(title=SJphone

Re: py2exe + pywinauto + sendkeys issue

2008-03-17 Thread hellt
On 17 мар, 15:48, Gabriel Genellina [EMAIL PROTECTED] wrote: En Mon, 17 Mar 2008 08:56:26 -0200, hellt [EMAIL PROTECTED] escribi�: i have a problem with this modules py2exe + pywinauto + sendkeys used together. In my script i'm using this expression app.window_(title=SJphone

Re: py2exe + pywinauto + sendkeys issue

2008-03-17 Thread hellt
On 17 мар, 20:22, hellt [EMAIL PROTECTED] wrote: On 17 мар, 15:48, Gabriel Genellina [EMAIL PROTECTED] wrote: En Mon, 17 Mar 2008 08:56:26 -0200, hellt [EMAIL PROTECTED] escribi�: i have a problem with this modules py2exe + pywinauto + sendkeys used together. In my script i'm