Re: A simpler more pythonic approach to adding in

2006-01-18 Thread George Sakkis
;HOME']], ancestors(os.path.realpath('.'))): modules_dir = os.path.join(dir, 'modules') if os.path.exists(modules_dir): sys.path.insert(0,modules_dir) from foo import foo break HTH, George -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with "&" charater in xml.

2006-07-13 Thread George Bina
A SAX parser can notify a text node by calling any number of times the characters method so you need to accumulate all the information you receive on the characters method and output the text when you get a notification different than characters. Best Regards, George

Re: What is a type error?

2006-07-14 Thread George Neuner
ot;I don't write _ so I don't need [whatever language feature enables writing it]". It is important, however, to be aware of the limitation and make your choice deliberately. George -- for email reply remove "/" from address -- http://mail.python.org/mailman/listinfo/python-list

Re: Project organisation

2006-07-19 Thread Harry George
ommon util.py in a package called "globals". That could get really confusing. You might make it a standalone package, or maybe use "utilities" or "common". -- Harry George PLM Engineering Architecture -- http://mail.python.org/mailman/listinfo/python-list

Re: json implementation

2006-07-25 Thread Harry George
but TurboGears uses json-py. https://sourceforge.net/projects/json-py/ -- Harry George PLM Engineering Architecture -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Projects Continuous Integration

2006-07-28 Thread Harry George
fter language, decade after decade, platform after platform. Use your brain cells form something useful, like learning new technologies and new algorithms. -- Harry George PLM Engineering Architecture -- http://mail.python.org/mailman/listinfo/python-list

Re: excel in unix?

2006-08-11 Thread Harry George
you need more than csv, start writing to to the OpenOffice.org formats, either with your own code or via PyUNO. Then use OOo itself or a MS-sponsored ODF reader to translate to Excel format. This should be a maintainable approach over time (but a lot more complex than just csv). -- Harry George

Re: Python form Unix to Windows

2006-08-17 Thread Harry George
nix. YMMV > > Peace, > ~Simon > I agree with this-- just try it. When I've helped others move code, I found the biggest problem was when they had hardcoded file paths instead of using os.path mechanisms. -- Harry George PLM Engineering Architecture -- http://mail.python.org/mailman/listinfo/python-list

python 2.5 build problem on AIX 5.3

2006-10-11 Thread George Trojan
01 603 604 PPC64 620 A35 PWR4 PWR5 970 PPC970 PWR6 ANY export OBJECT_MODE=64 cd $TOOLS/src/Python-2.5-cc ./configure --prefix=$TOOLS/Python-2.5-cc --with-gcc="xlc_r -q64" --with-cxx="xlC_r -q64" --disable-ipv6 AR="ar -X64" George -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: What's up with the starship?

2006-10-15 Thread George Sakkis
[EMAIL PROTECTED] wrote: > Robert Hicks wrote: > > [EMAIL PROTECTED] wrote: > > > T. Bryan wrote: > > > > Thomas Heller wrote: > > > > > > > > > I cannot connect to starship.python.net: neither http, nor can I login > > > > > interactively with ssl (and the host key seems to have changed as > > >

Re: python's OOP question

2006-10-15 Thread George Sakkis
() The same works as is on modifying individual instances, rather than their class: def test2(): o = C3() addMethod(C2.m, o) addMethod(C1.v, o) o.m() # raises AttributeError # C3().m() George -- http://mail.python.org/mailman/listinfo/python-list

Re: string splitting

2006-10-17 Thread George Sakkis
on. > So based on the files above, I want returned: > state > district > province def extract(s): return s[s.rfind('_')+1:s.rfind('.')] George -- http://mail.python.org/mailman/listinfo/python-list

Re: creating many similar properties

2006-10-18 Thread George Sakkis
def make_class(clsname, bases, dict): for name,default in chain(izip(names, repeat(127)), defaulted_names.iteritems()): assert name not in dict # sanity check dict[name] = byte_property('_'+name, default) return type(clsname,bases,dict) return make_class class RC(object): __metaclass__ = ByteProperties('pwm01', pwm02=64) rc = RC() print rc.pwm01, rc.pwm02 # 127 64 rc.pwm01 = 1312 print rc.pwm01, rc.pwm02 # 32 64 George -- http://mail.python.org/mailman/listinfo/python-list

Re: creating many similar properties

2006-10-18 Thread George Sakkis
clsdict[sym] = property(_get,_set) > return type.__new__(metatype,name,bases,clsdict) > > class RC(object): > __metaclass__ = mod256metatype > __mod256__ = ["pwm01","pwm02"] There's a subtle common bug here: all _get and _set clo

Re: Getting method name from within the class method

2006-10-18 Thread George Sakkis
ames, don't copy and paste this all over the place; use a decorator instead so that you can just write: class test(object): @print_name def a_method(self,this,that): pass @print_name def b_method(self,this,that): pass The definition of print_name is lef

Set operations in Numeric

2006-10-23 Thread George Sakkis
the docs didn't make clear if it is possible. Thanks, George -- http://mail.python.org/mailman/listinfo/python-list

Re: Set operations in Numeric

2006-10-23 Thread George Sakkis
Robert Kern wrote: > George Sakkis wrote: > > Is there a way to handle numeric (or numarray or numpy) arrays as sets > > and compute efficiently their intersection, union, etc. ? I hope there > > is a faster way than s = array(set(A) & set(B)). Can this be done with >

Re: Looking for a Python-on-Windows person to help with SpamBayes

2006-10-23 Thread George Sakkis
Does "remove my unix-think" mean replacing it with equivalent Windows-think (e.g through Win32all, Win32 API, COM) or it can be done in platform-independent way ? In the second case I might be able to help as I'm using SpamBayes with Outlook at work, but I don't do windows

Re: question about True values

2006-10-25 Thread George Sakkis
objects. A notable exception are numarray arrays (probably true for numpy too, I haven't tested it though): >>> from numarray import array >>> bool(array([1,2])) Traceback (most recent call last): File "", line 1, in ? RuntimeError: An array doesn't make sense as a truth value. Use any(a) or all(a). George -- http://mail.python.org/mailman/listinfo/python-list

Fatal Python error: deallocating None

2006-10-25 Thread George Sakkis
take days to finish normally, so I want it to run overnight too. Any hints ? Thanks, George -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the best IDE?

2006-10-26 Thread Harry George
all the customizing that I could never figure out. years ago this worked for people I was supporting: set softtabstop=4 shiftwidth=4 expandtab Personally, I'm an emacs guy, so I wouldn't know. -- Harry George PLM Engineering Architecture -- http://mail.python.org/mailman/listinfo/python-list

Re: NumPy 1.0 release

2006-10-26 Thread George Sakkis
s for Ubuntu, which I'd gladly do if it was up to me). By the way, it would be great if numpy's mailing list was mirrored to a google group; sourceforge and gmane are just horrible to use. Best regards, George -- http://mail.python.org/mailman/listinfo/python-list

Re: NumPy 1.0 release

2006-10-26 Thread George Sakkis
Robert Kern wrote: > George Sakkis wrote: > > ImportError: > > /usr/local/lib/python2.4/site-packages/numpy/linalg/lapack_lite.so: > > undefined symbol: zheevd_ > > > > Googling for "undefined symbol: zheevd_" returned no hits, at which > > point

Re: Python tools for managing static websites?

2006-10-31 Thread Harry George
instead. 2. If there must be human-in-the-loop, then it is good to use a markup language which can be converted to html (or to other backends). Perrl's POD format is one, and I've done that as a Pdx. http://www.seanet.com/~hgg9140/comp/index.html http://www.seanet.com/~hgg91

High level csv reader

2006-10-31 Thread George Sakkis
round csv.reader that does all this ? Thanks, George -- http://mail.python.org/mailman/listinfo/python-list

Re: High level csv reader

2006-11-01 Thread George Sakkis
[EMAIL PROTECTED] wrote: > George> It occured to me that most times I read a csv file, I'm often > George> doing from scratch things like assigning labels to columns, > George> mapping fields to the appropriate type, ignoring some fields, > George> changin

Re: tips requested for a log-processing script

2006-11-05 Thread George Sakkis
ering will also be faster, as for each record you just have to do a bitwise AND with the 0..010...0 mask corresponding to a given month. George -- http://mail.python.org/mailman/listinfo/python-list

Re: simple way to un-nest (flatten?) list

2006-11-05 Thread George Sakkis
7;Aslib'), ('JDOC', 'jdoc')] > > I would like to do > > [line for line in table if line[7] in ('JDOC','jdoc','Aslib','ASLIB')] > > so how should I get from > {'a':('ASLIB','Aslib'),'j':('JDOC','jdoc')} > to > ('Aslib','ASLIB','JDOC','jdoc') Meet itertools: from itertools import chain names = set(chain(*r.itervalues())) print [line for line in table if line[7] in names] George -- http://mail.python.org/mailman/listinfo/python-list

Re: object data member dumper?

2006-11-07 Thread George Sakkis
nice xml dump of the object which isn't necessarily reversible. Here's the output for your example: 3 4 3 5 11 12 3 2 If you find it suits you better, I'll try to make it available somewhere (probably in the cookbook). George -- http://mail.python.org/mailman/listinfo/python-list

Re: unpickling Set as set

2006-11-08 Thread George Sakkis
le as pickle Set.__reduce__ = lambda self: (set, (self._data,)) s = Set([1,2,3]) x = pickle.dumps(s) print pickle.loads(x) This doesn't work though if you have already pickled the Set before replacing its __reduce__, so it may not necessarily be what you want. If there is a way around it, I'd like to know it. George -- http://mail.python.org/mailman/listinfo/python-list

Re: how is python not the same as java?

2006-11-09 Thread George Sakkis
how are BMWs not the same with Yugos ? both have four wheels and burn gasoline. -- http://mail.python.org/mailman/listinfo/python-list

manual eggs downloads?

2006-11-10 Thread Harry George
ckages is ok. A web page simple listing the third party sites and the recommended downloads is ok. Automatically downloading is not ok. Is there some way in the eggs mechanism to just get a list of the proposed downloads, and let the user take the actions manually? -- Harry George PLM Engineering A

Re: Inheritance Question

2006-11-10 Thread George Sakkis
d_walk(*args, **kwds) # more commands def _specialized_walk(self, *args): raise NotImplementedError class UnipedalCreature(Creature): def _specialized_walk(self, *args, **kwds): # blahblah class BipedalCreature(Creature): def _specialized_walk(self, *args, **kwds): # blahblah

Re: handling many default values

2006-11-11 Thread George Sakkis
s question, your approach is totally reasonable and well-known; the csv.Dialect class for example is exactly this, a parameter-holding class. George -- http://mail.python.org/mailman/listinfo/python-list

Re: reduce to be removed?

2006-11-12 Thread George Sakkis
usually both faster and more elegant for array manipulations than pure python. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-12 Thread George Sakkis
ge(5) + range(7,9) assert list(irange(5) + irange(7,9)) == s assert list(irange(5) + range(7,9)) == s assert list(range(5) + irange(7,9)) == s s = range(5) * 3 assert list(irange(5) * 3) == s assert list(3 * irange(5)) == s George -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-13 Thread George Sakkis
Fredrik Lundh wrote: > George Sakkis wrote: > > > The base object class would be one candidate, similarly to the way > > __nonzero__ is defined to use __len__, or __contains__ to use __iter__. > > > > Alternatively, iter() could be a wrapper type (or perhaps mi

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-13 Thread George Sakkis
Carl Banks wrote: > George Sakkis wrote: > > Fredrik Lundh wrote: > > > > > George Sakkis wrote: > > > > > > > The base object class would be one candidate, similarly to the way > > > > __nonzero__ is defined to use __len__, or __contai

Re: Python development time is faster.

2006-11-13 Thread Harry George
ctor, that is easy too. c) Peer code reviews are easy -- both you and the reviewers can understand the code's intent at a glance. -- Harry George PLM Engineering Architecture -- http://mail.python.org/mailman/listinfo/python-list

Re: Python development time is faster.

2006-11-13 Thread George Sakkis
e I used... never bothered to deal with java's verbosity after that. It's a pity that jython resembles abandon-ware these days, when jRuby showed up pretty recently and is gaining in penetration with the java crowd. It will be a non-trivial loss for python if it is left behind in the JVM world (at least if the latter is not swallowed by the .NET dark forces, which doesn't seem to happen any time soon ;-). George -- http://mail.python.org/mailman/listinfo/python-list

Re: Will GPL Java eat into Python marketshare?

2006-11-15 Thread Harry George
ally change Java's architecture. It is still a closed world of reinvent-the-wheel, my-way-or-the-highway. Which is antithetical to Python's promiscuous interface-with-anything approach. -- Harry George PLM Engineering Architecture -- http://mail.python.org/mailman/listinfo/python-list

Re: Will GPL Java eat into Python marketshare?

2006-11-16 Thread Harry George
raries (as > > jar files) into CPython. > > http://sourceforge.net/projects/jpype > > > Personally, I've never gotten jpype to work. Is it just me, or is it a troublesome install? -- Harry George PLM Engineering Architecture -- http://mail.python.org/mailman/listinfo/python-list

Re: Will GPL Java eat into Python marketshare?

2006-11-16 Thread Harry George
Java has layers upon layers upon layers of idiosyncratic libraries and idioms. When you write bindings to that world (even if the bindings are generated automagically), you have to *think* in those same layers. The Python-oriented developer suddenly has to use a dozen imports in order to do thing

Re: Array? Please help.

2006-05-28 Thread George Sakkis
Diez B. Roggisch wrote: > George Sakkis schrieb: > > Diez B. Roggisch wrote: > >> Dr. Pastor schrieb: > >>> I need a row of 127 bytes that I will use as a > >>> circular buffer. Into the bytes (at unspecified times) > >>> a mark (0 >>&g

Re: ideas for programs?

2006-05-31 Thread George Sakkis
u don't have to start from scratch: http://mondrian.sourceforge.net. George -- http://mail.python.org/mailman/listinfo/python-list

Re: How do you practice Python?

2006-06-01 Thread Harry George
7;@')])" > Do projects at home. Either find an existing OSS project, or roll your own. Once you have the basics of the language, the skills are domain-specific: XML, GUIs, CAD, gaming, multithreading, numerical analysis, natural language progromming, etc. If you do an existing project, then you benefit from peer reviews and other informal learning opportunities. -- Harry George PLM Engineering Architecture -- http://mail.python.org/mailman/listinfo/python-list

Re: argmax

2006-06-01 Thread George Sakkis
e; OTOH having all imports at the top of the module makes easier to see the module's dependencies without grep'ing for import (that's especially useful for non-standard imported modules or new additions ot the std lib if backwards compatibility is an issue). George -- http://mail.python.org/mailman/listinfo/python-list

Re: Open Source Charting Tool

2006-06-05 Thread Harry George
that I have to do it from scratch. > > > > Is there any open source charting tool that help me create charts in JPG or > gif format? > > > > Thanks, > > Alan > > See pygdchart http://www.nullcube.com/software/pygdchart.html -- Harry George PLM Engineering Architecture -- http://mail.python.org/mailman/listinfo/python-list

Re: How to link foreign keys & primary keys using python?

2006-06-09 Thread Harry George
our data sinks. 4. Do you have a testsuite and test harness? Put together your test harness, then develop for the simplest case, then add complexity. E.g., no FK, FK with 1 attr, FK with multiple attrs, FKs with shared attrs. -- Harry George PLM Engineering Architecture -- http://mail.python.org/mailman/listinfo/python-list

Re: Allowing zero-dimensional subscripts

2006-06-09 Thread George Sakkis
sting. Will it be related at all to OLAP or the Multi-Dimensional eXpressions language (http://msdn2.microsoft.com/en-us/library/ms145506.aspx) ? George -- http://mail.python.org/mailman/listinfo/python-list

Re: Allowing zero-dimensional subscripts

2006-06-10 Thread George Sakkis
[EMAIL PROTECTED] wrote: > George Sakkis wrote: > > [EMAIL PROTECTED] wrote: > > > > > However, I'm designing another library for > > > managing multi-dimensional arrays of data. Its purpose is similiar to > > > that of a spreadsheet - analyze

Re: Algorithm for Labels like in Gmail

2006-06-10 Thread George Sakkis
D<--- EmailID ID subjectLabelID ---> name ... ... Then you can associate mails to labels by joining all three tables together on the IDs. Of course you can implement this in memory as well but you should probably want to store them in so

Re: Very newbie programming

2006-06-11 Thread George Sakkis
f 'URL=/media' in line : icon = instream.filename() dvc = line[11:-1] break Btw, you can delete a file or directory with os.unlink and os.rmdir, respectively; no need for os.system. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Xah Lee network abuse

2006-06-11 Thread George Neuner
air's policy would be unprovable supposition at the time of the writing (as would Blair's own) and would therefore not be libelous. However, if your opinion took an accusatory tone saying, for example, that he was increasing the public deficit to line his pockets, then you had better be right. George -- for email reply remove "/" from address -- http://mail.python.org/mailman/listinfo/python-list

Re: question on dict subclassing and overriding __setitems__

2006-06-13 Thread George Sakkis
o the "old way". Good to know that I can safely get rid of practically all super() calls. Any python-dev-er's take on super()'s utility and future in Py3K ? George -- http://mail.python.org/mailman/listinfo/python-list

Re: __cmp__ method

2006-06-14 Thread George Sakkis
> gives you the below in the right order... Or even better in 2.4 or later: sorted([a,b,c], key=len) George -- http://mail.python.org/mailman/listinfo/python-list

Re: split with "*" in string and ljust() puzzles

2006-06-14 Thread George Sakkis
else ;) > If you have comma separated list '1,,2'.split(',') naturally returns > ['1', '', '2']. I think you can get what you want with a simple regexp. No need for regexp in this case, just use None to specify one or more whitespace chars as

Re: nested functions

2006-06-14 Thread George Sakkis
without such constructs, and use the profiler to find out. It shouldn't come as a surprise if it turns out to be slower, since the nested function is redefined every time the outer is called. If you actually call the outer function a lot, you'd better profile it. George -- http://mail.python.org/mailman/listinfo/python-list

Re: nested functions

2006-06-15 Thread George Sakkis
Duncan Booth wrote: > Fredrik Lundh wrote: > > > George Sakkis wrote: > > > >> It shouldn't come as a surprise if it turns out to be slower, since > >> the nested function is redefined every time the outer is called. > > > > except that it i

Pickling gotcha

2006-06-15 Thread George Sakkis
nor new style instances if __getstate__ returns a false valse, without any further justification. Any pointers on the rationale for making a special case just out of the blue ? George -- http://mail.python.org/mailman/listinfo/python-list

Re: any subway web dev experiences

2006-06-18 Thread George Sakkis
a wrote: > subway is pythons ruby on rails competitor > pls tell me if u hav any expereinces > thanks u wanna know reils n subway ur so kewl omg! no expereinces watsoevah, sori dud PS: If you want to be taken seriously, put at least some effort to make a readable english sentence. This is comp.

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread George Neuner
I am, however, going to ask what information you think type inference can provide that substitutes for algorithm or data structure exploration. George -- for email reply remove "/" from address -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread George Neuner
On 19 Jun 2006 13:53:01 +0200, [EMAIL PROTECTED] (Torben Ægidius Mogensen) wrote: >George Neuner writes: > >> On 19 Jun 2006 10:19:05 +0200, [EMAIL PROTECTED] (Torben Ægidius >> Mogensen) wrote: > >> >I expect a lot of the exploration you do with incomplete progr

Re: Calling every method of an object from __init__

2006-06-19 Thread George Sakkis
elf,inspect.ismethod): if name.startswith('dump_'): method() def dump_f(self): print 'The test method' def dump_g(self): print 'Hello user' if __name__ == '__main__': Foo() George -- http://mail.python.org/mailman/listinfo/python-list

Re: crawlers in python with graphing?

2006-06-20 Thread George Sakkis
R. > > Cheers, > Bryan Rasmussen Harvestman (http://harvestman.freezope.org/) is your best bet. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Specifing arguments type for a function

2006-06-20 Thread George Sakkis
e often than not handled as scalars although they are typically iterables. Also tuples may or may not be considered as iterables, depending on what they are used for. The definition of scalar is application-dependent, that's why there is not an isscalar() builtin. George -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread George Neuner
s. The runtime computation of an illegal index value is not prevented by narrowing subtypes and cannot be statically checked. George -- for email reply remove "/" from address -- http://mail.python.org/mailman/listinfo/python-list

Re: TEST IGNORE

2006-06-20 Thread George Sakkis
David Hirschfield wrote: > Having email trouble... > Having bathroom trouble... can I help myself at your house entrance ? Didn't think so... -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread George Neuner
On Wed, 21 Jun 2006 16:12:48 + (UTC), Dimitri Maziuk <[EMAIL PROTECTED]> wrote: >George Neuner sez: >> On Mon, 19 Jun 2006 22:02:55 + (UTC), Dimitri Maziuk >><[EMAIL PROTECTED]> wrote: >> >>>Yet Another Dan sez: >>> >>>... Requ

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread George Neuner
p://okmij.org/ftp/Haskell/types.html#branding That was interesting, but the authors' method still involves runtime checking of the array bounds. IMO, all they really succeeded in doing was turning the original recursion into CPS and making the code a little bit clearer. George -- for ema

(Iron)Python on new MS robotics platform

2006-06-22 Thread George Sakkis
"Both remote (PC-based) and autonomous (robot-based) execution scenarios can be developed using a selection of programming languages, including those in Microsoft Visual Studio® and Microsoft Visual Studio Express languages (Visual C#® and Visual Basic® .NET), JScript® and Microsoft IronPython 1.0

Re: Status of optional static typing in Python?

2006-06-22 Thread George Sakkis
hen Guido's planning to work that stuff into Python? The last post > I noticed from him on the topic was from 2005. At least back then he > sounded pretty into it. I wouldn't count on it if I was to start a project sometime soon. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Specifing arguments type for a function

2006-06-22 Thread George Sakkis
Bruno Desthuilliers wrote: > George Sakkis a écrit : > > This is ok - in theory. In practice I've found that e.g. strings are > > more often than not handled as scalars although they are typically > > iterables. > >>> hasattr('', '__ite

Re: String negative indices?

2006-06-22 Thread George Sakkis
kinda defeats the purpose of > the negative subscripts anyway. > > Is there some magic I'm missing here? Wouldn't it actually be better for > Python to treat 0 as a special case here, so that x[-2:0] and x[-2:] > generated the same result? > > --Tim x[-2:None] I

Re: Specifing arguments type for a function

2006-06-22 Thread George Sakkis
Dennis Lee Bieber wrote: > On 22 Jun 2006 16:48:47 -0700, "George Sakkis" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > What does __setitem__ have to do with iterability ? > > It confirms that the object is indexable, and muta

Re: Specifing arguments type for a function

2006-06-23 Thread George Sakkis
Dennis Lee Bieber wrote: > On 22 Jun 2006 22:55:00 -0700, "George Sakkis" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > Ok, I'll try once more: What does __setitem__ have to do with > > **iterability**, not mutability or i

Flight search automation

2006-06-23 Thread George Sakkis
I'm trying to use mechanize to fill in a "find a flight" form and then get back the results, but I'm not sure how to make it wait until the results page appears; the response after submitting the form is the "please wait while we are searching for your flights" page.

Re: Flight search automation

2006-06-23 Thread George Sakkis
o a waiting page, hopefully I can figure them out once I have one working. George > George Sakkis wrote: > > I'm trying to use mechanize to fill in a "find a flight" form and then > > get back the results, but I'm not sure how to make it wait until the > > result

Re: search engine

2006-06-24 Thread George Sakkis
implement. By then you should have a much better idea of what modules to look for. George -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-25 Thread George Neuner
r complete. Again, implementations went in both directions. Some allowed either method by switch, but the type compatibility issue continued to plague Pascal until standard conforming compilers emerged in the mid 80's. George -- for email reply remove "/" from address -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-25 Thread George Neuner
On Sun, 25 Jun 2006 13:42:45 +0200, Joachim Durchholz <[EMAIL PROTECTED]> wrote: >George Neuner schrieb: >> The point is really that the checks that prevent these things must be >> performed at runtime and can't be prevented by any practical type >> analysis perfo

Re: What is Expressiveness in a Computer Language

2006-06-26 Thread George Neuner
On Sun, 25 Jun 2006 14:28:22 -0600, Chris Smith <[EMAIL PROTECTED]> wrote: >George Neuner wrote: >> >Undecidability can always be avoided by adding annotations, but of >> >course that would be gross overkill in the case of index type widening. >> >>

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread George Neuner
On Mon, 26 Jun 2006 13:02:33 -0600, Chris Smith <[EMAIL PROTECTED]> wrote: >George Neuner wrote: > >> I worked in signal and image processing for many years and those are >> places where narrowing conversions are used all the time - in the form >> of floating

Re: [OT] Prolog and Regular Expressions, Was: Re: perspective on ruby

2006-06-29 Thread Harry George
using the embedding libraries and bindings. -- Harry George PLM Engineering Architecture -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a type error?

2006-07-09 Thread George Neuner
static type checker does the conversion automatically, then obviously types are not static and can be changed at runtime. Either way you've failed to prevent a runtime problem using a purely static analysis. George -- for email reply remove "/" from address -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a type error?

2006-07-11 Thread George Neuner
is Smith's assertions to the contrary). It seems to me that the code complexity of such a super-duper inferencing system would make its bug free implementation quite difficult and I personally would be less inclined to trust a compiler that used it than one having a less capable (but easie

Re: Syntax suggestion.

2006-08-30 Thread George Sakkis
samir wrote: > Saluton! > > Being a fond of Python, I had this idea: Why not making Python a Unix > shell? It's been done; it's called "IPython": http://ipython.scipy.org/doc/manual/manual.html George -- http://mail.python.org/mailman/listinfo/python-list

Re: disgrating a list

2006-09-01 Thread George Sakkis
oll one on your own, e.g. using a recursive generator; in fact, if you had searched for "flatten" in the google group of c.l.py, you'd find this: http://tinyurl.com/ndobk George -- http://mail.python.org/mailman/listinfo/python-list

Re: Incremental Progress Report object/closure?

2006-09-01 Thread George Sakkis
the bill: http://aspn.activestate.com/ASPN/search?query=progress+bar&x=0&y=0§ion=PYTHONCKBK&type=Subsection HTH, George -- http://mail.python.org/mailman/listinfo/python-list

Re: disgrating a list

2006-09-01 Thread George Sakkis
in x: for subelem in flatten(elem): yield subelem Or if you want to modify the argument list in place, as in Neil's solution: def flatten_in_place(x): x[:] = flatten(x) George -- http://mail.python.org/mailman/listinfo/python-list

Re: str.isspace()

2006-09-03 Thread George Sakkis
Jean-Paul Calderone wrote: > On 3 Sep 2006 09:20:49 -0700, [EMAIL PROTECTED] wrote: > >Are you using the str.isspace() method? I don't use it, so if most > >people don't uses it, then it may be removed from Py 3.0. > > > >I usually need to know if a string contains some non-spaces (not space > >cl

Re: Better way to replace/remove characters in a list of strings.

2006-09-04 Thread George Sakkis
; with 'b': > > x = map(lambda foo: foo.replace('a', 'b'), x) Or more pythonically: x = [s.replace('a', 'b') for s in x] George -- http://mail.python.org/mailman/listinfo/python-list

Re: replace deepest level of nested list

2006-09-04 Thread George Sakkis
s? > > Thanks, > Alan Isaac Numeric/Numpy is ideal for this: from Numeric import array def slicelist(nestedlist,index): a = array(nestedlist,'O') # return the slice a[:,:,...,:,index] fullindex = [slice(None)] * len(a.shape) fullindex[-1] = index return a[fullindex].tolist() George -- http://mail.python.org/mailman/listinfo/python-list

Re: Test for number?

2006-09-04 Thread George Sakkis
ber not in [1,20]), handle the second one as "Do_C" instead of raising ValueError. HTH, George -- http://mail.python.org/mailman/listinfo/python-list

Re: Test for number?

2006-09-05 Thread George Sakkis
Neil Cerutti wrote: > On 2006-09-04, George Sakkis <[EMAIL PROTECTED]> wrote: > > x=raw_input('\nType a number from 1 to 20') > > try: > > x = int(x) > > if x<1 or x>20: raise ValueError() > > except ValueError: > > D

Re: Better way to replace/remove characters in a list of strings.

2006-09-05 Thread George Sakkis
>>> y = x >>> x = [s.replace('a', 'b') for s in x] # rebind to new list >>> y is x False 2) >>> x = ["a","123a","as"] >>> y = x >>> x[:] = [s.replace('a', 'b')

Re: Refactor a buffered class...

2006-09-06 Thread George Sakkis
ld buf s = " this . is a . test to . check if it . works . well . it looks . like ." for p in chunker(s.split(), keep_last=True, keep_first=True): print p George -- http://mail.python.org/mailman/listinfo/python-list

Re: Refactor a buffered class...

2006-09-07 Thread George Sakkis
Michael Spencer wrote: > George Sakkis wrote: > > Michael Spencer wrote: > > > >> Here's a small update to the generator that allows optional handling of > >> the head > >> and the tail: > >> > >> def chunker(s, chun

Re: change property after inheritance

2006-09-07 Thread George Sakkis
; It could be written as:: Sure, it *could*; whether it *should* is a different issue. I can't imagine a case for absolute *need* of lambda, but there are several cases where it is probably the best way, such as the one of this thread. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Refactor a buffered class...

2006-09-07 Thread George Sakkis
ve objects rather than > 'small code snippets'. Requiring source code input and passing arguments by > string substitution makes it too painful for interactive work. The need to > specify the number of repeats is an additional annoyance. timeit is indeed somewhat cumbersome

<    1   2   3   4   5   6   7   8   9   10   >