Command-Line Code Dojo this month, Jabber/XMPP next month in Toronto

2010-03-10 Thread Mike C. Fletcher
We'll be having our regular Greater Toronto Area Python User's Group (PyGTA) meeting this month and next. * Command-Line Apps (Code Dojo) -- Tues, March 16th, 7pm o Want to create utilities that do one thing well in the Unix philosophy? o We'll be exploring

Re: pyserial script doesnt execute properly

2010-03-10 Thread Gabriel Genellina
En Tue, 09 Mar 2010 12:01:22 -0300, kishore kishorei...@gmail.com escribió: Iam using python 2.5.4 pyserial 2.4 pywin32-214 on windows 7 i hav a small test script written to query a serial device (arduino) and get back reply appropriately Thanks for your response i tried closing idle

Re: pyserial script doesnt execute properly

2010-03-10 Thread kishore
On Mar 10, 1:07 pm, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Tue, 09 Mar 2010 12:01:22 -0300, kishore kishorei...@gmail.com escribió: Iam using python 2.5.4 pyserial  2.4 pywin32-214 on windows 7 i hav a small test script written to query a serial device (arduino)

about Telnetlib problem

2010-03-10 Thread JEHERUL
Dear All I am trying to telnet to a Cisco router . Following is my code . #code router.py import getpass import sys import telnetlib HOST = router address # router address is ommitted for security reason user = raw_input(Username : ) password = getpass.getpass() tn =

Re: odd error

2010-03-10 Thread Steven D'Aprano
On Tue, 09 Mar 2010 11:48:10 -0500, Alex Hall wrote: Okay, I changed the keycode from 99 (c) to 107 (k), and the errors have disappeared. However, now the function that should be called is not. As I said in a previous message, I have always had trouble with this sort of keystroke dictionary.

Re: odd error

2010-03-10 Thread Tim Golden
On 10/03/2010 09:16, Steven D'Aprano wrote: Perhaps all you need is a single dict, mapping characters to functions: funcs = { # Just a dict # keycode: function 'q': exitProgram, 'a': arm.sayLoad1 # etc. } Then whenever you get a keyboard event, convert it to the

Re: Knight's tour Warndorff's algorithm problem

2010-03-10 Thread Robin Rytich
On Wed, 2010-03-10 at 02:37 -0300, Gabriel Genellina wrote: Warnsdorff's algorithm is heuristic; it works most of the time, but in some cases leads to a dead end and you have to backtrack and try another alternative. The starting square is important; if you start at 1,1 (instead of 0,0)

Re: odd error

2010-03-10 Thread Alex Hall
I am honestly a bit lost as to why keys.append() is not a good choice here, but I have it working. I apparently have to use the ascii for capital letters if I am capturing the shift modifier, not the lowercase ascii. Using 67 instead of 99 works as expected. I use append because the program has

Re: odd error

2010-03-10 Thread Tim Golden
On 10/03/2010 12:09, Alex Hall wrote: I am honestly a bit lost as to why keys.append() is not a good choice here, but I have it working. That's ok; it's just not clear from the context why you have a list of dicts but your comment about different modes explains that. I apparently have to use

Importing Modules

2010-03-10 Thread PEYMAN ASKARI
Hello I frequent the PyGtk mailing list all the time, but this is the first time I am posting here =) I wanted to know if imported classes are treated differently than internal classes. I have attached a minimal example which points out what I mean. Essentially, if I create a class: class

Re: Import problem

2010-03-10 Thread Jean-Michel Pichavant
News123 wrote: Jean-Michel Pichavant wrote: Johny wrote: I have this directory structure C: \A __init__.py amodule.py \B __init__.py bmodule.py \D __init__.py dmodule.py and I want to import

Interacting With Another Script

2010-03-10 Thread Victor Subervi
Hi; There's a program (vpopmail) that has commands which, when called, request input (email address, password, etc.) from the command line. I would like to build a TTW interface for my clients to use that interacts with these commands. It's easy enough for me to get the information from a script,

Can't define __call__ within __init__?

2010-03-10 Thread Neal Becker
Want to switch __call__ behavior. Why doesn't this work? What is the correct way to write this? class X (object): def __init__(self, i): if i == 0: def __call__ (self): return 0 else: def __call_ (self): return 1 x =

Re: Named loops for breaking

2010-03-10 Thread Jean-Michel Pichavant
Daniel Klein wrote: Hey, I did a little searching and couldn't really find much recent on this. The only thing I found was this: http://groups.google.com/group/comp.lang.python/browse_thread/thread/a696624c92b91181/5b7479fdc3362b83?lnk=gstq=break+named+loop#5b7479fdc3362b83 Basically I'm

Re: Can't define __call__ within __init__?

2010-03-10 Thread Simon Brunning
On 10 March 2010 13:12, Neal Becker ndbeck...@gmail.com wrote: Want to switch __call__ behavior.  Why doesn't this work?  What is the correct way to write this? class X (object):    def __init__(self, i):        if i == 0:            def __call__ (self):                return 0        

Re: Down casting Python objects

2010-03-10 Thread Andrey Fedorov
On Wed, Mar 10, 2010 at 12:24 AM, Rami Chowdhury rami.chowdh...@gmail.com wrote: Could you tell us *why* you need to down-cast x? Explicit type-casting is usually unnecessary in Python... Sure! It's related to the longer question I unwisely asked during PyCon [1] (when no one had time to read

Re: Can't define __call__ within __init__?

2010-03-10 Thread Mark Lawrence
Neal Becker wrote: Want to switch __call__ behavior. Why doesn't this work? What is the correct way to write this? class X (object): def __init__(self, i): if i == 0: def __call__ (self): return 0 else: def __call_ (self):

Does this already exists?: A module that checks if the used platform is supported

2010-03-10 Thread Martin P. Hellwig
Hi all, Before I start reinventing a squared wheel, I have the following question: Is there already a (standard) module that wraps around the various os/sys information which checks if the platform + version is supported for what I want to do with it. For example I am currently looking at

Re: Can't define __call__ within __init__?

2010-03-10 Thread Matt Nordhoff
Neal Becker wrote: Simon Brunning wrote: On 10 March 2010 13:12, Neal Becker ndbeck...@gmail.com wrote: Want to switch __call__ behavior. Why doesn't this work? What is the correct way to write this? class X (object): def __init__(self, i): if i == 0: def __call__ (self): return 0

Re: pexpect and logging integration

2010-03-10 Thread Jean-Michel Pichavant
Lars Stavholm wrote: Hi all, has anyone managed to integrate pexpect and logging? I.e., I'd like to be able to pick up the dialog, commands sent and responses received, in my logging. I know about the pexpect logfile, and I can log things to stdout or stderr, but I really need to log using the

Re: about Telnetlib problem

2010-03-10 Thread Jean-Michel Pichavant
JEHERUL wrote: Dear All I am trying to telnet to a Cisco router . Following is my code . #code router.py import getpass import sys import telnetlib HOST = router address # router address is ommitted for security reason user = raw_input(Username : ) password =

Re: Knight's tour Warndorff's algorithm problem

2010-03-10 Thread Terry Reedy
On 3/10/2010 12:37 AM, Gabriel Genellina wrote: if (next != 0): (self.y, self.x) = (next.y, next.x) In Python3, next is a builtin function. Choose a different name, at least in public code ;=). -- http://mail.python.org/mailman/listinfo/python-list

os.rename [Errno 31] Too many links

2010-03-10 Thread Richard
I want to atomically write to a file so have been using temporary files and renaming: temp = tempfile.NamedTemporaryFile(delete=False) temp.file.write(data) temp.file.close() os.rename(temp.name, output_file) This worked but after 39567 files os.rename raises an OSError: [Errno 31] Too many

Re: Importing Modules

2010-03-10 Thread Terry Reedy
On 3/10/2010 7:19 AM, PEYMAN ASKARI wrote: Hello I frequent the PyGtk mailing list all the time, but this is the first time I am posting here =) I wanted to know if imported classes are treated differently than internal classes. I have attached a minimal example which points out what I mean.

Re: Method / Functions - What are the differences?

2010-03-10 Thread John Posner
[ cross-posting to edu-sig ] Bruno (and anyone else interested) -- As I promised/threatened, here's the *start* of a write-up on properties, aimed at non-advanced Python programmers: http://www.jjposner.net/media/python-properties-0310.pdf I'm interested in corrections, of course. But I'm

Re: Named loops for breaking

2010-03-10 Thread Daniel Klein
Thanks for the link to the PEP. I should search through PEPs first next time :) Okay, I understand Guido's reasoning and yield the point. I typed up the specific example in which I came across this problem and, while doing so, realized there's a much better way of approaching the problem, so

Anything like Effective Java for Python?

2010-03-10 Thread kj
Subject line pretty much says it all: is there a book like Effective Java for Python. I.e. a book that assumes that readers are experienced programmers that already know the basics of the language, and want to focus on more advanced programming issues? ~K --

Re: Anything like Effective Java for Python?

2010-03-10 Thread Simon Brunning
On 10 March 2010 15:19, kj no.em...@please.post wrote: Subject line pretty much says it all: is there a book like Effective Java for Python.  I.e. a book that assumes that readers are experienced programmers that already know the basics of the language, and want to focus on more advanced

Re: [Edu-sig] Method / Functions - What are the differences?

2010-03-10 Thread Edward Cherlin
On Wed, Mar 10, 2010 at 09:45, John Posner jjpos...@optimum.net wrote: [ cross-posting to edu-sig ] Bruno (and anyone else interested) -- As I promised/threatened, here's the *start* of a write-up on properties, aimed at non-advanced Python programmers:  

Re: Bluetooth

2010-03-10 Thread Jeff Peck
On 3/7/2010 1:26 PM, PythonAB wrote: Hello, I'm writing a script that has to connect a bluetooth device with a 3D application. On my search for a bluetooth module i ran into this: http://www.python.org/download/releases/2.4/notes/ where it says: The socket module now supports Bluetooth

I passed a fizzbuzz test but failed at recursion.

2010-03-10 Thread Bill
Look at this recursive fizzbuzz function from http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html def fizzbuzz(num): if num: if num % 15 is 0: return fizzbuzz(num-1) + 'fizzbuzz \n' elif num % 5 is 0: return fizzbuzz(num-1) + 'buzz \n' elif num %

Re: os.rename [Errno 31] Too many links

2010-03-10 Thread Thomas Guettler
Richard wrote: I want to atomically write to a file so have been using temporary files and renaming: temp = tempfile.NamedTemporaryFile(delete=False) temp.file.write(data) temp.file.close() os.rename(temp.name, output_file) This worked but after 39567 files os.rename raises an OSError:

Re: I passed a fizzbuzz test but failed at recursion.

2010-03-10 Thread Chris Hulan
On Mar 10, 10:55 am, Bill bsag...@gmail.com wrote: Look at this recursive fizzbuzz function fromhttp://www.codinghorror.com/blog/2007/02/why-cant-programmers-program... def fizzbuzz(num):     if num:         if num % 15 is 0: return fizzbuzz(num-1) + 'fizzbuzz \n'         elif num % 5 is

Re: Interacting With Another Script

2010-03-10 Thread Chris Rebert
On Wed, Mar 10, 2010 at 4:32 AM, Victor Subervi victorsube...@gmail.com wrote: Hi; There's a program (vpopmail) that has commands which, when called, request input (email address, password, etc.) from the command line. I would like to build a TTW interface for my clients to use that interacts

Re: Interacting With Another Script

2010-03-10 Thread Chris Rebert
On Wed, Mar 10, 2010 at 8:34 AM, Victor Subervi victorsube...@gmail.com wrote: On Wed, Mar 10, 2010 at 12:31 PM, Chris Rebert c...@rebertia.com wrote: Option C. The most user-friendly, and in some sense simplest, one. Figure out the conversation tree vpopmail follows. Create a matching form

Re: Anything like Effective Java for Python?

2010-03-10 Thread Chris Withers
kj wrote: Subject line pretty much says it all: is there a book like Effective Java oxymoronic, no? Sorry, couldn't resist ;-) Chris -- Simplistix - Content Management, Batch Processing Python Consulting - http://www.simplistix.co.uk --

Re: Scalable python dict {'key_is_a_string': [count, some_val]}

2010-03-10 Thread Krishna K
On Fri, Feb 19, 2010 at 11:27 PM, Jonathan Gardner jgard...@jonathangardner.net wrote: On Fri, Feb 19, 2010 at 10:36 PM, krishna krishna.k.0...@gmail.com wrote: I have to manage a couple of dicts with huge dataset (larger than feasible with the memory on my system), it basically has a key

Re: Interacting With Another Script

2010-03-10 Thread Grant Edwards
On 2010-03-10, Chris Rebert c...@rebertia.com wrote: On Wed, Mar 10, 2010 at 8:34 AM, Victor Subervi victorsube...@gmail.com wrote: Yeah, that was my idea. But how does the program know when it's being prompted to enter data? That's my question ;) There's no magical prompt time. That

Re: equivalent of Ruby's Pathname?

2010-03-10 Thread Phlip
Martin P. Hellwig wrote: Well even if this statement would be true, I personally think that not proclaiming something a 'standard' if you are sure that you are not sure about it, is a virtue. In terms of trying too hard to achieve perfection, am I missing a Python repository similar to the

Re: equivalent of Ruby's Pathname?

2010-03-10 Thread Chris Rebert
On Wed, Mar 10, 2010 at 8:54 AM, Phlip phlip2...@gmail.com wrote: Martin P. Hellwig wrote: Well even if this statement would be true, I personally think that not proclaiming something a 'standard' if you are sure that you are not sure about it, is a virtue. In terms of trying too hard to

Re: NoSQL Movement?

2010-03-10 Thread Duncan Booth
Xah Lee xah...@gmail.com wrote: On Mar 8, 11:14 am, Duncan Booth duncan.bo...@invalid.invalid wrote: Xah Lee xah...@gmail.com wrote: For example, consider, if you are within world's top 100th user of database in terms of database size, such as Google, then it may be that the

Re: Can't define __call__ within __init__?

2010-03-10 Thread Duncan Booth
Neal Becker ndbeck...@gmail.com wrote: What I'm trying to do is make a callable whose behavior is switched based on some criteria that will be fixed for all calls. In my example, this will ultimately be determined by the setting of a command line switch. If you want different behaviour

Re: Calculating very large exponents in python

2010-03-10 Thread Mark Dickinson
On Mar 9, 6:39 am, casevh cas...@gmail.com wrote: [also replying to Geremy since the OP's message doesn't appear...] On Mar 8, 11:05 am, geremy condra debat...@gmail.com wrote: On Mon, Mar 8, 2010 at 2:15 AM, Fahad Ahmad miracles...@hotmail.com wrote: Thanks Geremy, That has been

Python 2.6.5 release candidate 2 now available

2010-03-10 Thread Barry Warsaw
Hi everyone, The source tarballs and Windows installer for Python 2.6.5 release candidate 2 are now available: http://www.python.org/download/releases/2.6.5/ As usual, please download, install, and test them with your favorite projects and environments. A number of regressions and build

Re: I passed a fizzbuzz test but failed at recursion.

2010-03-10 Thread Terry Reedy
On 3/10/2010 10:55 AM, Bill wrote: Look at this recursive fizzbuzz function from http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html def fizzbuzz(num): if num: if num % 15 is 0: return fizzbuzz(num-1) + 'fizzbuzz \n' elif num % 5 is 0: return

Re: Calculating very large exponents in python

2010-03-10 Thread Mark Dickinson
On Mar 9, 1:54 pm, casevh cas...@gmail.com wrote: After a few hours, the remaining factors are 6060517860310398033985611921721 and 9941808367425935774306988776021629111399536914790551022447994642391 casevh Whoops---I missed this. I'm too slow! But at least my answers agree with yours.

Re: Can't define __call__ within __init__?

2010-03-10 Thread Neal Becker
Duncan Booth wrote: ... P.S. I don't know what you did in your post but your Followup-To header is pointing to a group on gmane which makes extra work for me replying. Please don't do that. I'm sorry about that, there is some bad interaction between gmane's nntp- smtp gateway and python's

Re: Can't define __call__ within __init__?

2010-03-10 Thread Duncan Booth
Neal Becker ndbeck...@gmail.com wrote: Duncan Booth wrote: ... P.S. I don't know what you did in your post but your Followup-To header is pointing to a group on gmane which makes extra work for me replying. Please don't do that. I'm sorry about that, there is some bad interaction

Re: Scalable python dict {'key_is_a_string': [count, some_val]}

2010-03-10 Thread geremy condra
On Wed, Mar 10, 2010 at 11:47 AM, Krishna K krishna.k.0...@gmail.com wrote: On Fri, Feb 19, 2010 at 11:27 PM, Jonathan Gardner jgard...@jonathangardner.net wrote: On Fri, Feb 19, 2010 at 10:36 PM, krishna krishna.k.0...@gmail.com wrote: I have to manage a couple of dicts with huge dataset

Text mining in Python

2010-03-10 Thread mk
Hello everyone, I need to do the following: (0. transform words in a document into word roots) 1. analyze a set of documents to see which words are highly frequent 2. detect clusters of those highly frequent words 3. map the clusters to some special keywords 4. rank the documents on

Re: Text mining in Python

2010-03-10 Thread Robert Kern
On 2010-03-10 12:58 PM, mk wrote: Hello everyone, I need to do the following: (0. transform words in a document into word roots) 1. analyze a set of documents to see which words are highly frequent 2. detect clusters of those highly frequent words 3. map the clusters to some special

Re: Down casting Python objects

2010-03-10 Thread Steve Holden
Andrey Fedorov wrote: On Wed, Mar 10, 2010 at 12:24 AM, Rami Chowdhury rami.chowdh...@gmail.com mailto:rami.chowdh...@gmail.com wrote: Could you tell us *why* you need to down-cast x? Explicit type-casting is usually unnecessary in Python... Sure! It's related to the longer

Re: Text mining in Python

2010-03-10 Thread Jason Tackaberry
On Wed, 2010-03-10 at 19:58 +0100, mk wrote: I need to do the following: [...] Is there some good open source engine out there that would be suitable to the task at hand? Anybody has experience with them? It sounds like a full text search engine might do a bit more than you need, but based on

Re: Can't define __call__ within __init__?

2010-03-10 Thread Neal Becker
Duncan Booth wrote: Neal Becker ndbeck...@gmail.com wrote: Duncan Booth wrote: ... P.S. I don't know what you did in your post but your Followup-To header is pointing to a group on gmane which makes extra work for me replying. Please don't do that. I'm sorry about that, there is some

Re: file seek is slow

2010-03-10 Thread Metalone
f1_seek = f1.seek did not change the performance at all. As it turns out each call is only 646 nanoseconds slower than 'C'. However, that is still 80% of the time to perform a file seek, which I would think is a relatively slow operation compared to just making a system call. --

Re: file seek is slow

2010-03-10 Thread Metalone
Thanks, Tim. Good to know. -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't define __call__ within __init__?

2010-03-10 Thread Robert Kern
On 2010-03-10 13:42 PM, Neal Becker wrote: Duncan Booth wrote: Neal Beckerndbeck...@gmail.com wrote: Duncan Booth wrote: ... P.S. I don't know what you did in your post but your Followup-To header is pointing to a group on gmane which makes extra work for me replying. Please don't do

Re: Can't define __call__ within __init__?

2010-03-10 Thread Robert Kern
On 2010-03-10 12:23 PM, Neal Becker wrote: Duncan Booth wrote: ... P.S. I don't know what you did in your post but your Followup-To header is pointing to a group on gmane which makes extra work for me replying. Please don't do that. I'm sorry about that, there is some bad interaction between

Can't install ssl for Python2.5

2010-03-10 Thread Lacrima
Hello! I use Ubuntu 9.10 Karmic Koala. It has Python 2.6 as default installation. And I installed Python 2.5 alongside (for the need of Google AppEngine). But it seems like my Python 2.5 installation lacks ssl support. I can't import ssl and starting appengine server fails with 'module' object

logging: local functions == loss of lineno

2010-03-10 Thread Hellmut Weber
Hi Vinay Sajip, I'm very glad discoverd your logging module ;-) (That's what I would have liked 25 years ago when I was working as a technical software developper!) Now I'm writing just some personal tools, I like python and want to use logging on a regular basis. Logging works very well

Re: Can't install ssl for Python2.5

2010-03-10 Thread Martin v. Loewis
I don't know how to solve this problem and I am looking forward for help. Try running python setup.py install directly, after downloading and unpacking the package. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Knight's tour Warndorff's algorithm problem

2010-03-10 Thread Lawrence D'Oliveiro
In message mailman.527.1268199449.23598.python-l...@python.org, Gabriel Genellina wrote: Warnsdorff's algorithm is heuristic ... Then it shouldn’t be called an “algorithm”. -- http://mail.python.org/mailman/listinfo/python-list

Ideas for creating processes

2010-03-10 Thread J
I'm working on a project and thought I'd ask for a suggestion on how to proceed (I've got my own ideas, but I wanted to see if I was on the right track) For now, I've got this: def main(): ## get our list of directories to refresh releases=sys.argv[1:] if len(releases) 1: print

Re: Named loops for breaking

2010-03-10 Thread James Harris
On 10 Mar, 06:29, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Tue, 09 Mar 2010 18:41:10 -0300, Daniel Klein bri...@gmail.com   escribi : Basically I'm wondering if there are any plans to implemented named loops in Python, so I can tell a break command to break out of a specific

Re: Draft PEP on RSON configuration file format

2010-03-10 Thread Lawrence D'Oliveiro
In message 4b8b5cef$0$1625$742ec...@news.sonic.net, John Nagle wrote: Patrick Maupin wrote: Finding .ini configuration files too limiting, JSON and XML to hard to manually edit, and YAML too complex to parse quickly, I have started work on a new configuration file parser. You're not

Re: Passing FILE * types using ctypes

2010-03-10 Thread Lawrence D'Oliveiro
In message 7vbrvefeg...@mid.individual.net, Gregory Ewing wrote: If you need the same FILE * that Python is using, you may need to use ctypes to extract it out of the file object. Why would Python be using a FILE *? -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing FILE * types using ctypes

2010-03-10 Thread Lawrence D'Oliveiro
In message a83319d7-c199-4532-9816- d002f7fd7...@q16g2000yqq.googlegroups.com, Zeeshan Quireshi wrote: Hello, I'm using ctypes to wrap a library i wrote. I am trying to pass it a FILE *pointer ... Another option is to fix your library not to use stdio directly. --

show image in python

2010-03-10 Thread mohamed issolah
Hey, This is my program 1 #!/usr/bin/python 2 import PIL 3 import numpy 4 import Image 5 import ImageOps 6 import sys 7 8 def Matimg(path): 9 transforme image en matrice 10 Img = Image.open(str(path)) 11 Img1 = ImageOps.grayscale(Img) 12

Re: Ideas for creating processes

2010-03-10 Thread J
On Wed, Mar 10, 2010 at 16:52, J dreadpiratej...@gmail.com wrote: the quick and dirty would be (as I'm imagining it at the moment): for path in pathlist:    chdir into path    execute rsync or zsync but that gets me moving into one dir, updating, then moving into another. What I was

Re: Knight's tour Warndorff's algorithm problem

2010-03-10 Thread Robert Kern
On 2010-03-10 15:49 PM, Lawrence D'Oliveiro wrote: In messagemailman.527.1268199449.23598.python-l...@python.org, Gabriel Genellina wrote: Warnsdorff's algorithm is heuristic ... Then it shouldn’t be called an “algorithm”. There are lots of algorithms that use heuristics or are heuristics.

Re: Knight's tour Warndorff's algorithm problem

2010-03-10 Thread Grant Edwards
On 2010-03-10, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message mailman.527.1268199449.23598.python-l...@python.org, Gabriel Genellina wrote: Warnsdorff's algorithm is heuristic ... Then it shouldn???t be called an ???algorithm???. Why? An algorithm is just a

Re: Passing FILE * types using ctypes

2010-03-10 Thread Robert Kern
On 2010-03-10 15:57 PM, Lawrence D'Oliveiro wrote: In message7vbrvefeg...@mid.individual.net, Gregory Ewing wrote: If you need the same FILE * that Python is using, you may need to use ctypes to extract it out of the file object. Why would Python be using a FILE *? In Python 2.x, Python's

Re: NoSQL Movement?

2010-03-10 Thread Xah Lee
On Mar 10, 9:26 am, Duncan Booth duncan.bo...@invalid.invalid wrote: No, I'm saying that if you plan to build a business that could grow you should be clear up front how you plan to handle the growth. It's too late if you suddenly discover your platform isn't scalable just when you need to

Re: Named loops for breaking

2010-03-10 Thread Alf P. Steinbach
* James Harris: On 10 Mar, 06:29, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Tue, 09 Mar 2010 18:41:10 -0300, Daniel Klein bri...@gmail.com escribi : Basically I'm wondering if there are any plans to implemented named loops in Python, so I can tell a break command to break out of a

Re: Ideas for creating processes

2010-03-10 Thread Martin P. Hellwig
On 03/10/10 21:52, J wrote: I'm working on a project and thought I'd ask for a suggestion on how to proceed (I've got my own ideas, but I wanted to see if I was on the right track) cut subprocess idea Well I can't speak with authority but I would go into similar lines, especially since you

Re: Ideas for creating processes

2010-03-10 Thread MRAB
J wrote: I'm working on a project and thought I'd ask for a suggestion on how to proceed (I've got my own ideas, but I wanted to see if I was on the right track) For now, I've got this: def main(): ## get our list of directories to refresh releases=sys.argv[1:] if len(releases) 1:

Re: file seek is slow

2010-03-10 Thread Neil Hodgson
Metalone: As it turns out each call is only 646 nanoseconds slower than 'C'. However, that is still 80% of the time to perform a file seek, which I would think is a relatively slow operation compared to just making a system call. A seek may not be doing much beyond setting a current

Python Script to get Info from Site not working

2010-03-10 Thread Jimbo
Hello I am asking what is probably a very easy thing to do but I cannot find a tutorial on how to do it anywhere. [b]I want to use a Python script to get information from a webpage. [/b] I found a semi Python internet tutorial here if anyone else would like it

Re: Import problem

2010-03-10 Thread News123
Hi JM, Jean-Michel Pichavant wrote: News123 wrote: Jean-Michel Pichavant wrote: Johny wrote: I have this directory structure C: \A __init__.py amodule.py \B __init__.py bmodule.py \D __init__.py

Re: Import problem

2010-03-10 Thread News123
Hi JM, Jean-Michel Pichavant wrote: News123 wrote: Jean-Michel Pichavant wrote: Johny wrote: I have this directory structure C: \A __init__.py amodule.py \B __init__.py bmodule.py \D __init__.py

Re: file seek is slow

2010-03-10 Thread sjdevn...@yahoo.com
On Mar 10, 6:01 pm, Neil Hodgson nyamatongwe+thun...@gmail.com wrote: Metalone: As it turns out each call is only 646 nanoseconds slower than 'C'. However, that is still 80% of the time to perform a file seek, which I would think is a relatively slow operation compared to just making a

Re: Can't define __call__ within __init__?

2010-03-10 Thread Neal Becker
Robert Kern wrote: On 2010-03-10 12:23 PM, Neal Becker wrote: Duncan Booth wrote: ... P.S. I don't know what you did in your post but your Followup-To header is pointing to a group on gmane which makes extra work for me replying. Please don't do that. I'm sorry about that, there is some

Elementtree install problem in Ubuntu (a newbie ..)

2010-03-10 Thread robert somerville
Hi ; I installed the elementtree and celementree packages throught the synaptic package manager, all seems to go fine through the install ... when i startup python and try to import them (as per the EFFBOTT.org suggestions) .. PROBLEMS ... (see below ..) What am i doing wrong ??? this is a new

Re: Elementtree install problem in Ubuntu (a newbie ..)

2010-03-10 Thread Philip Semanchuk
On Mar 10, 2010, at 6:48 PM, robert somerville wrote: Hi ; I installed the elementtree and celementree packages throught the synaptic package manager, all seems to go fine through the install ... when i startup python and try to import them (as per the EFFBOTT.org suggestions) .. PROBLEMS

Can't install PIL on MacOS X Leopard

2010-03-10 Thread phantasm
Hello! I'm trying to install PIL module on MacOS X Leopard with python 2.6. Everything seemed to be fine - now I have PIL egg package in site- packages directory, but when I'm trying import PIL, I get an error ImportError: No module named PIL. All other modules such as SQL Alchemy work fine.

Python 2.6 and modules dbi AND odbc

2010-03-10 Thread robert somerville
hi; i am trying to get some legacy python code (which i no nothing about) working with tries to import dbi and odbc (the import fails ...) it looks like these modules are deprecated ?? if so is there a work around , if not deprecated, what am i doing wrong ?? i see no Ubuntu packages that look

Re: Can't install PIL on MacOS X Leopard

2010-03-10 Thread Ned Deily
In article 94070db2-91f0-47a8-a259-36378aab9...@o3g2000yqb.googlegroups.com, phantasm gene...@gmail.com wrote: I'm trying to install PIL module on MacOS X Leopard with python 2.6. Everything seemed to be fine - now I have PIL egg package in site- packages directory, but when I'm trying import

Re: Can't install PIL on MacOS X Leopard

2010-03-10 Thread phantasm
Thank you for your reply, Ned, but I just tried to install it again and found out that I didn't finally run python setup.py install after building PIL manually. It solved the problem. -- http://mail.python.org/mailman/listinfo/python-list

Re: Does this already exists?: A module that checks if the used platform is supported

2010-03-10 Thread Gabriel Genellina
En Wed, 10 Mar 2010 10:54:27 -0300, Martin P. Hellwig martin.hell...@dcuktec.org escribió: Before I start reinventing a squared wheel, I have the following question: Is there already a (standard) module that wraps around the various os/sys information which checks if the platform + version

Re: Importing Modules

2010-03-10 Thread Gabriel Genellina
En Wed, 10 Mar 2010 09:19:29 -0300, PEYMAN ASKARI paskari...@yahoo.ca escribió: I wanted to know if imported classes are treated differently than internal classes. If by 'internal classes' you mean 'classes defined in the main module', no, they're absolutely the same. class A():

Re: Method / Functions - What are the differences?

2010-03-10 Thread Gabriel Genellina
En Wed, 10 Mar 2010 11:45:38 -0300, John Posner jjpos...@optimum.net escribió: As I promised/threatened, here's the *start* of a write-up on properties, aimed at non-advanced Python programmers: http://www.jjposner.net/media/python-properties-0310.pdf I'd use 'function' instead of

Re: Interacting With Another Script

2010-03-10 Thread Gabriel Genellina
En Wed, 10 Mar 2010 09:32:15 -0300, Victor Subervi victorsube...@gmail.com escribió: There's a program (vpopmail) that has commands which, when called, request input (email address, password, etc.) from the command line. I would like to build a TTW interface for my clients to use that

Re: Python Script to get Info from Site not working

2010-03-10 Thread Gabriel Genellina
En Wed, 10 Mar 2010 20:06:41 -0300, Jimbo nill...@yahoo.com escribió: I found a semi Python internet tutorial here if anyone else would like it http://www.upriss.org.uk/python/session6.html My script is meant to find which radio button is selected tell me that. But it just keeps saying No

Re: Interacting With Another Script

2010-03-10 Thread alex23
Victor Subervi victorsube...@gmail.com wrote: There's a program (vpopmail) that has commands which, when called, request input (email address, password, etc.) from the command line. I would like to build a TTW interface for my clients to use that interacts with these commands. The

Re: Python Script to get Info from Site not working

2010-03-10 Thread Jimbo
On Mar 11, 12:38 pm, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Wed, 10 Mar 2010 20:06:41 -0300, Jimbo nill...@yahoo.com escribió: I found a semi Python internet tutorial here if anyone else would like ithttp://www.upriss.org.uk/python/session6.html My script is meant to find

Re: Ideas for creating processes

2010-03-10 Thread J
On Wed, Mar 10, 2010 at 18:03, MRAB pyt...@mrabarnett.plus.com wrote: Are you sure that you would gain from doing more than one at a time? The bottleneck will probably be the speed of your network connection, and if that's working at its maximum speed with one sync then doing several

Re: Can't define __call__ within __init__?

2010-03-10 Thread Steven D'Aprano
On Wed, 10 Mar 2010 08:12:14 -0500, Neal Becker wrote: Want to switch __call__ behavior. Why doesn't this work? What is the correct way to write this? class X (object): def __init__(self, i): if i == 0: def __call__ (self): return 0

Re: Knight's tour Warndorff's algorithm problem

2010-03-10 Thread Terry Reedy
On 3/10/2010 4:49 PM, Lawrence D'Oliveiro wrote: In messagemailman.527.1268199449.23598.python-l...@python.org, Gabriel Genellina wrote: Warnsdorff's algorithm is heuristic ... Then it shouldn’t be called an “algorithm”. Heuristic algorithms correctly compute some function, just not the

Get a method instance through 'getattr' but not superclass's method

2010-03-10 Thread Radhakrishna Bhat
I am using getattr to get a method instance from a class. But it also returns methods from the superclass. How to detect if an attribute is from superclass? -Radhakrishna -- http://mail.python.org/mailman/listinfo/python-list

Re: a newbie's question

2010-03-10 Thread Lan Qing
hi Cheers, Think you, that helps me a lot. On Tue, Mar 9, 2010 at 10:00 PM, Simon Brunning si...@brunningonline.netwrote: On 9 March 2010 13:51, Lan Qing efi...@gmail.com wrote: Hi all, I'm a newbie of python programming language. Welcome! I have used c/c++ for 5 years,

  1   2   >