problem with multiple Py_Initialize/Py_Finalize calls

2006-03-06 Thread Andrew Trevorrow
id? If Py_Initialize/Py_Finalize should not be called multiple times then how can I tell Python to free all the memory used by an executed script? Yours in desperation, Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: pstats: negative time values

2005-04-30 Thread Andrew Dalke
better than without calibration. See also http://docs.python.org/lib/profile-calibration.html for information on how to change the calibration number. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Interrupting execution of PyRun_SimpleScript()

2005-04-30 Thread Andrew Dalke
tead it's caught by the top-level exception handler for the GUI, which reports the error. Is it possible to put an explicit "check this variable and if it's true then abort" in your time-intensive code? Andrew [EMAIL

Re: Doubt regarding python Compilation

2005-05-01 Thread Andrew Dalke
hinking of was used for teaching.) Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I parse this ? regexp ?

2005-05-01 Thread Andrew Dalke
w[, count]) Return a copy of the string with all occurrences of substring old replaced by new. If the optional argument count is given, only the first count occurrences are replaced. in your case x = x.replace('-',' ', 1) Andrew

Re: compare two voices

2005-05-01 Thread Andrew Dalke
e software recognize the correct word. If your word list is too short or recognizer not set well enough then saying something like "thud" will also be recognized as being close enough to "good". Why don't you just have the students hear both the teachers voice and t

Re: How to kill a SocketServer?

2005-05-01 Thread Andrew Dalke
to bother with Deferreds).""" which means it went a different route. Looks like a request comes in and is put to a work queue. Clients get from it. There's a special work queue item to tell the threads to stop. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrapping c functions

2005-05-01 Thread Andrew Dalke
ion and pointer included. Or use the Python extension API to make a new type. Searching the archives I see people have tried to write a Python/ FreeImage interface using SWIG. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: How to kill a SocketServer?

2005-05-01 Thread Andrew Dalke
# the request socket to blocking request, client_address = self.socket.accept() request.setblocking(1) return request, client_address Hmmm, and I've just copied and pasted the entire implementation of class CherryHTTPServer(BaseHTTPServer.HTTPServer)

Re: lists in cx_Oracle

2005-05-02 Thread Andrew Dalke
onversion. (I'm also fine with having to use ()s in the SQL query, as in "id in (:ids)".) The lack of a simple way to do this is error prone. I've seen people do cursor.execute("select * from tablename where id in (%s)" % repr(ids)) because the repr of a string is close enough that it works for expected string values. But it opens up the possibility of SQL injection problems. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: lists in cx_Oracle

2005-05-02 Thread Andrew Dalke
ly to use a close but wrong solution than this correct one. repr(ids) is after all much easier to write. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: lists in cx_Oracle

2005-05-02 Thread Andrew Dalke
"make a new string to execute". Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: control precision for str(obj) output?

2005-05-03 Thread Andrew Dalke
tailed chapter in the tutorial at http://docs.python.org/tut/node16.html ? Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: A Faster Way...

2005-05-10 Thread Andrew Dalke
s, do terms = [] for x in data: s = process_the_element(x) terms.append(s) s = "".join(data) rather than # this is slow if there are many string concatenations s = "" for x in data: s = s + process_the_element(x) Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: lists in cx_Oracle

2005-05-10 Thread Andrew Dalke
y the DB-API interface. If so, I now understand the limitation. H. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Need a little parse help

2005-05-11 Thread Andrew Dalke
.. >>> abc = ABC() >>> del abc I am here! >>> abc = ABC() >>> import sys >>> sys.exit() I am here! % There's documentation somewhere that describes what occurs during Python's exit, but I can't find it right now. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: optparse

2005-05-11 Thread Andrew Dalke
t types >>> class Spam: pass ... >>> o = types.InstanceType(Spam, {"x": 5, "y": 10}) >>> o.x 5 >>> My guess is the original intent was to make the command-line parameters act more like regular variables. They are easier to type (x.abc vs. x

Re: pyvm -- faster python

2005-05-12 Thread Andrew Dalke
duplicated code. One thought was that the cache miss caused some of the performance problems. Does that count as a compiler? Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib download insanity

2005-05-12 Thread Andrew Dalke
er lights, or use a web sniffer like ethereal, or set up a debugging proxy - check the headers. If your ISP is using a cache then it might insert a header into what it returns. But if it was caching then your IE view should have seen the cached version as well. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python features

2005-05-12 Thread Andrew Dalke
Peter Dembinski wrote: > If you want to redirect me to Google, don't bother. IMO ninety percent > of writings found on WWW is just a garbage. Sturgeon's law: Ninety percent of everything is crap. Andrew

Re: Unique Elements in a List

2005-05-12 Thread Andrew Dalke
le, Grover's algorithm http://en.wikipedia.org/wiki/Grover%27s_algorithm for searching an unsorted list solves the problem in O(N**0.5) time. Being even more picky, I think the largest N that's been tested so far is on the order of 5.

Re: Escape spaces in strings

2005-05-12 Thread Andrew Dalke
shell escapes. The module is standard with 2.4 but you can get the module and use it for 2.2 or 2.3. http://docs.python.org/lib/module-subprocess.html http://cvs.sourceforge.net/viewcvs.py/*checkout*/python/python/dist/src/Lib/subprocess.py

Re: question about the id()

2005-05-16 Thread Andrew Dalke
dec-refs the two methods, a.f first and a.g second. In this case the ref counts go to zero and the memory moved to the free list. At this point the stack looks like [11365872, 11492408, ... rest of stack ... ] You then do a.f. This pulls from the top of the stack so you get 11365872 ag

Re: Newbie : checking semantics

2005-05-16 Thread Andrew Dalke
have > quite some problems with only whitespace marking blocks (but it > also has some benefits). When you say "beginners" is that people with no previous programming experience or those who have done C/Java/etc. language which uses {}s?

Re: question about the id()

2005-05-16 Thread Andrew Dalke
data.append for x in some_other_data: work with x to make y data_append(y) Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie : checking semantics

2005-05-16 Thread Andrew Dalke
r 'class', the function or class name may # be repeated in the block-closing comment as well. Here is an # example of a program fully augmented with block-closing comments: # def foobar(a, b): #if a == b: #a = a+1 #elif a < b: #b = b-1 #

Re: ElemenTree and namespaces

2005-05-16 Thread Andrew Dalke
tp://online.effbot.org/2004_08_01_archive.htm#20040803 (starting with "more xml"). That was a response to Uche's article at http://www.xml.com/pub/a/2004/06/30/py-xml.html and with a followup at http://www.xml.com/pub/a/2004/08/11/py-xml.html Andrew

Re: Representing ambiguity in datetime?

2005-05-17 Thread Andrew Dalke
ke things more complicated than that. Some journals are published quarterly so an edition might be "Jan-Mar". Some countries refer to week numbers, so an event might be in "week 12". I offer no suggestions as to how to handle these cases.

Debugging from within emacs!

2005-05-18 Thread Andrew Markebo
Argh.. How do I debug my python-code from the inside of emacs, throw some breakpoints? and fire up the session, check backtraces and so on? /Andy Experimenting I have come this far: I have put a pdb.bat in my path, containing: "c:\Program Files\Python23\python.exe" -u "c:\Program

Re: Is Python suitable for a huge, enterprise size app?

2005-05-18 Thread Andrew Dalke
Ivan Van Laningham wrote: > ... Oh, it's interpreted, is it? Interesting." You can > see Python going down the sewer pipes, right on their faces. Nahh, the right answer is "It's byte-compiled, just like Java." Andrew

Re: SSL (HTTPS) with 2.4

2005-05-19 Thread Andrew Bushnell
ies fail as the "GET" request through the proxy is dismissed as a bad request. Any help is greatly appreciated. - Andrew Bushnell Bloke wrote: > Thanks Martin. > > The problem seems to lie with our company proxy (which requires > authentication). I have tried retri

Re: SSL (HTTPS) with 2.4

2005-05-19 Thread Andrew Bushnell
work, such as cURL etc. Thanks, Andrew Bloke wrote: > Andrew, > > It seems I'm not the only one going nuts here. I have just spent the > last 4 hrs stepping through the code in the debugger. It seems to get > stuck somewhere in the socket module (when it calls ssl) but have

Re: SSL (HTTPS) with 2.4

2005-05-19 Thread Andrew Bushnell
t; b) look around on the net for some patches to httplib (google is your friend) >be aware that these are quite old patches. > c) using some external solution, like pycURL. > > Andreas > > > On Thu, May 19, 2005 at 12:53:11PM -0400, Andrew Bushnell wrote: > >>Th

Re: SSL (HTTPS) with 2.4

2005-05-20 Thread Andrew Bushnell
needs to be told first to set up a secure > connection with the web site, and only then do you pass the url to the > proxy. > > > Bloke > -- Andrew Bushnell Lead Development Engineer Fluent Inc. 10 Cavendish Court Centerra Resource Park L

Re: performance of Nested for loops

2005-05-20 Thread Andrew Dalke
N): >do_job2 For this case compute the range once range_1 = range(1) for i in range_1: for j in range_1: do_job1() for j in range_1: do_job2() Using xrange(1) may be faster but you would need to test that out for your case.

Re: searching substrings with interpositions

2005-05-24 Thread Andrew Dalke
>>> make_pattern("atcg", 10) '(a).{,10}?(t).{,10}?(c).{,10}?(g).{,10}?' >>> pat = re.compile(make_pattern("atcg", 10)) >>> m = pat.search("tcgaacccgtagctaatttg") >>> m <_sre.SRE_Match object at 0x8ea70> >>> m.groups() ('a', 't', 'c', 'g') >>> for i in range(1, len("atcg")+1): ... print m.group(i), m.start(i), m.end(i) ... a 3 4 t 9 10 c 16 17 g 27 28 >>> Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: searching substrings with interpositions

2005-05-24 Thread Andrew Dalke
= q: raise AssertionError((q, t, limit, result, s)) if result is None and not is_valid: pass elif result is not None and is_valid: pass else: raise AssertionError( (q, t, limit, is_valid, result) ) if __name__ == "__main__": test() print "All tests passed." Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: open file in dir independently of operating system

2005-05-25 Thread Andrew Bushnell
is being run. On Unix I would > say: > > f = open(dir + '/configuration.smo', 'r') > > What is the os-independent version of this line? > > (I have read the manual of the module os, but I didn't see how to do > it.) > > > Jörg Schuster >

Re: IRIX MipsPro compiler chokes on Python.h

2005-05-25 Thread Andrew MacIntyre
platform to sort this out properly, but modifying pyconfig.h to correct the incorrect definitions should get you out of trouble. - Andrew I MacIntyre "These thoughts are mine alone..." E-mail: [EMAIL PROTECTED] (pref) | Snail: PO Box 370

Re: Build error Python 2.4.1 - stat problem?

2005-05-25 Thread Andrew MacIntyre
nes are set in your ./configure'd pyconfig.h. You may have to dig deeper still. ----- Andrew I MacIntyre "These thoughts are mine alone..." E-mail: [EMAIL PROTECTED] (pref) | Snail: P

Re: __init__() not called automatically

2005-05-26 Thread Andrew Koenig
"Sakesun Roykiattisak" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Does c++ call base class constructor automatically ?? > If I'm not wrong, in c++ you also have to call base class constructor > explicitly. In C++, if you don't call a base-class constructor (I am saying "a" ra

Intellisense and the psychology of typing

2005-05-26 Thread andrew . queisser
nguage IDEs? 3) Users of dynamic languages are always developing/debugging running programs where the current type of a variable is known and hence Intellisense is possible again? My own limited experience with dynamic languages (Ruby) is limited to edit-run cycles. Any opinions? Thanks, Andrew -- http://mail.python.org/mailman/listinfo/python-list

Re: Exiting SocketServer: socket.error: (98, 'Address already in use')

2005-05-30 Thread Andrew Dalke
/~fine/Tech/addrinuse.html You can set the class variable "allow_reuse_address = True" in your derived ExitableSocketServer to get the behaviour you expect, at the expense of some problems mentioned in the above URL. Andrew

Re: pickle alternative

2005-05-31 Thread Andrew Dalke
)[0] if code == "F": return unpack("!f", read(4))[0] if code == "L": count = unpack("!i", read(4)) return [_decode(read) for i in range(count)] if code == "D": count = unpack("!i", read(4)) return dict([_decode(read) for i in range(count)] ... Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Albatross 1.30 released

2005-05-31 Thread Andrew McNamara
ict HTML conformance. The solution is to wrap the input elements in div. * BranchingSession sessions could not be "deleted" - the solution is to add a dummy "session" shared by all branches, which is deleted when one branch "logs out". -- Andrew McNamara,

Re: pickle alternative

2005-05-31 Thread Andrew Dalke
ich should always be sizeof float these days, I think). Read these then use that information to figure out which decode/dispatch function to use. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: pickle alternative

2005-05-31 Thread Andrew Dalke
gt;>> t2-t1 0.22474002838134766 >>> len(s) 561 >>> t1=time.time();new_value=marshal.loads(s);t2=time.time() >>> t2-t1 0.3606879711151123 >>> new_value == value True >>> I can't reproduce your large times for marshal.dumps. Could you post yo

Re: pickle alternative

2005-06-01 Thread Andrew Dalke
return read(size) if code == "F": return unpack("!f", read(4))[0] if code == "B": size = unpack("!L", read(4))[0] return long(read(size), 16) raise DecodeError(code) dumps = encode loads = decode I wonder i

Re: pickle alternative

2005-06-01 Thread Andrew Dalke
simonwittber wrote: > It would appear that the new version 1 format introduced in Python 2.4 > is much slower than version 0, when using the dumps function. Interesting. Hadn't noticed that change. Is dump(StringIO()) as slow?

Re: any macro-like construct/technique/trick?

2005-06-01 Thread Andrew Dalke
ahem*, it avoids an unnecessary waste of the extra "if debug:" check. :) Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: any macro-like construct/technique/trick?

2005-06-01 Thread Andrew Dalke
, Call): args.append(arg()) else: args.append(arg) return self.f(*args) There's still the overhead of making the Call objects, but it shouldn't be that large. You can save a smidgeon by doing if debug: class Call: ... as defined earlier else: def Call(f,

Re: date and time range checking

2005-06-02 Thread Andrew Dalke
gt; r = InRange(t1, t2) >>> datetime.datetime(2005, 6, 7, 14, 00) in r False >>> datetime.datetime(2005, 6, 8, 14, 00) in r True >>> datetime.datetime(2005, 6, 9, 14, 00) in r True >>> datetime.datetime(2005, 6, 9, 18, 00) in r True >>> datetime.datetime(2005, 6, 10, 18, 00) in r False >>> Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Two questions

2005-06-02 Thread Andrew Dalke
f you really what to hide your code, you might like to think about > using C-extensions instead. Or go the Amazon/EBay/Google approach and provide only client access to your code. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Formatting Time

2005-06-02 Thread Andrew Dalke
.. >>> format_secs(0) '0:00:00' >>> format_secs(1) '0:00:01' >>> format_secs(59) '0:00:59' >>> format_secs(60) '0:01:00' >>> format_secs(61) '0:01:01' >>> format_secs(3600) '1:00:00' >>

Re: Two questions

2005-06-02 Thread Andrew Dalke
weapons. Include a DVD with the warhead (in a usable form for further development) and the GPL should be satisfied. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Two questions

2005-06-02 Thread Andrew Dalke
thers? There's an ethical obligation. I could modify the situation a bit; turn it into an assignment instead of a test, and have the user testing & QA with other classmates be part of the assignment but that sharing code isn't. Distributing a .pyc might be considered sufficient protection if a plagarism charge is investigated. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: provide 3rd party lib or not... philosophical check

2005-06-02 Thread Andrew Dalke
ers or who were okay with simple doing installation. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Formatting Time

2005-06-03 Thread Andrew Dalke
Coates, Steve (ACHE) wrote: >>>> import time >>>> t=36100.0 >>>> time.strftime('%H:%M:%S',time.gmtime(t)) > '10:01:40' But if t>=24*60*60 then H cycles back to 0 >>> import time >>> t=24*60*60 >>> time.st

Re: For review: PEP 343: Anonymous Block Redux and Generator Enhancements

2005-06-03 Thread Andrew Dalke
, type, value, traceback): for arg in self.args[::-1]: try: arg.__exit__(type, value, traceback) except: type, value, traceback = sys.exc_info() Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: For review: PEP 343: Anonymous Block Redux and Generator Enhancements

2005-06-03 Thread Andrew Dalke
ood? Particularly the _ part? I have not idea if the problem you propose (multiple with/as blocks) will even exist so I can't comment on which solution looks good. It may not be a problem in real code, so not needing any solution. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get name of function from within function?

2005-06-03 Thread Andrew Dalke
... >>> x = Spam() >>> x.funcA() A is called >>> x.funcB() Traceback (most recent call last): File "", line 1, in ? File "", line 10, in __getattr__ AttributeError: funcB >>> def funcBIMPL(): ... print "

Re: For review: PEP 343: Anonymous Block Redux and Generator Enhancements

2005-06-04 Thread Andrew Dalke
ision. It's the same rule so the rule would be "ahh, uses the 'as' form". Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: For review: PEP 343: Anonymous Block Redux and Generator Enhancements

2005-06-04 Thread Andrew Dalke
is that the new PEP may encourage more people to use indented blocks, in a way that can't be inferred by simply looking at existing code. In that case your proposal, or the one written with abc, defg(mutex) as D, server.lock() as L: .. may be needed. Andr

Re: For review: PEP 343: Anonymous Block Redux and Generator Enhancements

2005-06-04 Thread Andrew Dalke
ot;X", "Y") The inner with depends on the outer and must be closed in inverted order. > And if it *is* just equivalent to the nested with-statements, how often > will this actually be useful? Is it a common occurrence to need > multiple w

Re: any macro-like construct/technique/trick?

2005-06-05 Thread Andrew Dalke
't that prohibit using #comments in the macro-Python code? I suppose they could be made with strings, as in "here is a comment" do_something() but it's ... strange. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Software licenses and releasing Python programs for review

2005-06-06 Thread Andrew Dalke
/Corporate_personhood which is http://en.wikipedia.org/wiki/Talk:Corporate_personhood and read also http://en.wikipedia.org/wiki/Corporation Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: About size of Unicode string

2005-06-06 Thread Andrew Dalke
s true because the logical length of 'data' (which is a byte string) is equal to the number of bytes in the string, and the utf-8 encoding of a byte string with character values in the range 0-127, inclusive, is unchanged from the original string. In general, as if 'data' is a unicode strings, no. len() returns the logical length of 'data'. That number does not need to be the number of bytes used to represent 'data'. To get the bytes you must encode the object. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: the python way?

2005-06-06 Thread Andrew Dalke
undrobin(short, long)) Anyone know if/when roundrobin() will be part of the std. lib? The sf tracker implies that it won't be. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating file of size x

2005-06-06 Thread Andrew Dalke
-1) but I don't know if it's fully portable. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: split up a list by condition?

2005-06-07 Thread Andrew Dalke
; def bifilter(test, seq): ... seq1, seq2 = tee(seq) ... return ifilter(test, seq1), ifilterfalse(test, seq2) ... >>> bifilter("aeiou".__contains__, "This is another test") (, ) >>> map(list, _) [['i', 'i', 'a', 'o', 'e', 'e'], ['T', 'h', 's', ' ', 's', ' ', 'n', 't', 'h', 'r', ' ', 't', 's', 't']] >>> Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Fast text display?

2005-06-08 Thread Andrew Dalke
color, bold, italic and ] underline settings for a piece of text. Depending on what you want, curses talking to a terminal might be a great fit. That's how we did MUDs back in the old days. :) Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Fast text display?

2005-06-08 Thread Andrew Dalke
o could run in a terminal and display colored text via ANSI terminal controls, letting the terminal itself manage history and scrolling. I had some sort of TSR for the latter, under DOS. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Incorrect number of arguments

2005-06-09 Thread Andrew Dalke
ot;is callable" but on the parameter signature. For example, in C dalke% awk '{printf("%3d %s\n", NR, $0)}' tmp.c 1 2 int f(int x, int y) { 3 } 4 5 int g(int x) { 6 } 7 8 main() { 9 int (*func_ptr)(int, int); 10 func_ptr = f; 11 fun

Re: tail -f sys.stdin

2005-06-09 Thread Andrew Dalke
print time.time(), repr(line)" 1118335675.45 'a\n' 1118335675.45 'b\n' % ( echo "a" ; sleep 2 ; echo "b" ) | python -c "import sys, time\ while 1:\ line = sys.stdin.readline()\ if

Re: Is pyton for me?

2005-06-09 Thread Andrew Dalke
You should also read through the tutorial document on Python.org and look at some of the Python Cookbook.. Actually, start with http://wiki.python.org/moin/BeginnersGuide Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Developers Handbook

2005-06-10 Thread Andrew Dalke
is completely off-topic will most certainly guarantee that you get a lot of hate mail. Most assuredly, what Terry sent you is *not* hate mail. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Is pyton for me?

2005-06-10 Thread Andrew Dalke
http://sourceforge.net/tracker/index.php?func=detail&aid=1071764&group_id=5470&atid=305470 which says it's a 2.5ism. Oops! Sorry about that post from the future. I didn't realize it. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Developers Handbook

2005-06-10 Thread Andrew Dalke
Robert Kern wrote: > There is no moderator. We are all moderators. I am Spartacus! We are all Kosh. - Nicolas Bourbaki -- http://mail.python.org/mailman/listinfo/python-list

Re: Dealing with marketing types...

2005-06-11 Thread Andrew Dalke
unch of flat files in a directory, but that wasn't worth the time. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Dealing with marketing types...

2005-06-11 Thread Andrew Dalke
n a EnterpriseWeb-o-Rama (your "printing press") which can handle those examples you gave any better than starting off with a LAMP system and hand-caching the parts that need it? Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: ElementTree Namespace Prefixes

2005-06-12 Thread Andrew Dalke
chive is at http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/31b2e9f4a8f7338c/363f46513fb8de04?&rnum=3&hl=en Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Code documentation tool similar to what Ruby (on Rails?) uses

2005-06-12 Thread Andrew Dalke
a "cgi.escape()" to the text. Otherwise embedded [<>&] characters will be interpreted as HTML. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Dealing with marketing types...

2005-06-12 Thread Andrew Dalke
Paul Rubin wrote: > Andrew Dalke <[EMAIL PROTECTED]> writes: ... >> I found more details at >> http://jeremy.zawodny.com/blog/archives/001866.html >> >> It's a bunch of things - Perl, C, MySQL-InnoDB, MyISAM, Akamai, >> memcached. The linked

Re: new string function suggestion

2005-06-13 Thread Andrew Dalke
e handles it best self.name = self.name.rstrip3(".gz") Because your code throws an exception for what isn't really an exceptional case it in essence needlessly requires try/except/else logic instead of the simpler if/elif logic. > Does anyone else find this to be a common need? Has this been suggested > before? To summarize: - I don't think it's needed that often - I don't think your implementation's behavior (using an exception) is what people would expect - I don't think it does what you expect Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: What is different with Python ?

2005-06-13 Thread Andrew Dalke
my belief in a homologous line: proceeding from simple to detailed is the most appropriate way of learning. Of course in some fields even the simplest form takes a long time to understand, but programming isn't string theory. Andrew

Re: "also" to balance "else" ?

2005-06-13 Thread Andrew Dalke
ving more ways to do control flow doesn't make for code that's easy to read. My usual next step after thinking (or hearing) about a new Python language change is to look at existing code and see if there's existing code which would be easier to read/understand and get an idea if it&#x

Re: What is different with Python ?

2005-06-13 Thread Andrew Dalke
ar. Both fields may build new worlds, but success is measured by its impact in this world. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: "also" to balance "else" ?

2005-06-14 Thread Andrew Dalke
ady a strong bias against language features which exist only to do something another way but not a notably better way. > I'll try to find some use case examples tomorrow, it shouldn't be too > hard. It probably isn't the type of thing that going to make huge > differences.

Re: "also" to balance "else" ?

2005-06-14 Thread Andrew Dalke
7;finally' only called when the loop exited without a break. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: What is different with Python ?

2005-06-14 Thread Andrew Dalke
ledge about caches, the naive answer would be that > the programs will probably run double time. The reality is different. Okay, I admit I'm making a comment almost solely to have Andrea, Andreas and Andrew in the same thread. I've seen superlinear and sublinear performance for this.

Re: What is different with Python ?

2005-06-14 Thread Andrew Dalke
Peter Maas wrote: > Yes, but what did you notice first when you were a child - plants > or molecules? I imagine little Andrew in the kindergarten fascinated > by molecules and suddenly shouting "Hey, we can make plants out of > these little thingies!" ;) One of the first sci

Re: What is different with Python ?

2005-06-14 Thread Andrew Dalke
> (superstrings may be ? it was a name like that but I > don't really remember). If we had a machine that could reach Planck scale energies then I'm pretty sure there are tests. But we don't, by a long shot. Andrew Dalke -- http://mail.python.org/mailman/listinfo/python-list

Re: What is different with Python ?

2005-06-15 Thread Andrew Dalke
t; nearly optimal way. Have you read Richard Gabriel's "Worse is Better" essay? http://www.dreamsongs.com/WIB.html Section "2.2.4 Totally Inappropriate Data Structures" relates how knowing the data structure for Lisp affects the performance and seems relevant to your point.

Re: Python memory handling

2007-06-01 Thread Andrew MacIntyre
ternally not be using PyMalloc anyway, as the package is stated to be usable back to Python 1.5 - long before the current allocation management came into effect. In which case, you're at the mercy of the platform malloc... The pure Python ElementTree might play more your way, at

Re: Help with win32 com_error exception

2007-06-02 Thread Andrew Holme
"Richard Gordon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Sorry if this is sent twice, but I didn't see it get posted the first > time. > > I've got a fatal bug using Parente's pyTTS with Python 2.3 on Windoze 32 > using MS SAPI 5.1 and Hammond's win32 module. The test progr

Best architecture for proxy?

2007-07-10 Thread Andrew Warkentin
I am going to write a general-purpose modular proxy in Python. It will consist of a simple core and several modules for things like filtering and caching. I am not sure whether it is better to use multithreading, or to use an event-driven networking library like Twisted or Medusa/ Asyncore. Which w

Re: Best architecture for proxy?

2007-07-11 Thread Andrew Warkentin
On Jul 10, 8:19 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Bjoern Schliessmann wrote: > > Andrew Warkentin wrote: > > >> I am going to write a general-purpose modular proxy in Python. It > >> will consist of a simple core and several modules for things like

Domain Keys in Python

2007-04-20 Thread Andrew Veitch
hat I need to use something else for the final step? Thanks in advance Andrew -- http://mail.python.org/mailman/listinfo/python-list

Re: Domain Keys in Python

2007-04-20 Thread Andrew Veitch
--- Andrew Veitch <[EMAIL PROTECTED]> wrote: > In Perl I would just use Crypt:RSA which has a sign > method with an armour option which generates exactly > what I want but I can't find a way of doing this in > Python. I've worked it out, just for the archives the an

File not read to end

2007-04-25 Thread andrew . jefferies
ky. This is my first foray from Perl to Python so I appreciate any help. Thanks in advance. --Andrew -- http://mail.python.org/mailman/listinfo/python-list

<    6   7   8   9   10   11   12   13   14   15   >