On Feb 17, 12:34 am, "Gabriel Genellina"
wrote:
> En Fri, 13 Feb 2009 20:17:35 -0200, Bryan escribió:
>
>
>
> > On Feb 13, 1:52 pm, Jason Scheirer wrote:
> >> On Feb 13, 12:42 pm, Bryan wrote:
>
> >> > I have a Python v2.5.2 server running
I want my business objects to be able to do this:
class Person(base):
def __init__(self):
self.name = None
@base.validator
def validate_name(self):
if not self.name: return ['Name cannot be empty']
p = Person()
print p.invalid # Prints ['Name cannot be empty']
p.name
Steven D'Aprano wrote:
> On Fri, 31 Oct 2008 11:26:19 -0700, Bryan wrote:
>
> > I want my business objects to be able to do this:
> [snip code]
>
> The code you show is quite long and complex and frankly I don't have the
> time to study it in detail at the
On Nov 1, 6:57 pm, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Sat, 01 Nov 2008 17:12:33 -0700, Bryan wrote:
> > The list of validation error descriptions is returned instead of raising
> > exceptions so clients can show the errors to the us
Steven D'Aprano wrote:
> On Sun, 02 Nov 2008 09:33:41 -0800, Bryan wrote:
>
> > I'm coming from a .Net background, and yes, one of the reasons I did not
> > consider raising exceptions was to avoid the overhead of an exception
> > handler clause, which in .N
On Apr 28, 11:16 pm, Arnaud Delobelle wrote:
> Kay Schluehr writes:
> > On 29 Apr., 05:41, Ross wrote:
> >> If I have a list x = [1,2,3,4,5,6,7,8,9] and another list that is a
> >> subset of x: y = [1,4,7] , is there a quick way that I could return
> >> the complementary subset to y z=[2,3,
On Apr 28, 11:16 pm, Arnaud Delobelle wrote:
> Kay Schluehr writes:
> > On 29 Apr., 05:41, Ross wrote:
> >> If I have a list x = [1,2,3,4,5,6,7,8,9] and another list that is a
> >> subset of x: y = [1,4,7] , is there a quick way that I could return
> >> the complementary subset to y z=[2,3,
ouching that horrible mouse contraption.
Bryan
--
http://mail.python.org/mailman/listinfo/python-list
level routine that cares or knows what to do.
f = open('file')
try:
# do something
finally:
f.close()
if i really want to handle the exception, then i handle it at a conceptually
"higher" level by wrapping it in an exception which is basically what some
higher-level routine would do anyways.
try:
f = open('file)
try:
# do something
finally:
f.close()
except IOError:
# handle exceptions
bryan
--
http://mail.python.org/mailman/listinfo/python-list
#x27;POST', '/foo', message, header)
res = con.getresponse().read()
thanks,
bryan
--
http://mail.python.org/mailman/listinfo/python-list
emo and it's very nice. the only thing was in the
demo it shows one Click() method to close the notepadabout dialog. but for me
on
windows xp media edition, it took two Click() methods. the first click
clearly
had the button depressed and the second click released the button back up. is
this a bug in 0.3.0? or is it the new way of doing it... two clicks for each
button?
also, i would be really nice if the FAQ mentioned where you could get free or
opensourced spy utilities so you could spy on controls and get their id values
or internal names.
thanks,
bryan
--
http://mail.python.org/mailman/listinfo/python-list
When a user submits a request to update an object in my web app, I
make the changes in the DB, along w/ who last updated it and when. I
only want to update the updated/updatedBy columns in the DB if the
data has actually changed however.
I'm thinking of having the object in question be able to re
On Dec 11, 10:17 am, Robert Kern wrote:
> On 2009-12-11 12:03 PM, Bryan wrote:
>
> > When a user submits a request to update an object in my web app, I
> > make the changes in the DB, along w/ who last updated it and when. I
> > only want to update the updated/updatedBy
I am writing a small script to manage my ipod. I am using the python
bindings for libgpod. I have never used swig, or used python to
program against a c/c++ library.
I can get the library to find my ipod, and parse its DB format, but
I'm not sure how to interact with the types that some of the f
I'm designing a system and wanted to get some feedback on a potential
performance problem down the road while it is still cheap to fix.
The system is similar to an accounting system where a system tracks
"Things"
which move between different "Buckets". The system answers these
questions:
- How ma
as tons of useful libraries bla bla
bla.
This post describes the IDS vs language divide that I crossed over:
http://osteele.com/archives/2004/11/ides
Python can do everything you ask in your post, and their are many
resources to help you do those things. I just wanted to give you some
advice for the bigger picture.
Bryan
--
http://mail.python.org/mailman/listinfo/python-list
I have several properties on a class that have very similar behavior.
If one of the properties is set, all the other properties need to be
set to None. So I wanted to create these properties in a loop like:
class Test(object):
for prop in ['foo', 'bar', 'spam']:
# Attribut
On Nov 13, 9:34 am, "Diez B. Roggisch" wrote:
> Bryan schrieb:
>
>
>
> > I have several properties on a class that have very similar behavior.
> > If one of the properties is set, all the other properties need to be
> > set to None. So I wanted t
I am looping through a list and creating a regular dictionary. From
that dict, I create an ordered dict. I can't think of a way to build
the ordered dict while going through the original loop. Is there a
way I can avoid creating the first unordered dict just to get the
ordered dict? Also, I am
On Feb 22, 9:19 am, MRAB wrote:
> Bryan wrote:
> > I am looping through a list and creating a regular dictionary. From
> > that dict, I create an ordered dict. I can't think of a way to build
> > the ordered dict while going through the original loop. Is there a
&g
On Feb 22, 10:57 am, "Alf P. Steinbach" wrote:
> * Bryan:
>
>
>
> > I am looping through a list and creating a regular dictionary. From
> > that dict, I create an ordered dict. I can't think of a way to build
> > the ordered dict while going through
On Feb 22, 2:16 pm, "Diez B. Roggisch" wrote:
> Am 22.02.10 22:29, schrieb Bryan:
>
>
>
> > On Feb 22, 10:57 am, "Alf P. Steinbach" wrote:
> >> * Bryan:
>
> >>> I am looping through a list and creating a regular dictionary. From
>
On Feb 22, 3:00 pm, "Diez B. Roggisch" wrote:
> Am 22.02.10 23:48, schrieb Bryan:
>
>
>
> > On Feb 22, 2:16 pm, "Diez B. Roggisch" wrote:
> >> Am 22.02.10 22:29, schrieb Bryan:
>
> >>> On Feb 22, 10:57 am, "Alf P. Steinbach&q
On Jan 23, 11:31 am, rantingrick wrote:
> On Jan 22, 6:07 pm, rantingrick wrote:
>
> > I await any challengers...
>
> So far only trolls (besides Terry, Octavian, D'Aprano) have replied.
> In my time here within the Python community i have only met one person
> who shares my in-depth knowledge of
On Jan 23, 5:13 pm, Steven D'Aprano wrote:
> On Sun, 23 Jan 2011 12:23:13 -0800, rantingrick wrote:
> > I am not
> > trying to create a working file browser so you can steal my code.
>
> Dammit! There goes my brilliant idea for getting rich.
>
> Step 1: Start company.
> Step 2: Steal working file
On Jan 23, 7:12 pm, rantingrick wrote:
> On Jan 23, 5:23 pm, Kevin Walzer wrote:
>
> > I found this code in the Demo/tkinter/ttk directory of the Python 2.7.1
> > source distribution. I'm NOT the author (credit should probably go to
> > Guilherme Polo, developer of the Tkinter wrapper for the ttk
On Jan 23, 7:33 pm, rantingrick wrote:
> On Jan 23, 7:16 pm, Kevin Walzer wrote:
>
>
>
>
>
> > On 1/23/11 8:12 PM, rantingrick wrote:
>
> > > The only way i can respond to this is to quite the requirements for my
> > > challenge...
>
> > > ---
> > > Challenge
On Jan 24, 12:06 am, rusi wrote:
> On Jan 24, 9:16 am, "Littlefield, Tyler" wrote:
>
> Of course as Steven pointed out wx is written in C++ which is almost
> certainly where the crash is occurring.
> But this is technical nitpicking.
> The real issue is that when coding in C/C++ segfaults are a d
On Jan 24, 7:27 am, "Octavian Rasnita" wrote:
> From: "Bryan"
>
> > It would be hard (but not impossible, by any
> > stretch) for me to duplicate your code. Certainly, it would take more
> > lines of code but that's about it. OTOH, it would be ve
On Jan 24, 7:32 am, rantingrick wrote:
> On Jan 24, 7:24 am, Bryan wrote:
>
> > On Jan 24, 12:06 am, rusi wrote:
>
> > > On Jan 24, 9:16 am, "Littlefield, Tyler" wrote:
>
> > > Of course as Steven pointed out wx is written in C++ which is almos
On Jan 24, 8:15 am, rantingrick wrote:
> On Jan 24, 6:33 am, Bryan wrote:
>
> > I think I'm qualified, though I guess only you can tell me if I
> > measure up to your standards.
>
> Go on...
>
> > I have 15 years or so of tk development,
> > though ad
On Jan 24, 8:49 am, Mike Driscoll wrote:
>
> Bryan, on the other hand, has been aTkinterluminary who has helped
> me in the past when I was learningTkinterand I won't be too
> surprised if he helps me again. I'm sorry he's had so much trouble
> with wx though.
On Jan 24, 12:05 pm, rantingrick wrote:
> On Jan 24, 12:00 pm, Bryan wrote:
>
> > Accessibility, like internationalization, is something few programmers
> > spend much time thinking about.
>
> Thats another uninformed statement by you we can add to the mountains
>
On Jan 24, 12:31 pm, "Littlefield, Tyler" wrote:
> Bryan: Here's a pretty good list for you.
> Windows:
> Jaws for Windows (http://freedomscientific.com). Not free, but you get a
> 40 minute demo before you need to reboot.
> Nonvisual Desktop Access:http://www.
On Jan 24, 2:33 pm, rantingrick wrote:
>
> Yes and you made your selfishness quite clear! Be careful my friend,
> because as Tyler found out, this mindset becomes a slippery slope
> *very* quickly!
I merely made the observation that most programmers don't think about
these topics and it would be
On Jan 24, 4:16 pm, rantingrick wrote:
> ...
> Good, and again i cannot stress how little we care about your opinion.
You keep using the word "we". I do not think it means what you think
it means.
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 25, 2:02 am, Bob Martin wrote:
> in 650595 20110124 192332 Bryan wrote:
>
>
>
>
>
> >On Jan 24, 12:05=A0pm, rantingrick wrote:
> >> On Jan 24, 12:00=A0pm, Bryan wrote:
>
> >> > Accessibility, like internationalization, is something few p
On Jan 25, 6:03 am, Bob Martin wrote:
> in 650672 20110125 115033 Bryan wrote:
> >> Do you think the whole world speaks US English?
>
> >No, absolutely not. I don't see how you go from "I don't think all
> >developers think about i18n" to "I th
On Jan 22, 2:22 pm, Rikishi42 wrote:
> I'm in need for a graphical pop-up that will display a (unicode ?) string in
> a field, allow the user to change it and return the modified string.
>
> Maybe also keep the original one displayed above it.
>
> Something like this:
> +--
On Jan 25, 7:07 pm, rantingrick wrote:
> What is it going to take for you (and others) to take me seriously?
If somebody answers that question, will you listen? That will be the
first step. I know that may sound facetious but that's not my
intention. It's my honest opinion based entirely on this
On Jan 26, 9:47 am, "Octavian Rasnita" wrote:
> I couldn't find the word soapbox in the dictionary so I don't know what it
> means. I guess that not the soap + box.
> Please be more clear and not talk like the high school kids.
http://en.wikipedia.org/wiki/Soapbox
--
http://mail.python.org/m
On Jan 26, 2:37 pm, rantingrick wrote:
> On Jan 26, 2:07 pm, Stephen Hansen wrote:
>
> > And some people have absolutely no need-- no need at all-- for any sort
> > of GUI programming at all. This group is actually really, really big.
>
> Stephen "Strawman" Hansen: If he only had a brain! :-)
>
>
On Jan 25, 5:02 pm, rantingrick wrote:
> On Jan 25, 3:54 pm, Bryan wrote:
> ... And you people wonder why i hate Tkinter!
Honestly, I don't think anyone wonders why _you_ hate Tkinter, you've
made that abundantly clear.
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 28, 8:18 am, rantingrick wrote:
> On Jan 27, 12:13 pm, Stephen Hansen wrote:
>
> > Seriously. Octavian's attitude in this thread makes me want to go use
> > Tkinter just to spite him. And I'm net-buds with Tyler, and I'm working
> > on a project that I thought accessibility for the blind w
On Jan 28, 10:16 am, Kevin Walzer wrote:
> On 1/28/11 9:18 AM, rantingrick wrote:
>
> > Everyone on this list knows that Kevin and myself are the *only*
> > people who know how to wield Tkinter past some simple utility GUI's.
>
> I strongly disagree with this statement.
>
(BTW, Kevin, Congrats on
I'll suggest the
generalization:
def partition(target, predicate):
result = {}
for item in target:
result.setdefault(predicate(item), []).append(item)
return result
> true, false = [1,2,3,4].partition(lambda x: x >1)
>
> print true, false
&g
atures --
how efficiently a web app gets invoked is not among them. It's not a
language issue. What was the theory here? Did we think the PHP
community too stupid to understand FastCGI?
--
--Bryan Olson
--
http://mail.python.org/mailman/listinfo/python-list
Bruno wrote:
> Bryan a écrit :
> > I think you guys got some incorrect info about PHP. A variety of
> > execution options are available, such as FastCGI and in-server
> > modules.
>
> mod_php, yes, but that doesn't change anything to the fact that it has
> to
didn't say when that was, but PHP caching has come a long way.
Google is your friend.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
Bruno Desthuilliers wrote:
> Bryan a écrit :
>
> > Bruno Desthuilliers wrote:
> >> Nope. I want to keep all my settings parsed, my librairies loaded, all
> >> my connections opened etc. That is, all the time consuming stuff at app
> >> startup - which, with
-- how efficiently
a web app gets invoked is not among them. It's not a language issue."
Bruno disagreed when it comes to PHP. But obviously Bruno and I don't
communicate all that well.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
he
length of the entire sequence dominates n. I figure the worst-case run
time is Theta(s lg(n)) where s in the length of the sequence.
> Interestingly, nsmallest does use two different algorithms,
> depending on how many items you ask for. See the source code.
That is interesting. The
ws, don't commit to modules devoted to
rockin' on Unix. Python has multiple ways to run "wrenv.exe", then
"make clean". In particular, check out os.system.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
,
number INTEGER,
PRIMARY KEY (floor, number)
);
CREATE TABLE employees (
eid INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
floor TEXT,
room_number INTEGER,
FOREIGN KEY (floor, room_number) REFERENCES rooms
)
"""
con = sqlite3.connect(":memory:")
for cmd in schema.split(';'):
con.execute(cmd)
con.close()
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
for n in source:
assert not pred(n)
assert n in original
assert sorted(extracted) == extracted
for n in extracted:
assert pred(n)
assert n in original
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
n sset
If building the set is too slow, and you know you don't have a lot of
duplicate strings, you can use a faster insert method that doesn't
check whether the string is already in the set:
def add_quick(self, s):
assert len(s) == self.strlen
self.table[self._hashstr(s)] += s
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
persistent data were
stored via pickle.
The SQLite developers state the situation brilliantly at
http://www.sqlite.org/whentouse.html:
"SQLite is not designed to replace Oracle. It is designed to replace
fopen()."
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
for n in old_list:
assert n.code != 3
assert n in original_new_list or n in original_old_list
assert old_list == [s for s in original_old_list
if s in old_list]
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
;s, I can re.compile one with 4000
words randomly chosen from a Unix words file, but 5000 results in
"regular expression code size limit exceeded". Tim's version which
doesn't combine prefixes tops out a little lower. This is on 32-bit
Windows, standard distribution. One could, of
ssume you're not actually suggesting hand-writing a state machine
for the problem at issue here, which requires recognizing about 5000
different words.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
edy was right: startswith() is slower. I would,
nevertheless, use startswith(). Later, if users want my program to run
faster and my profiling shows a lot of the run-time is spent finding
words that start with 'a', I might switch.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
If a major portion
of the strings are in fact empty superpollo's condition should do even
better. But I didn't test and time that. Yet.
-Bryan Olson
# - timeit code -
from random import choice
from string import ascii_lowercase as letters
from timeit import Timer
strs = ['
Terry Reedy wrote:
[...]
> for k in [k for k in d if d[k] == 'two']:
> d.pop(k)
We have a winner.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
that's a reasonable solution.
On subtler issues, it constucts an unnecessarily long temporary list
in current Python 2.X, and fails in Python 3.x, as Terry Ready
explained.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
Adi Eyal wrote:
> > Bryan:
> > Terry Reedy wrote:
> > [...]
> >> for k in [k for k in d if d[k] == 'two']:
> >> d.pop(k)
>
> > We have a winner.
>
> also
>
> foo = lambda k, d : d[k] == "two"
> d = dict([(k,
;in'. The trick is to keep each element in both a
list and a hash table. Implementing Python's entire set interface is a
bit of project, so the code below just supports enough for a demo.
-Bryan Olson
#
from random import choice
class SetWithRandom:
def __init__(self, *arg
ing a user then
trying to log her in is a nice sequential unit of work that one thread
could handle. The reason for threading in this problem is so that when
one user's work is waiting for the network, you can make progress on
other users.
Hope that helps.
-Bryan Olson
--
http://mail.python.org/mailman/listinfo/python-list
(raw_bytes, 'Windows-1252')
Of course this all assumes that JB's database likes Unicode. If it
chokes, then alternatives include encoding back to utf-8 and storing
as binary, or translating characters to some best-fit in the set the
database supports.
--
--Bryan Olson
--
http://mail.python.org/mailman/listinfo/python-list
it creates a new pool of processes for
each function call that it might need to time-out. That's fixable, but
the question here is about a 30-second-plus processing problem, and in
that kind of case the overhead of creating one or a few new processes
is lost in the noise.
-Bryan Olson
#
sted this against the initial algorithm
plus Peter Pearson's optimization for numbers up to several thousand,
and it agrees... well, after I fixed stuff that is.
-Bryan Olson
# ---
_nds = {}
def ndsums(m, d):
""" How many d-digit ints' digits sum to m?
&
I wrote:
> I came up with a recursive memo-izing algorithm that
> handles 100-digit n's.
[...]
I made a couple improvements. Code below.
-Bryan
#-
_nds = {}
def ndsums(m, d):
""" Count d-digit ints with digits suming to m.
""
abandon the naive
algorithm.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
of the memo-
table and the work per entry. My prttn() calls ndsums() once for each
digit, so the whole thing is polynomial in the number of digits.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
es,
and the elements of a bytes object are ints. Something to check.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
arsing_py3 *does* work
> on Python 3. It is a puzzle.
I suspect in most cases you use bytes consistently. You got the
exception from:
instring[loc] in wt
If instring and wt are both bytes, that's fine. If they're both str,
also fine. If one is bytes and one is str, exception.
--
I wrote:
> My prttn() calls ndsums() once for each
> digit, so the whole thing is polynomial in the number of digits.
Correction: my prttn() function calls ndsums() at most 9 times per
digit of n. That still provides run time polynomial in the length of
the input.
--
--Bryan
--
I wrote:
> > I came up with a recursive memo-izing algorithm that
> > handles 100-digit n's.
Oops. I missed Richard Thomas's post. He posted the same algorithm a
couple days before.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
t". As Mark Dickinson's version uses a normal
dict(), which Bentley had already introduced under the name "associate
array", I'd say Mark's version is an improvement.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
to the same thing either way, so we might as well write it to be
readable by people. I can read D'Arcy's at a glance.
--
--Bryan Olson
--
http://mail.python.org/mailman/listinfo/python-list
ork() then hook stdout
directly to socket connected to the client with dup2(), then exec()
the command. But no need for that just to capture LaTeX's output.
--
--Bryan Olson
--
http://mail.python.org/mailman/listinfo/python-list
t, and we want to deliver the output of that command back to the
client. A brilliantly efficient method is to direct the command's
stdout to the client's connection.
Below is a demo server that sends the host's words file to any client
that connects. It assumes Unix.
--Bryan Olson
Sample = 0
or
FrameFormat.XUnion.binning = 0
And same for FrameFormat.YUnion. If you spell _fields_ as ctypes
requires, it will complain about your assignments, in that you are
trying to assign an in to a union. As your code is, those assignments
just make a new attribute to which you can assign anything.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
nt failed:
FrameFormat.XUnion.subSample = 0
Without _fields_, ctypes did not create a FrameFormat.XUnion member,
so the assignment fails with "AttributeError: 'LUCAM_FRAME_FORMAT'
object has no attribute 'XUnion'".
--
--Bryan Olson
--
http://mail.python.org/mailman/listinfo/python-list
;attribute2': ['attribute_value2'], 'attribute1':
['attribute_value']}
You'll note the values are lists, to handle the cases where a name is
equated to more than one simple value.
--
--Bryan Olson
--
http://mail.python.org/mailman/listinfo/python-list
of them hard to diagnose. I'd
suggest checking easy stuff first. Make sure 'dict' is still . If you can test again in the debugger in the error case, see
how large a set you can make, as the set implementation is similar to
dict except the hash table entries are one pointer shorter at 8 bytes.
--
--Bryan Olson
--
http://mail.python.org/mailman/listinfo/python-list
e on that level, but Emin seems to have worked his problem and
gotten a bunch of stuff right. There is no good reason why
constructing a 50 kilobyte dict should fail with a MemoryError while
constructing 50 megabyte lists succeeds.
--
--Bryan Olson
--
http://mail.python.org/mailman/listinfo/python-list
more than most of us ever wanted to know about
the subject.
I don't know of a module that does what GZ asks. There are scores of
line-oriented diff implementations, and there are minimal-edit-
distance diffs, but the combination is rare at best. Problem domains
that call for a true minimal d
import:
from reportlab.pdfgen import canvas
in the mkTable.py file. That brings 'canvas' into the mkTable module's
namespace.
Python programs commonly import the same module multiple times. Only
the first import runs the body of the imported module. Subsequent
imports merely bring the names into the importing module's namespace.
--
--Bryan Olson
--
http://mail.python.org/mailman/listinfo/python-list
In 2.6, the requirement changed from '(subclass of) dictionary' to
> 'mapping' so this is a bit strange. It sort of looks like a bug. I will
> test with 3.1 tomorrow (later today, actually).
I get the same bug-like behavior in 3.1. I think Peter is right that
it's p
kkumer wrote:
> Bryan wrote:
> > I get the same bug-like behavior in 3.1. I think Peter is right that
> > it's probably a side-effect of an optimization. kkumer seems to have
> > completely over-ridden the methods of dict, but if we insert into his
> > hubDic
ard to diagnose: The OP got the UnboundLocalError, so he looked
stuff up and tried various things, such as the global declaration, but
still got an exception. In writing it up, he copied the initial
exception, but a latter version of the function.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
clusion-exclusion
> sign *= -1
>
> # if M = 32, then 32, 22, 12, 2, -8
> M -= 10
> return s
It doesn't seem to work. I get no answer at all, because it recursion-
loops out when it calls fact() with a negative integer.
--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list
it's adaptable to
efficiently handle bases much larger than 10. Richard Thomas's
algorithm is poly-time and efficient as long as the base is small.
I'll take the liberty of tweaking your code to handle the 1 or 2 digit
case, and write the more general form. I'll also memoize fac
allows a known set of functions to be called?
> My gut feeling is that you open a can of worms here but I would
> appreciate your opinion.
Perhaps instead of restricting what functions ctypes can use, we could
restrict what modules can use ctypes. For example, maybe only modules
in ce
Given a class:
class Foo(object):
pass
How can I get the name "Foo" without having an instance of the class?
str(Foo) gives me more than just the name Foo. "__main__.Account"
Foo.__class__.__name__ gives me "type"
I don't want to do:
Foo().__class__.__name__ if possible. I would rather a
On Jun 24, 9:25 am, Tim Golden wrote:
> Bryan wrote:
> > Given a class:
>
> > class Foo(object):
> > pass
>
> > How can I get the name "Foo" without having an instance of the class?
>
> > str(Foo) gives me more than just the name Foo. &q
I am trying to automate rsync to backup server A from server B. I
have set up a private/public key between the two servers so I don't
have to enter a password when using rsync. Running rsync manually
with the following command works fine:
rsync -av --dry-run -e "/usr/bin/ssh -i /home/bry/keys/bry
On Jul 10, 12:43 pm, Piet van Oostrum wrote:
> >>>>> Chris Rebert (CR) wrote:
> >CR> On Fri, Jul 10, 2009 at 9:13 AM, Bryan wrote:
> >>> I am trying to automate rsync to backup server A from server B. I
> >>> have set up a private/public k
On Jul 10, 12:03 pm, mgi...@motorola.com (Gary Duzan) wrote:
> In article
> <3af970b1-b454-4d56-a33f-889ecfaca...@l28g2000vba.googlegroups.com>,
>
> Bryan wrote:
>
> >rsyncExec = '/usr/bin/ssh'
> >source = 'r...@10.0.45.67:/home/bry/jquery.lookup&
I have a backup script that runs fine when I run it manually from the
command line. When I run it with cron, the script stops running at
random points in the source code.
The script calls rsync with the subprocess module, which in turn uses
ssh to backup files from a box on my lan. It also uses
101 - 200 of 754 matches
Mail list logo