Re: Morelia for BDD in Python

2011-07-09 Thread Stefan Behnel
Phlip, 10.07.2011 07:10: On Jul 9, 8:38 pm, Ben Finney wrote: Phlip writes: On Jul 9, 7:39 pm, mark curphey wrote: Thanks. FWIW I played with a bunch (Freshen, Morelia, Lettuce) Morelia is "undermaintained" because it's finished. It attaches to any pre-existing TestCase-style test

Re: String concatenation vs. string formatting

2011-07-09 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 How should I go about switching from concatenation to string formatting for this? avs.write(demux_filter + field_filter + fpsin_filter + i2pfilter + dn_filter + fpsout_filter + trim_filter + info_filter) I can think of a few ways, but none of th

Re: String concatenation vs. string formatting

2011-07-09 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.10 12:55 AM, Dennis Lee Bieber wrote: > Maybe it's been removed, but from the help file for my installation help(file) returns a NameError in 3.2. It shows up as a built-in function in the 2.7 docs, but not in the py3k docs. It's not me

Re: Morelia for BDD in Python

2011-07-09 Thread Ben Finney
Phlip writes: > 'sudo pip install morelia' just worked for me, on Ubuntu. The problem with ‘pip’ is that it's a parallel package installation that ignores the available package management system on the OS. That's not a fault of ‘pip’ or Setuptools or PyPI or the rest; but it's a higher maintena

Re: Morelia for BDD in Python (was: CI and BDD with Python)

2011-07-09 Thread Phlip
> -- >  \        “That's the essence of science: Ask an impertinent question, | >   `\            and you're on the way to the pertinent answer.” —Jacob | > _o__)                            Boronowski, _The Ascent of Man_, 1976 | > Ben Finney That nose keeps reminding me of the start of one of the

Re: Morelia for BDD in Python (was: CI and BDD with Python)

2011-07-09 Thread Phlip
On Jul 9, 8:38 pm, Ben Finney wrote: > Phlip writes: > > On Jul 9, 7:39 pm, mark curphey wrote: > > > > Thanks. FWIW I played with a bunch (Freshen, Morelia, Lettuce) > > > Morelia is "undermaintained" because it's finished. It attaches to any > > pre-existing TestCase-style test runner, hen

Re: String concatenation vs. string formatting

2011-07-09 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.09 11:04 PM, Andrew Berg wrote: > > Is barf built-in as well? > That came off more hostile than I wanted, so I'll rephrase it: I doubt it has anything to do with built-ins, since it fails on a variable name that obviously does not re

Re: String concatenation vs. string formatting

2011-07-09 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.09 09:54 PM, Dennis Lee Bieber wrote: > "file" is a built-in (related to "open"). Also: > Traceback (most recent call last): File > "C:\Users\Bahamut\workspace\Disillusion\disillusion.py", line 178, in > save_preset() File > "C:\Users\

Morelia for BDD in Python (was: CI and BDD with Python)

2011-07-09 Thread Ben Finney
Phlip writes: > On Jul 9, 7:39 pm, mark curphey wrote: > > > Thanks. FWIW I played with a bunch (Freshen, Morelia, Lettuce) > > Morelia is "undermaintained" because it's finished. It attaches to any > pre-existing TestCase-style test runner, hence there's nothing to > maintain! It looks goo

Re: How can I make a program automatically run once per day?

2011-07-09 Thread Benjamin Kaplan
On Sat, Jul 9, 2011 at 6:58 PM, Cameron Simpson wrote: > On 10Jul2011 03:00, Alexander Kapps wrote: > | On 10.07.2011 02:26, John Salerno wrote: > | >I have a script that does some stuff that I want to run every day for > | >maybe a week, or a month. So far I've been good about running it every

Re: String concatenation vs. string formatting

2011-07-09 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.09 09:54 PM, Dennis Lee Bieber wrote: > "file" is a built-in (related to "open"). It is? What is it? >>> type(file) Traceback (most recent call last): File "", line 1, in NameError: name 'file' is not defined I don't see it in

Re: CI and BDD with Python

2011-07-09 Thread Phlip
On Jul 9, 7:39 pm, mark curphey wrote: > Thanks. FWIW I played with a bunch (Freshen, Morelia, Lettuce) Morelia is "undermaintained" because it's finished. It attaches to any pre-existing TestCase-style test runner, hence there's nothing to maintain! Packages like Lettuce rebuild the entire

Re: What makes functions special?

2011-07-09 Thread Carl Banks
On Saturday, July 9, 2011 2:28:58 PM UTC-7, Eric Snow wrote: > A tracker issue [1] recently got me thinking about what makes > functions special. The discussion there was regarding the distinction > between compile time (generation of .pyc files for modules and > execution of code blocks), [functi

Re: Newbie help - Programming the Semantic Web with Python

2011-07-09 Thread Andrew Berg
On 2011.07.09 08:32 PM, Bruce Whealton wrote: > Hello, > So, I got this book on Programming the Semantic Web about > the same time I started learning Python. The code seems to be > developed for python 2.7 and not 3, I believe. If you're going to learn Python 3, I suggest learning from

Re: CI and BDD with Python

2011-07-09 Thread mark curphey
Thanks. FWIW I played with a bunch (Freshen, Morelia, Lettuce) over the last few days and Lettuce appears to be the most "actively" maintained and closest to a cucumber-like implementation IMHO. I have decided to adopt it for now. I played with a few CI servers but Jenkins (Hudson) is tough

Re: What makes functions special?

2011-07-09 Thread Eric Snow
On Sat, Jul 9, 2011 at 7:34 PM, Steven D'Aprano wrote: > Eric Snow wrote: > >> Mostly I am just >> trying to put together more pieces of the Python puzzle.  In this case >> I was trying to find out if the optimized execution of code objects >> for functions is a part of the language or just an imp

Re: CI and BDD with Python

2011-07-09 Thread Phlip
On Jul 8, 9:36 pm, Stefan Behnel wrote: > mark curphey, 09.07.2011 01:41: > > > And for CI having been using Hudson for a while, any real advantages in a > > Python / Django world for adopting something native like Trac and one of > > the CI plugins like Bitten? I'm kind'a partial to Morelia fo

Re: Newbie help - Programming the Semantic Web with Python

2011-07-09 Thread Chris Angelico
On Sun, Jul 10, 2011 at 11:32 AM, Bruce Whealton wrote: problem with is this line: >     def add(self, (sub, pred, obj)): > I think the problem is with the parentheses before the sub.  I removed those > and that seemed to fix that error or make it go away.  I don’t remember how I > figured that

Re: How can I make a program automatically run once per day?

2011-07-09 Thread John Salerno
Thanks everyone! I probably should have said something like "Python, if possible and efficient, otherwise any other method" ! :) I'll look into the Task Scheduler. Thanks again! -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I make a program automatically run once per day?

2011-07-09 Thread Cameron Simpson
On 10Jul2011 03:00, Alexander Kapps wrote: | On 10.07.2011 02:26, John Salerno wrote: | >I have a script that does some stuff that I want to run every day for | >maybe a week, or a month. So far I've been good about running it every | >night, but is there some way (using Python, of course) that I

Newbie help - Programming the Semantic Web with Python

2011-07-09 Thread Bruce Whealton
Hello, So, I got this book on Programming the Semantic Web about the same time I started learning Python. The code seems to be developed for python 2.7 and not 3, I believe. The code is here: http://semprog.com/content/the-book/ I tried to run simpletriple.py from inside eclipse wit

Re: What makes functions special?

2011-07-09 Thread Steven D'Aprano
Eric Snow wrote: > Mostly I am just > trying to put together more pieces of the Python puzzle. In this case > I was trying to find out if the optimized execution of code objects > for functions is a part of the language or just an implementation > detail. You keep using that phrase, "optimized e

Re: What makes functions special?

2011-07-09 Thread Eric Snow
On Sat, Jul 9, 2011 at 6:38 PM, Ben Finney wrote: > Eric Snow writes: > >> On Sat, Jul 9, 2011 at 4:41 PM, Ben Finney >> wrote: >> > Eric Snow writes: >> >> No other objects have code objects. No other objects in Python have >> >> this special optimization. >> > >> > Yes. The two facts are dir

Re: What makes functions special?

2011-07-09 Thread Eric Snow
On Sat, Jul 9, 2011 at 6:21 PM, Terry Reedy wrote: > On 7/9/2011 2:28 PM, Eric Snow wrote: >> >> A tracker issue [1] recently got me thinking about what makes >> functions special.  The discussion there was regarding the distinction >> between compile time (generation of .pyc files for modules and

Re: How can I make a program automatically run once per day?

2011-07-09 Thread Alexander Kapps
On 10.07.2011 02:26, John Salerno wrote: I have a script that does some stuff that I want to run every day for maybe a week, or a month. So far I've been good about running it every night, but is there some way (using Python, of course) that I can make it automatically run at a set time each nigh

Re: What makes functions special?

2011-07-09 Thread Ben Finney
Eric Snow writes: > On Sat, Jul 9, 2011 at 4:41 PM, Ben Finney wrote: > > Eric Snow writes: > >> No other objects have code objects. No other objects in Python have > >> this special optimization. > > > > Yes. The two facts are directly related. […] > > Yes, functions are different and are tre

Re: How can I make a program automatically run once per day?

2011-07-09 Thread Ben Finney
John Salerno writes: > is there some way (using Python, of course) that I can make it > automatically run at a set time each night? You need to use whatever facilities your operating system has for scheduled events. That's unrelated to the language you use for implementing the program. On a Uni

Re: How can I make a program automatically run once per day?

2011-07-09 Thread Andrew Berg
On 2011.07.09 07:26 PM, John Salerno wrote: > I have a script that does some stuff that I want to run every day for > maybe a week, or a month. So far I've been good about running it every > night, but is there some way (using Python, of course) that I can make > it automatically run at a set time

How can I make a program automatically run once per day?

2011-07-09 Thread John Salerno
I have a script that does some stuff that I want to run every day for maybe a week, or a month. So far I've been good about running it every night, but is there some way (using Python, of course) that I can make it automatically run at a set time each night? -- http://mail.python.org/mailman/listi

Re: What makes functions special?

2011-07-09 Thread Terry Reedy
On 7/9/2011 2:28 PM, Eric Snow wrote: A tracker issue [1] recently got me thinking about what makes functions special. The discussion there was regarding the distinction between compile time (generation of .pyc files for modules and execution of code blocks), [function] definition time, and [fun

Re: What makes functions special?

2011-07-09 Thread Eric Snow
On Sat, Jul 9, 2011 at 4:41 PM, Ben Finney wrote: > Eric Snow writes: > >> A tracker issue [1] recently got me thinking about what makes >> functions special. > > As you describe, functions are special for your scenario because a > function definition needs to result in executable code as an obje

Re: What makes functions special?

2011-07-09 Thread Ben Finney
Eric Snow writes: > A tracker issue [1] recently got me thinking about what makes > functions special. As you describe, functions are special for your scenario because a function definition needs to result in executable code as an object. > Definition time actually happens during compile time,

Re: String concatenation vs. string formatting

2011-07-09 Thread Andrew Berg
On 2011.07.09 06:06 AM, Vinay Sajip wrote: > In a logging context at least, using the form like > > logger.debug("formatting message with %s", "arguments") > > rather than > > logger.debug("formatting message with %s" % "arguments") How would I do that with the newer formatting? I've tried: > logge

What makes functions special?

2011-07-09 Thread Eric Snow
A tracker issue [1] recently got me thinking about what makes functions special. The discussion there was regarding the distinction between compile time (generation of .pyc files for modules and execution of code blocks), [function] definition time, and [function] execution time. Definition time

Re: why the following python program does not face any concurrency problems without synchronize mechanism?

2011-07-09 Thread Alexander Kapps
On 09.07.2011 22:45, smith jack wrote: from threading import Thread def calc(start, end): total = 0; for i in range(start, end + 1): total += i; print '--result:', total return total t = Thread(target=calc, args=(1,100)) t.start() I have run thi

why the following python program does not face any concurrency problems without synchronize mechanism?

2011-07-09 Thread smith jack
from threading import Thread def calc(start, end): total = 0; for i in range(start, end + 1): total += i; print '--result:', total return total t = Thread(target=calc, args=(1,100)) t.start() I have run this program for many times,and the result is alw

ctypes: point to buffer in structure

2011-07-09 Thread Jesse R
Hey I've been trying to convert this to run through ctypes and i'm having a hard time typedef struct _SYSTEM_PROCESS_ID_INFORMATION { HANDLE ProcessId; UNICODE_STRING ImageName; } SYSTEM_PROCESS_IMAGE_NAME_INFORMATION, *PSYSTEM_PROCESS_IMAGE_NAME_INFORMATION; to class SYSTEM_PROCESS_ID_I

HTTP Proxy : receive call on local socket takes a lot of time

2011-07-09 Thread Rémi
Hi all, I am currently working on a HTTP Proxy. For maximum flexibility, I am implementing the proxy at a low level : I am using the SocketServer library. The server itself is very simple: class MyTCPServer(SocketServer.TCPServer): allow_reuse_address = 1 and the handler looks like: cla

Re: String concatenation vs. string formatting

2011-07-09 Thread Vinay Sajip
Andrew Berg gmail.com> writes: > Other than the case where a variable isn't a string (format() converts > variables to strings, automatically, right?) and when a variable is used > a bunch of times, concatenation is fine, but somehow, it seems wrong. > Sorry if this seems a bit silly, but I'm a n