Best way to do subversion stuff

2016-04-28 Thread Grant Edwards
I'd like to write some small command-line utilities to do some tasks in subversion: * Do a commit that includes all modified externals. * Do a status that includes status of all externals. * Do a log that combines logs of . and all externals. There appear to be three options: 1) pysvn

Re: Best way to do background calculations?

2015-10-26 Thread Chris Angelico
On Tue, Oct 27, 2015 at 4:01 AM, Israel Brewster wrote: > Sounds similar to MRAB's suggestion of starting the process before any > sockets have been opened. Certainly worth investigating, and I think it > should be doable. Thanks! Yep, either would work. My suggestion would be to not fork off f

Re: Best way to do background calculations?

2015-10-26 Thread Israel Brewster
On Oct 25, 2015, at 6:48 PM, Chris Angelico wrote: > > On Sat, Oct 24, 2015 at 3:35 AM, Israel Brewster > wrote: >> >> Ideally, this recalculation process would happen in the background. There is >> no need for the user to wait around while the system crunches numbers - they >> should be able

Re: Best way to do background calculations?

2015-10-26 Thread Israel Brewster
On Oct 25, 2015, at 3:40 PM, Dennis Lee Bieber wrote: > > On Fri, 23 Oct 2015 08:35:06 -0800, Israel Brewster > declaimed the following: > >> tl;dr: I've been using the multiprocessing module to run some calculations >> in the background of my CherryPy web app, but apparently this process >>

Re: Best way to do background calculations?

2015-10-26 Thread Israel Brewster
On Oct 25, 2015, at 4:05 PM, MRAB wrote: > > On 2015-10-23 17:35, Israel Brewster wrote: >> tl;dr: I've been using the multiprocessing module to run some >> calculations in the background of my CherryPy web app, but apparently >> this process sometimes gets stuck, causing problems with open socke

Re: Best way to do background calculations?

2015-10-25 Thread Chris Angelico
On Sat, Oct 24, 2015 at 3:35 AM, Israel Brewster wrote: > > Ideally, this recalculation process would happen in the background. There is > no need for the user to wait around while the system crunches numbers - they > should be able to move on with entering another log or whatever else they > need

Please post “text/plain” message body (was: Best way to do background calculations?)

2015-10-25 Thread Ben Finney
Israel Brewster writes: [no text] Please ensure your email message body is “text/plain” (and preferably not HTML) when posting to unfamiliar recipients — which is always, on a public forum like this. -- \“Pinky, are you pondering what I'm pondering?” “Umm, I think | `\ so, Bra

Re: Best way to do background calculations?

2015-10-25 Thread MRAB
On 2015-10-23 17:35, Israel Brewster wrote: tl;dr: I've been using the multiprocessing module to run some calculations in the background of my CherryPy web app, but apparently this process sometimes gets stuck, causing problems with open sockets piling up and blocking the app. Is there a better w

Best way to do background calculations?

2015-10-25 Thread Israel Brewster
tl;dr: I've been using the multiprocessing module to run some calculations in the background of my CherryPy web app, but apparently this process sometimes gets stuck, causing problems with open sockets piling up and blocking the app. Is there a better way?The (rather wordy) details:I have a moderat

Re: Best way to do

2015-04-25 Thread Peter Otten
eta = hndl.PropsSI('V','P',p,'H',h,'Water') > return rho,t,eta,x > > h = 1e3*np.linspace(700,1500,len) > p = 1e6*np.linspace(2.8,3,len) > > t1 = time.time() > (rho,t,eta,x) = PyDir(p,h,CPpy) > t2 = time.time() > print(

Best way to do

2015-04-25 Thread pauld11718
P',p,'H',h,'Water') x = hndl.PropsSI('Q','P',p,'H',h,'Water') eta = hndl.PropsSI('V','P',p,'H',h,'Water') return rho,t,eta,x h = 1e3*np.linspace(700,1500,len) p = 1e6*np.linspace(2.8,

Re: Best way to do this? List loop (matrix?) iteration

2013-01-09 Thread Dave Angel
On 01/09/2013 06:24 PM, andydtay...@gmail.com wrote: > Thanks for your help - this is what I did - though it's probably obvious to > most people reading this. > >for rowcount in range (0, stn_count): > row_durations.append(stn_list_short[rowcount]) > for colcount in range (0, stn_c

Re: Best way to do this? List loop (matrix?) iteration

2013-01-09 Thread andydtaylor
Thanks for your help - this is what I did - though it's probably obvious to most people reading this. for rowcount in range (0, stn_count): row_durations.append(stn_list_short[rowcount]) for colcount in range (0, stn_count): # 3. Determine Station pairs for API query

Re: Best way to do this? List loop (matrix?) iteration

2013-01-08 Thread Chris Angelico
On Wed, Jan 9, 2013 at 11:19 AM, wrote: >stn_count = len(stn_list_short) >for rowcount in range (0, stn_count): > for colcount in range (0, stn_count): > print stn_list_long[rowcount] stn_list_long[colcount] First off, you can iterate over the list directly: for row in st

Re: Best way to do this? List loop (matrix?) iteration

2013-01-08 Thread Mitya Sirenef
On Tue 08 Jan 2013 07:19:59 PM EST, andydtay...@gmail.com wrote: Hi! I might be missing the obvious, or I may have found something more complicated than the VBA I am used to. Could it be I need to use a maths library? For a given list of k items I'd like to turn it into an k*k matrix of item

Best way to do this? List loop (matrix?) iteration

2013-01-08 Thread andydtaylor
Hi! I might be missing the obvious, or I may have found something more complicated than the VBA I am used to. Could it be I need to use a maths library? For a given list of k items I'd like to turn it into an k*k matrix of item pairs. List_sample = ['a', 'b', 'c'] Output: aa ab ac ba bb bc c

Re: best way to do this

2008-12-02 Thread alex23
On Dec 3, 1:38 pm, thor <[EMAIL PROTECTED]> wrote: > >>> c = [(5, 3), (6, 8)] > >>> [x for t in zip(*c) for x in t] > [5, 6, 3, 8] The zip here is superfluous. >>> c = [(5, 3), (6, 8)] >>> zip(*c) [(5, 6), (3, 8)] Unless you're -only- using it to ensure your result is the same order as the OP...

Re: best way to do this

2008-12-02 Thread thor
On Dec 2, 10:09 pm, TP <[EMAIL PROTECTED]> wrote: > Hi everybody, > > >>> c=[(5,3), (6,8)] > > From c, I want to obtain a list with 5,3,6, and 8, in any order. > I do this: > > >>> [i for (i,j) in c] + [ j for (i,j) in c] > > [5, 6, 3, 8] > > Is there a quicker way to do this? > >>> c = [(5, 3), (

Re: best way to do this

2008-12-02 Thread Arnaud Delobelle
On Dec 2, 2:09 pm, TP <[EMAIL PROTECTED]> wrote: > Hi everybody, > > >>> c=[(5,3), (6,8)] > > From c, I want to obtain a list with 5,3,6, and 8, in any order. > I do this: > > >>> [i for (i,j) in c] + [ j for (i,j) in c] > > [5, 6, 3, 8] > > Is there a quicker way to do this? > One list comprehens

Re: best way to do this

2008-12-02 Thread Hrvoje Niksic
TP <[EMAIL PROTECTED]> writes: > Hi everybody, > c=[(5,3), (6,8)] > > From c, I want to obtain a list with 5,3,6, and 8, in any order. > I do this: > [i for (i,j) in c] + [ j for (i,j) in c] > [5, 6, 3, 8] > > Is there a quicker way to do this? Quicker? Hard to say. Using itertools el

Re: best way to do this

2008-12-02 Thread Diez B. Roggisch
TP wrote: > Hi everybody, > c=[(5,3), (6,8)] > > From c, I want to obtain a list with 5,3,6, and 8, in any order. > I do this: > [i for (i,j) in c] + [ j for (i,j) in c] > [5, 6, 3, 8] > > Is there a quicker way to do this? dunno if it's faster, but less cluttered: list(sum(c, ()))

best way to do this

2008-12-02 Thread TP
Hi everybody, >>> c=[(5,3), (6,8)] >From c, I want to obtain a list with 5,3,6, and 8, in any order. I do this: >>> [i for (i,j) in c] + [ j for (i,j) in c] [5, 6, 3, 8] Is there a quicker way to do this? Thanks Julien -- python -c "print ''.join([chr(154 - ord(c)) for c in '*9(9&(18%.9&1+,\

Re: What is the best way to do dynamic imports ?

2007-12-30 Thread Graham Dumpleton
On Dec 31, 1:24 am, [EMAIL PROTECTED] wrote: > Hi list and python gurus :-) > > I'm playing with somemod_pythonand web development. And in me code I > need to do som dynamic imports. > Right now I just do a: > > exec 'import '+some_modulename > > But it seems to easy, is there a "dark side" to doin

Re: What is the best way to do dynamic imports ?

2007-12-30 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > First of thanks to all for you, especially for the quick replys. > > Just need to walk the dog then I giv it a short. Please, don't kill your dog! We're a peace-loving community here that respects dogs, and snakes and even trolls. SCNR, Diez -- http://mail.python.

Re: What is the best way to do dynamic imports ?

2007-12-30 Thread marcroy . olsen
First of thanks to all for you, especially for the quick replys. Just need to walk the dog then I giv it a short. On Dec 30, 3:57 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > > Do anybody now a good howto or tutorial to this? > > No... what do you want covered? Nothing, think you repl

Re: What is the best way to do dynamic imports ?

2007-12-30 Thread Gabriel Genellina
En Sun, 30 Dec 2007 12:24:53 -0200, <[EMAIL PROTECTED]> escribi�: > I'm playing with some mod_python and web development. And in me code I > need to do som dynamic imports. > Right now I just do a: > > exec 'import '+some_modulename > > But it seems to easy, is there a "dark side" to doing it this

Re: What is the best way to do dynamic imports ?

2007-12-30 Thread Torsten Bronger
Hallöchen! [EMAIL PROTECTED] writes: > I'm playing with some mod_python and web development. And in me > code I need to do som dynamic imports. Right now I just do a: > > exec 'import '+some_modulename > > But it seems to easy, is there a "dark side" to doing it this way? > (memory use,processin

Re: What is the best way to do dynamic imports ?

2007-12-30 Thread Benjamin
On Dec 30, 8:24 am, [EMAIL PROTECTED] wrote: > Hi list and python gurus :-) > > I'm playing with some mod_python and web development. And in me code I > need to do som dynamic imports. > Right now I just do a: > > exec 'import '+some_modulename The correct way to do this is use the __import__ funct

What is the best way to do dynamic imports ?

2007-12-30 Thread marcroy . olsen
Hi list and python gurus :-) I'm playing with some mod_python and web development. And in me code I need to do som dynamic imports. Right now I just do a: exec 'import '+some_modulename But it seems to easy, is there a "dark side" to doing it this way? (memory use,processing ,etc) And have to I

Re: Best way to do attribute docstrings?

2007-09-26 Thread Ken Kuhlman
On Sep 26, 12:25 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 25 Sep 2007 22:41:31 -0300,KenKuhlman<[EMAIL PROTECTED]> > escribi?: > > > Replying to myself in case someone finds this interesting. > > > Anyway, I took another shot at this with a little fresher mind, and it > > was qu

Re: Best way to do attribute docstrings?

2007-09-25 Thread Gabriel Genellina
En Tue, 25 Sep 2007 22:41:31 -0300, Ken Kuhlman <[EMAIL PROTECTED]> escribi�: > Replying to myself in case someone finds this interesting. > > Anyway, I took another shot at this with a little fresher mind, and it > was quickly obvious that I was trying to force attributes to behave > more like

Re: Best way to do attribute docstrings?

2007-09-25 Thread Ken Kuhlman
Replying to myself in case someone finds this interesting. Anyway, I took another shot at this with a little fresher mind, and it was quickly obvious that I was trying to force attributes to behave more like classes. It was a small step from there to creating a factory function to return instance

Re: Best way to do attribute docstrings?

2007-09-11 Thread Ken Kuhlman
Thanks for the response! It was just the kick I needed to realize that I was letting my frustration get the best of me and that I was going down a dead-end. I blame the fact that I was coding on little sleep :-) I went with the solution of giving a naming convention to the docstrings and relyin

Re: Best way to do attribute docstrings?

2007-09-07 Thread Gabriel Genellina
En Fri, 07 Sep 2007 17:06:07 -0300, Ken Kuhlman <[EMAIL PROTECTED]> escribi�: > What's the best method for annotating attributes with a docstring? > I'm looking to be able to introspect my class & get the comments back > out. I don't know which is the *best* method. Perhaps you might use proper

Best way to do attribute docstrings?

2007-09-07 Thread Ken Kuhlman
What's the best method for annotating attributes with a docstring? I'm looking to be able to introspect my class & get the comments back out. The technique I'm using is a little hoaky, but works.. basically I create subclasses of the builtin types that I want to be able to use & then instantiate

Re: Best way to do data source abstraction

2006-06-01 Thread Larry Bates
Arthur Pemberton wrote: > What is the best way to do data source abtraction? For example have > different classes with the same interface, but different > implementations. > > I was thinking of almost having classA as my main class, and have > classA dynamically "absorb&q

Re: Best way to do data source abstraction

2006-06-01 Thread bruno at modulix
Arthur Pemberton wrote: > What is the best way to do data source abtraction? For example have > different classes with the same interface, but different > implementations. > > I was thinking of almost having classA as my main class, and have > classA dynamically "absorb&q

Re: Best way to do data source abstraction

2006-06-01 Thread Sybren Stuvel
Arthur Pemberton enlightened us with: > What is the best way to do data source abtraction? That depends on your data source. For files, file-like objects are an abstraction. For databases there is PEP 249. > I was thinking of almost having classA as my main class, and have > classA dy

Best way to do data source abstraction

2006-06-01 Thread Arthur Pemberton
What is the best way to do data source abtraction? For example have different classes with the same interface, but different implementations. I was thinking of almost having classA as my main class, and have classA dynamically "absorb" classFood into to based on the extension of the

Re: best way to do this ...

2005-05-17 Thread Tonino
hmm - but I want to store the data in memory eather than a filesystem ... it is not an issue if the program terminates - it is almost needed while running and does not need to remember where it is .. the dirctionary is detail = {} will try the list() function - thanks Tonino -- http://mail.pyt

Re: best way to do this ...

2005-05-17 Thread Thomas Guettler
Am Tue, 17 May 2005 05:26:15 -0700 schrieb Tonino: > Hi ALL, > > I am having a issue with a particular storage of data problem and > wanted to know if I am going about it the wrong way. > > I have a list of reference numbers associated with a product and I have > a socket that listens on a port.

best way to do this ...

2005-05-17 Thread Tonino
Hi ALL, I am having a issue with a particular storage of data problem and wanted to know if I am going about it the wrong way. I have a list of reference numbers associated with a product and I have a socket that listens on a port. Now what happens is the client app connects to the server - send

Re: best way to do a series of regexp checks with groups

2005-01-24 Thread Mark Fanty
This is the kind of thing I meant. I think I have to get used to writing small, light-weight classes. You inspired this variation which is a little more verbose in the class definition, but less so in the use: class Matcher: def search(self, r,s): self.value = re.search(r,s) return

Re: best way to do a series of regexp checks with groups

2005-01-24 Thread Jonathan Fine
Mark Fanty wrote: In perl, I might do (made up example just to illustrate the point): if(/add (\d+) (\d+)/) { do_add($1, $2); } elsif (/mult (\d+) (\d+)/) { do_mult($1,$2); } elsif(/help (\w+)/) { show_help($1); } or even do_add($1,$2) if /add (\d+) (\d+)/; do_mult($1,$2) if /mult (\d+) (\d+)

Re: best way to do a series of regexp checks with groups

2005-01-24 Thread Alex Martelli
Steven Bethard <[EMAIL PROTECTED]> wrote: > I get a bit uneasy from the repeated calls to m.group... If I was going > to build a class around the re, I think I might lean towards something like: > > class ReWithMemory(object): > def search(self, are, aline): > self.mo = re.search(a

Re: best way to do a series of regexp checks with groups

2005-01-24 Thread Steven Bethard
Alex Martelli wrote: class ReWithMemory(object): def search(self, are, aline): self.mo = re.search(are, aline) return self.mo def group(self, n): return self.mo.group(n) m = ReWithMemory() if m.search(r'add (\d+) (\d+)', line): do_add(m.group(1), m.group(2)) elif

Re: best way to do a series of regexp checks with groups

2005-01-24 Thread Duncan Booth
Mark Fanty wrote: > No nesting, but the while is misleading since I'm not looping and this > is a bit awkward. I don't mind a few more key strokes, but I'd like > clarity. I wish I could do > > if m = re.search(r'add (\d+) (\d+)', $line): > do_add(m.group(1), m.group(2)) > elif m = re.sear

Re: best way to do a series of regexp checks with groups

2005-01-24 Thread Alex Martelli
Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > Here is a different solution... > > class Result: > def set(self, value): > self.value = value > return value > > m = Result() > > if m.set(re.search(r'add (\d+) (\d+)', line)): > do_add(m.value.group(1), m.value.group(2)) > e

Re: best way to do a series of regexp checks with groups

2005-01-23 Thread Nick Craig-Wood
Mark Fanty <[EMAIL PROTECTED]> wrote: > In perl, I might do (made up example just to illustrate the point): > > if(/add (\d+) (\d+)/) { >do_add($1, $2); > } elsif (/mult (\d+) (\d+)/) { >do_mult($1,$2); > } elsif(/help (\w+)/) { >show_help($1); > } There was a thread about this r

Re: best way to do a series of regexp checks with groups

2005-01-23 Thread [EMAIL PROTECTED]
what about something like this? >>> import re >>> m = re.match(r"""(?Padd|mult) (?P\d+) (?P\d+)""", 'add 3 5') >>> from operator import add, mul >>> op = {'add': add, 'mult: mul} >>> op[m.groupdict()['operator']](int(m.groupdict()['int_1']), int(m.groupdict()['int_2'])) 8 -- http://mail.python.or

best way to do a series of regexp checks with groups

2005-01-23 Thread Mark Fanty
In perl, I might do (made up example just to illustrate the point): if(/add (\d+) (\d+)/) { do_add($1, $2); } elsif (/mult (\d+) (\d+)/) { do_mult($1,$2); } elsif(/help (\w+)/) { show_help($1); } or even do_add($1,$2) if /add (\d+) (\d+)/; do_mult($1,$2) if /mult (\d+) (\d+)/; show_help($1

Re: The best way to do web apps with Python?

2005-01-12 Thread Ian Bicking
Paul Rubin wrote: Steve Holden <[EMAIL PROTECTED]> writes: You can read about it in Philip Eby's excellent PEP at http://www.python.org/peps/pep-0333.html I looked at this and I have the impression that it tries to do something worthwhile, but I can't tell precisely what. The "rationale and goa

Re: The best way to do web apps with Python?

2005-01-09 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > You can read about it in Philip Eby's excellent PEP at > >http://www.python.org/peps/pep-0333.html I looked at this and I have the impression that it tries to do something worthwhile, but I can't tell precisely what. The "rationale and goals" sectio

Re: The best way to do web apps with Python?

2005-01-09 Thread Jon Perez
worzel wrote: What is the best way to web developemnt with Python? Is there anything close to PHP style in-page script placement that can create and use other Python objects? Spyce ( http://spyce.sf.net ) is what you're looking for. I was looking exactly for the same thing as you are - a PHP w

Re: The best way to do web apps with Python?

2005-01-09 Thread Carlos Ribeiro
On Sat, 8 Jan 2005 21:11:49 +0800, worzel <[EMAIL PROTECTED]> wrote: > > What is the best way to web developemnt with Python? Is there anything close > to PHP style in-page script placement that can create and use other Python > objects? I am not really interested in Zope (I believe that is more

Re: The best way to do web apps with Python?

2005-01-09 Thread Ian Bicking
Steve Holden wrote: More ways than you can shake a stick at, but nowadays you should consider using WSGI if you want your code to be portable across many frameworks. The Web SIG worked very hard last year on defining this gateway interface, with the intention that it should become widely availa

Re: The best way to do web apps with Python?

2005-01-08 Thread Joe Francia
worzel wrote: What is the best way to web developemnt with Python? Is there anything close to PHP style in-page script placement that can create and use other Python objects? I am not really interested in Zope (I believe that is more a CMS than anything else?) I am also looking for something a litt

Re: The best way to do web apps with Python?

2005-01-08 Thread worzel
Holy Moly - there's quite a few choices out there! I like the look of Karrigel for my immediate needs. Looking forward to the day there is a more 'j2ee' like standard in place for Python - looks like this is in the works. Thanks for all the feedback guys. "worzel" <[EMAIL PROTECTED]> wrote i

Re: The best way to do web apps with Python?

2005-01-08 Thread Steve Holden
worzel wrote: What is the best way to web developemnt with Python? Is there anything close to PHP style in-page script placement that can create and use other Python objects? I am not really interested in Zope (I believe that is more a CMS than anything else?) I am also looking for something a

Re: The best way to do web apps with Python?

2005-01-08 Thread Rob Emmons
> > > > > > > > What is Just FYI -- the post you posted was in HTML -- you might want to avoid this in the future. 99% of all posts to news groups are in text, not html. Html is hard for everyone to read with normal news readers and not usually of any extra value. It's also more of a se

Re: The best way to do web apps with Python?

2005-01-08 Thread JZ
Dnia Sat, 8 Jan 2005 21:11:49 +0800, worzel napisał(a): > What is the best way to web developemnt with Python? Hmm. :) I prefer http://cherrypy.org + http://cheetahtemplate.org/. Very easy to learn and develop, yet powerfull. > Is there anything close to PHP style in-page script > placement th

Re: The best way to do web apps with Python?

2005-01-08 Thread Pierre Quentel
worzel a écrit : What is the best way to web developemnt with Python? Is there anything close to PHP style in-page script placement that can create and use other Python objects? I am not really interested in Zope (I believe that is more a CMS than anything else?) I am also looking for something

Re: The best way to do web apps with Python?

2005-01-08 Thread Paul Rubin
"worzel" <[EMAIL PROTECTED]> writes: > What is the best way to web developemnt with Python? Is there > anything close to PHP style in-page script placement that can create > and use other Python objects? I am not really interested in Zope (I > believe that is more a CMS than anything else?) I am al

The best way to do web apps with Python?

2005-01-08 Thread worzel
What is the best way to web developemnt with Python? Is there anything close to PHP style in-page script placement that can create and use other Python objects? I am not really interested in Zope (I believe that is more a CMS than anything else?) I am also looking for something a little more