Re: How to query a function and get a list of expected parameters?

2006-09-29 Thread George Sakkis
l): >>> from inspect import getargspec >>> getargspec(f) (['x1', 'x2'], None, None, None) George -- http://mail.python.org/mailman/listinfo/python-list

Re: How to iterate through a sequence, grabbing subsequences?

2006-09-29 Thread George Sakkis
yield s[i:i+chunksize] > > I wrote this because I need to take a string of a really, really long > length and process 4000 bytes at a time. > > Is there a better solution? There's not any builtin for this, but the same topic came up just three days ago: http://tinyurl.com/qec2

Re: Can string formatting be used to convert an integer to its binary form ?

2006-09-28 Thread George Sakkis
s = array('c') while n>0: s.append('01'[n&1]) n >>= 1 s.reverse() return s.tostring() or '0' try: import psyco except ImportError: pass else: psyco.bind(fast2bin) George -- http://mail.python.org/mailman/listinfo/python-list

Re: Can string formatting be used to convert an integer to its binary form ?

2006-09-28 Thread George Sakkis
y discovered the joy of obfuscated python thanks to the Code Golf challenges, here's the shortest non-recursive function I came up with (all integers, signed): f=lambda n:'-'[:n<0]+''.join(str(m&1)for m in iter( lambda x=[abs(n)]:(x[0],x.__setitem__(0,x[0]>>1))[0],0))[::-1]or'0' Any takers ? ;-) George -- http://mail.python.org/mailman/listinfo/python-list

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-27 Thread George Sakkis
ow how to program; teaching them DSA, python, **and** stuff like the > visitor pattern seems impossible. "Beginning Python - From Novice to Professional" is approachable and great as a textbook IMO. As a bonus, it covers up to python 2.4, which very few existing books do. George -- http://mail.python.org/mailman/listinfo/python-list

Re: pythonol

2006-09-27 Thread George Sakkis
gs, ints, longs, or tuples > -- > Does anything stand out which might be fixable? Search and replace all "EXPAND+FILL" with "EXPAND|FILL" (vertical bar instead of plus sign). This solves the specific error, though I've no idea what else may be broken. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Top and Bottom Values [PEP: 326]

2006-09-27 Thread George Sakkis
le purpose of being used in comparisons. No numeric behavior was implied, i.e. Smallest and Largest are not negative and positive infinity in the math sense of the word. So I guess the "easily implemented" refers to this case alone. George -- http://mail.python.org/mailman/listinfo/python-list

Re: A critique of cgi.escape

2006-09-26 Thread George Sakkis
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, George > Sakkis wrote: > > > Lawrence D'Oliveiro wrote: > > > >> Fredrik Lundh wrote: > >> > you're not the designer... > >> > >> I don't have to be.

Re: Makin search on the other site and getting data and writing in xml

2006-09-26 Thread George Sakkis
risk to be caught (with whatever consequences this implies). - Yes, you *might* be able to get away with it (at least for some time) running in stealth mode. - No, people here are not willing to help you go down this road, you're on your own. Hope this helps, George -- http://mail.python.org/mailman/listinfo/python-list

Re: iterator question

2006-09-26 Thread George Sakkis
Steve Holden wrote: > George Sakkis wrote: > > Neil Cerutti wrote: > > > > > >>On 2006-09-26, Neal Becker <[EMAIL PROTECTED]> wrote: > >> > >>>Any suggestions for transforming the sequence: > >>> > >>>[1, 2, 3, 4...

Re: iterator question

2006-09-26 Thread George Sakkis
t; return izip(*[chain(iterable, repeat(padvalue, n-1))]*n) That's not quite the same as the previous suggestions; if the last tuple is shorter than n, it pads the last tuple with padvalue. The OP didn't mention if he wants that or he'd rather have a shorter last tuple. George -- http://mail.python.org/mailman/listinfo/python-list

Re: iterator question

2006-09-26 Thread George Sakkis
erable) while True: window = tuple(islice(it,size)) if not window: break yield window George -- http://mail.python.org/mailman/listinfo/python-list

Re: identifying new not inherited methods

2006-09-26 Thread George Sakkis
[EMAIL PROTECTED] wrote: > George Sakkis wrote: > [...] > > I'd rather have it as a function, not attached to a specific class: > > > > Thanks a lot George, that was what I was looking for. Got to > understand/appreciate inspect more. > Of course it works as a

Re: identifying new not inherited methods

2006-09-26 Thread George Sakkis
n, not attached to a specific class: from inspect import getmembers, ismethod def listMethods(obj): d = obj.__class__.__dict__ return [name for name,_ in getmembers(obj,ismethod) if name in d] HTH, George -- http://mail.python.org/mailman/listinfo/python-list

Re: ultra newbie question (don't laugh)

2006-09-26 Thread George Sakkis
ties. Or, if you're comfortable studying on your own, you could start with a book or two that focus on software design and architecture, rather than language details and small programming recipes. I can't think of any specific title to suggest off the top of my head but I'm sure you'll get some good suggestions from others if you ask here. George -- http://mail.python.org/mailman/listinfo/python-list

Re: does anybody earn a living programming in python?

2006-09-26 Thread George Sakkis
x27;t really qualify, for any reasonable definition of "senior". George -- http://mail.python.org/mailman/listinfo/python-list

Re: A critique of cgi.escape

2006-09-26 Thread George Sakkis
Lawrence D'Oliveiro wrote: > Fredrik Lundh wrote: > > you're not the designer... > > I don't have to be. Whoever the designer was, they had not properly thought > through the uses of this function. That's quite obvious already, to anybody > who works with HTML a lot. So the function is broken and

Re: What is the best way to "get" a web page?

2006-09-23 Thread George Sakkis
relevant extract from the main page: You may either hardcode the urls of the css files, or parse the page, extract the css links and normalize them to absolute urls. The first is simpler but the second is more robust, in case a new css is added or an existing one is renamed or remov

Re: returning None instead of value: how to fix?

2006-09-23 Thread George Sakkis
7;s not just me that thinks this way. Best, George -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Beautiful Soup to entangle bookmarks.html

2006-09-21 Thread George Sakkis
robin wrote: > "George Sakkis" <[EMAIL PROTECTED]> wrote: > > >Here's what I came up with: > >http://rafb.net/paste/results/G91EAo70.html. Tested only on my > >bookmarks; see if it works for you. > > That URL is dead. Got another? Yeap, try this

Strange behaviour of 'is'

2006-09-21 Thread Fijoy George
Hi all, I am a bit perplexed by the following behaviour of the 'is' comparator >>> x = 2. >>> x is 2. False >>> y = [2., 2.] >>> y[0] is y[1] True My understanding was that every literal is a constructure of an object. Thus, the '2.' in 'x = 2.' and the '2.' in 'x is 2.' are different objects.

Re: newbe's re question

2006-09-19 Thread George Sakkis
ample code before typing this python-like pseudocode ? George -- http://mail.python.org/mailman/listinfo/python-list

Re: new string method in 2.5 (partition)

2006-09-19 Thread George Sakkis
Bruno Desthuilliers wrote: > I must definitively be dumb, but so far I fail to see how it's better > than split and rsplit: I fail to see it too. What's the point of returning the separator since the caller passes it anyway* ? George * unless the separator can be a regex, but

Re: value exists (newbie question)

2006-09-19 Thread George Sakkis
the syntax to do that. (not asking anyone to write my > code, just looking for a pointer) > > Thanks Hint: dict.get() takes an optional second argument. George PS: To make a new thread, don't hit "reply" on an existing thread and change the subject. Just make a new thread.. duh. -- http://mail.python.org/mailman/listinfo/python-list

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-19 Thread George Sakkis
e: # default object msg If you insist though that you'd rather not use functions but only methods, tough luck; you're better off with Ruby. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Curious issue with simple code

2006-09-19 Thread George Sakkis
les/python/path/). Your example could be rewritten simply as: from path import path for html_file in path(start_dir).walkfiles('*.html'): print 'html file found!' George -- http://mail.python.org/mailman/listinfo/python-list

Re: Code Golf Challenge : 1,000 Digits Of Pi

2006-09-18 Thread George Sakkis
Calvin Spealman wrote: > Just once, I would like to see a programming contest that was judged > on the quality of your code, not the number of bytes you managed to > incomprehensively hack it down to. Unfortunately, quality is not as easy to judge as number of bytes. Such contest would be as craz

Re: something for itertools

2006-09-15 Thread George Sakkis
) > > should turn into > > a = ( 1, 2, 3, None, None ) > b = ( 10, 20, None, None, None ) > c = ( 'x', 'y', 'z', 'e', 'f' ) > > Of course with some len( ) calls and loops this can be solved but > something tells me t

Re: Coding Nested Loops

2006-09-15 Thread George Sakkis
in izip(*columns): > print row > > Now that is a nice occasion to get acquainted with the itertools module... Wow, that's the most comprehensive example of itertools (ab)use I have seen! Awesome! George -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I converted a null (0) terminated string to a Python string?

2006-09-15 Thread George Sakkis
Michael wrote: > Robert, > > Thanks to you and everyone else for the help. The "s.split('\x00', > 1)[0] " solved the problem. And a probably faster version: s[:s.index('\x00')] George -- http://mail.python.org/mailman/listinfo/python-list

Re: Check if variable is an instance of a File object

2006-09-15 Thread George Sakkis
t = StringIO(text) for line in text: # do something George -- http://mail.python.org/mailman/listinfo/python-list

Re: Algorithm Question

2006-09-14 Thread George Sakkis
sired property: the intersections of the subsets should be as small as possible, or in other words the subsets should be as distinct as possible. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Algorithm Question

2006-09-14 Thread George Sakkis
es each covering 1/4*R with zero overlap ? George -- http://mail.python.org/mailman/listinfo/python-list

Re: FtpUtils Progress Bar

2006-09-13 Thread George Sakkis
st dots going across the screen would be better > than nothing. > > Does anyone have an example on how to show the progress of the > upload/download when using ftputil? You'll probably have more luck asking at http://codespeak.net/mailman/listinfo/ftputil. George -- http://mail.python.org/mailman/listinfo/python-list

Re: stock quotes

2006-09-13 Thread George Sakkis
quest the certain data need. Does anyone > know how to do this? I would really appreciate it. Thanks. This will get you started: http://www.crummy.com/software/BeautifulSoup/ George -- http://mail.python.org/mailman/listinfo/python-list

Re: When is it a pointer (aka reference) - when is it a copy?

2006-09-13 Thread George Sakkis
n't tell in advance what "x[0] = 2" will do without knowing the type of x. A binding OTOH like "x=2" has always the same semantics: make the name "x" refer to the object "2". Similarly to "x[0] = 2", something like "x.foo = 2" looks like an assignment but it's again syntactic sugar for a (different) method call: x.__setattr__('foo',2). All the above about __setitem__ hold for __setattr__ too. HTH, George -- http://mail.python.org/mailman/listinfo/python-list

Re: Dice gen and analyser script for RPGs: comments sought

2006-09-13 Thread George Sakkis
space between *every* operator in expressions, group them based on precedence. E.g. instead of "(n * sigmaSq - sigma * sigma) / (n * n)", I read it easier as "(n*sigmaSq - sigma*sigma) / (n*n). HTH, George -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing String, Dictionary Lookups, Writing to Database Table

2006-09-11 Thread George Sakkis
cription it's not really clear what's going on. Also, please post working code; the snippets you posted were out of context (what is row?) and not always correct syntactically (split_line(2:4)). George -- http://mail.python.org/mailman/listinfo/python-list

Re: efficient text file search.

2006-09-11 Thread George Sakkis
file ? The replies so far seem to imply so and in this case I doubt that you can do anything more efficient. OTOH, if the same file is to be searched repeatedly for different strings, an appropriate indexing scheme can speed things up considerably on average. George -- http://mail.python.org/mailman/listinfo/python-list

Re: CPython keeps on getting faster

2006-09-10 Thread George Sakkis
u5)] Python2.5: 2.5c1 (r25c1:51305, Aug 18 2006, 19:18:03) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] IronPython: 1.0.2444 on .NET 2.0.50727.42 Mono JIT compiler version 1.1.17 TLS: normal GC:Included Boehm (with typed GC) SIGSEGV: normal Disabled: none George -- http://mail.python.org/mailman/listinfo/python-list

Re: Refactoring Dilemma

2006-09-10 Thread George Sakkis
m__ > self = modproxy() > def call_with_module(*args,**kwargs): > return func(self,*args,**kwargs) > call_with_module.func_name = func.func_name > return call_with_module > > @modmethod > def MyRoutine(self): > self.var = 1 > > MyRoutine() > print var This looks quite hackish, both the implementation and the usage; most people would get confused when they didn't find var's assignment at global scope. I prefer the the simple global statements if they aren't that many, otherwise the assignment of the module to self is also fine. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Refactoring Dilemma

2006-09-10 Thread George Sakkis
> def MyRoutine(): > global var > var = 1 > > MyRoutine() > print var > > > # --- Module 2.py > # 'Self' module processing > import sys > var = 0 > self = sys.modules[__name__] > > def MyRoutine(): > self.var = 1 > > MyRoutine() > print var What's wrong with def MyRoutine(): return 1 var = MyRoutine() ? George -- http://mail.python.org/mailman/listinfo/python-list

Re: Function metadata (like Java annotations) in Python

2006-09-10 Thread George Sakkis
oripel wrote: > Thanks Paddy - you're showing normal use of function attributes. > They're still hidden when wrapped by an uncooperative decorator. The decorator module may be helpful in defining cooperative decorators: http://www.phyast.pitt.edu/~micheles/python/documentat

Re: SQLwaterheadretard3 (Was: Is it just me, or is Sqlite3 goofy?)

2006-09-08 Thread George Sakkis
ne reasons (complexity,portability,performance), so you'd better not go down this road. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Beautiful Soup to entangle bookmarks.html

2006-09-08 Thread George Sakkis
Francach wrote: > Hi George, > > Firefox lets you group the bookmarks along with other information into > directories and sub-directories. Firefox uses header tags for this > purpose. I'd like to get this grouping information out aswell. > > Regards, > Martin. Her

Re: Negation in regular expressions

2006-09-08 Thread George Sakkis
Paddy wrote: > George Sakkis wrote: > > It's always striked me as odd that you can express negation of a single > > character in regexps, but not any more complex expression. Is there a > > general way around this shortcoming ? Here's an example to illustrate a >

Re: Using Beautiful Soup to entangle bookmarks.html

2006-09-08 Thread George Sakkis
Francach wrote: > George Sakkis wrote: > > Francach wrote: > > > Hi, > > > > > > I'm trying to use the Beautiful Soup package to parse through the > > > "bookmarks.html" file which Firefox exports all your bookmarks into. > > >

Re: Using Beautiful Soup to entangle bookmarks.html

2006-09-07 Thread George Sakkis
ls. Has anybody got a couple of longer examples using > Beautiful Soup I could play around with? > > Thanks, > Martin. from BeautifulSoup import BeautifulSoup urls = [tag['href'] for tag in BeautifulSoup(open('bookmarks.html')).findAll('a')] Regards, George -- http://mail.python.org/mailman/listinfo/python-list

Negation in regular expressions

2006-09-07 Thread George Sakkis
#x27;m aware of re.split, but that's not the point; this is just an example. Besides re.split returns a list, not an iterator] 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

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
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: 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: 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: 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: 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: 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: 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: 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: 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: 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
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: 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: 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

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 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: 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: 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: 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: 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-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: 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: [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 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: 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-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-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: 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: 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

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: 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

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: 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
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: 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

(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: 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

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: 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-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: 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: 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: 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: 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: 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: 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.

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: 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

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: 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

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