Re: read web page that requires javascript on client

2009-03-19 Thread James Matthews
You can try and use wxpythons broswer to execute the javascript On Wed, Mar 18, 2009 at 10:01 PM, Greg wrote: > Hello all, I've been trying to find a way to fetch and read a web page > that requires javascript on the client side and it seems impossible. > I've read several threads in this group

Re: can someone help me (again) stuck on ' hands on python'

2009-03-19 Thread Rhodri James
of showing you what's going on! -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Preparing teaching materials

2009-03-21 Thread Rhodri James
-as-function is one of the things that will throw beginners very badly indeed if your handouts and computers don't make the same assumptions! -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: file open fails.

2009-03-24 Thread Wes James
On Tue, Mar 24, 2009 at 4:04 PM, Scott David Daniels wrote: > Atul. wrote: > In your case, '\r' is a return (a single character), not two > characters long. I think its sad that 'C:\Thesis' doesn't cause > an error because there is no such character as '\T', but I am > probably excessively peda

Re: file open fails.

2009-03-24 Thread Wes James
On Tue, Mar 24, 2009 at 4:32 PM, Wes James wrote: > On Tue, Mar 24, 2009 at 4:04 PM, Scott David Daniels > wrote: >> Atul. wrote: > > > >> In your case, '\r' is a return (a single character), not two >> characters long. I think its sad that 'C:\Th

Re: file open fails.

2009-03-24 Thread Rhodri James
On Tue, 24 Mar 2009 22:48:30 -, Wes James wrote: On Tue, Mar 24, 2009 at 4:32 PM, Wes James wrote: \T might mean the same thing as \t (tab), but I thought it would be different... I guess not: http://docs.python.org/reference/lexical_analysis.html#string-literals Wonder why when I

Re: Introducing Python to others

2009-03-26 Thread Rhodri James
ou've shown them exceptions, show them context managers briefly. It's amazing how much they can simplify some types of exception handling. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Odd behavior regarding a list

2009-03-26 Thread Rhodri James
/use/alter this." Then don't call/use/alter it from outside the class. You don't really need anything stronger than convention unless for some odd reason you don't trust yourself. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing wx.TextCtrl after refactoring

2009-03-27 Thread Rhodri James
thod, once the widgets have been created and all the dust has settled, if you add the line: self.__setattr__(txtctrl_path, self.txtctrl) it will do exactly what you're after! -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing wx.TextCtrl after refactoring

2009-03-27 Thread Rhodri James
On Sat, 28 Mar 2009 00:51:04 -, Rhodri James wrote: On Fri, 27 Mar 2009 21:51:19 -, alex wrote: Hi all I am working on a Dialog window for a gui in wxPython and started refactoring it, below code is a simplified version of it. "def createInput1" should create a stat

Re: Accessing wx.TextCtrl after refactoring

2009-03-28 Thread Rhodri James
txtctrl_path, not self.txtctrl_path, by the way!). So what box1Labels needs to return is (("Input Path:", "Browse", self.BrowseInDlg, "txtctrl_inpath"), ... -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: How to access object created in Main?

2009-03-29 Thread Rhodri James
truct implies that you expect your file to be included as a module at some time in the future. When that time comes, having your menu structure rely on module globals that will not exist (because the "mesg = Label()" doesn't get run) will cause your program to explode messily in a de

Re: i have to change default tab length in pydev

2009-03-29 Thread Rhodri James
e starting with a tab or something like that. Running with "python -t" will warn you about this sort of thing. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter questions: behavior of StringVar, etc

2009-03-29 Thread Rhodri James
e. In this case, your choice of wording (the nearest thing we have in print to "tone of voice") did not inspire me to go digging around in source that you have just as easy access to, in order to answer questions that I'm not particularly interested in. -- Rhodri James *-* Wildebees

Re: if there is a return type of a method definition like java does

2009-03-29 Thread Rhodri James
g the return type of a function or method affects decision speed in calling it at all. I suppose it might allow some optimisation of subsequent operations on the result, but given the dynamic typing nature of Python I can't see that being worth the considerable effort. -- Rhodri James *-* Wildebee

Re: dict view to list

2009-03-29 Thread Rhodri James
the cat', although the late is mostly unattested-to these days. Erm, this isn't what I understand by 'nesting' in language, which has more to do with how many subclauses, like these, you can cope with being active at any one time before you forgot what the sentence started off being about :-) -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter questions: behavior of StringVar, etc

2009-03-29 Thread Rhodri James
On Mon, 30 Mar 2009 00:13:46 +0100, Alan G Isaac wrote: Since you did not address my question about the nuance of "magic", I'm inclined to treat you as a "no" vote. And you'd be wrong. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.pyth

Re: tkinter questions: behavior of StringVar, etc

2009-03-29 Thread Rhodri James
ost of what we're doing), duck typing does allow you to make mistakes about what's actually happening. That's the whole point of it. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread Rhodri James
k you need to get away from the idea that your register is a number. It isn't, not really; it's a sequence of bits which happens to have a number as a conveniently usable form. You ought to think about *not* subclassing from long, but instead overloading whatever arithmetic operators y

Re: i have to change default tab length in pydev

2009-03-30 Thread Rhodri James
t *exactly* (including the *whole* traceback) is Python saying to you? -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Thoughts on language-level configuration support?

2009-03-30 Thread Rhodri James
n the code and a lot less self-documenting because it's spread out all over the place. It also has the major disadvantage from my point of view of requiring Python to do magic in the background to figure out just what is being configured. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Stripping non-numbers from a file parse without nested lists?

2009-03-31 Thread Rhodri James
"dip" not in word: dip_n_dir.append(word.split("/", 1)) is marginally shorter, and has the virtue of making it harder to use unrelated dip and dir values together. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Thoughts on language-level configuration support?

2009-03-31 Thread Rhodri James
On Tue, 31 Mar 2009 07:06:50 +0100, jfager wrote: On Mar 30, 9:31 pm, "Rhodri James" wrote: On Mon, 30 Mar 2009 16:59:12 +0100, jfager wrote: > It's the configuration problem.  Right now you would use something > like ConfigParser or optparse to populate some configur

Re: python for loop

2009-03-31 Thread Rhodri James
ce you spend most of your time iterating through lists instead. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: python for loop

2009-03-31 Thread Rhodri James
On Wed, 01 Apr 2009 04:15:00 +0100, Lada Kugis wrote: On Wed, 01 Apr 2009 03:59:36 +0100, "Rhodri James" wrote: Two opportunities to forget to lie about how big your array is It is rank 3, meaning a33 is the last element. I don't see how any alternative can be simpler t

Re: python for loop

2009-03-31 Thread Rhodri James
offsets in nonintuitive ways more often than you might hope. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: how to handle/generate pcap file

2009-04-01 Thread Rhodri James
bsite suggests that yes, it can. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: python for loop

2009-04-01 Thread Rhodri James
too late to influence our fundamentally latinate language for ordinal numbers. (In other words, don't go thinking that there's anything logical about natural language :-) -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Thoughts on language-level configuration support?

2009-04-01 Thread Rhodri James
On Wed, 01 Apr 2009 05:15:19 +0100, jfager wrote: On Mar 31, 10:44 pm, "Rhodri James" wrote: [...] What restrictions can be put on the value you get back? What can the help system say about this, or do we have to go back to doing all that by hand? Now translate all those ques

Re: Introducing Python to others

2009-04-02 Thread Rhodri James
On Thu, 02 Apr 2009 17:02:30 +0100, David C. Ullrich wrote: Sometime I gotta get around to actually learning this 2.x stuff. Thought I had an idea how 1.x worked... 3.x may come as a bit of a surprise :-) -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org

Re: Iteratoration question

2009-04-02 Thread Rhodri James
rator.next() 1 iterator.next() 2 iterator.next() 3 Here you already have a single instance, and you don't throw it away after incrementing its counter. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Iteratoration question

2009-04-02 Thread Rhodri James
uence I refer you back to Andrew's answer. Your "value" object isn't an iterator and doesn't obey the Iteration protocol. Expecting to be able to iterate over it is a tad optimistic. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: pygame and socket.recv

2009-04-02 Thread Rhodri James
time, but it still leaves me with the problem of retroactive model updates. You are dealing with a network. Errors *will* happen. Plan for them from the start, or they will turn your design into spaghetti :-) -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org

Re: Python Goes Mercurial

2009-04-02 Thread Rhodri James
On Thu, 02 Apr 2009 19:24:49 +0100, Kay Schluehr wrote: Good to know. Uninstalling a major feature that enhances usability just to make it usable isn't much less ironic though. Meh. Use the command line like God intended. -- Rhodri James *-* Wildebeeste Herder to the Masses --

Re: Iteratoration question

2009-04-02 Thread Rhodri James
turn calls a.__iter__(), to get an iterator. Once it's got, "for" calls next() on the iterator each time round the loop. Very approximately, that little for-loop translates to: a = [1,2,3,4] i = iter(a) try: while True: x = i.next() print x except StopIteratio

Re: python needs leaning stuff from other language

2009-04-02 Thread Rhodri James
oup. I see no reason that a list shouldn't have a .clear method. This I wouldn't disagree with, though I imagine it will increase the frequency of complaints from people who haven't understood Python's assignment model. -- Rhodri James *-* Wildebeeste Herder to the Masse

Re: extract Infobox contents

2009-04-06 Thread Rhodri James
regular expressions rather than 'startswith', but I leave that as an exercise for the reader :-) -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: group several methods under a attribute

2009-04-06 Thread Rhodri James
f do_something(self): print "Here's A doing something" def __init__(self): self.A = ClsB.ClsA() def do_something(self): print "Here's B doing something" b = ClsB() b.do_something() b.A.do_something() -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: extract Infobox contents

2009-04-07 Thread Rhodri James
On Tue, 07 Apr 2009 12:46:18 +0100, J. Clifford Dyer wrote: On Mon, 2009-04-06 at 23:41 +0100, Rhodri James wrote: On Mon, 06 Apr 2009 23:12:14 +0100, Anish Chapagain wrote: > Hi, > I was trying to extract wikipedia Infobox contents which is in format > like given below, from t

python twitter

2009-04-15 Thread Wes James
Anyone know if there is a twit for python? I did http://twitter.com/python, but nope on that I was looking for twit py announcements, etc... thx, -wj -- http://mail.python.org/mailman/listinfo/python-list

Re: need to start a new project , can python do all that ?

2009-04-15 Thread Rhodri James
uthorities otherwise (depending on what country you're in) you could end up on the wrong end of some very expensive law-suits without actually having done anything wrong. Check first. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Re: How to check all elements of a list are same or different

2009-04-15 Thread Rhodri James
versus equality too. my_list = [ 1024 ] my_list.append(1024) # Defeat the interpreter's cunningness ids = map(lambda x: id(x), ml) ids [9864656, 9864704] sum(ids)/len(ids) == ids[0] False -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: reading arguments in python script when passed from URL

2009-04-15 Thread Rhodri James
tead of a semi-colon, and import sys first, then yes. Your "standalone client" however makes no sense to me at all. How *exactly* are you invoking your Python script? -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: What IDE support python 3.0.1 ?

2009-04-15 Thread Rhodri James
from the command line. That said, IDLE (which comes packaged with Python) is a perfectly decent little IDE. It's surprising how little you really need given the flexibility and immediacy of working with Python. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: binary file compare...

2009-04-16 Thread Rhodri James
away from it. There's no point in using something that guarantees a non-zero chance of corrupting your data. Why are you advocating a solution to the OP's problem that is more computationally expensive than a simple byte-by-byte comparison and doesn't guarantee to give the correct

Re: Suggestions wanted on Tkinter problem

2009-04-16 Thread Rhodri James
And what, pray, did the traceback say? What was |c| before you started that last loop of Radiobutton creation? -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: getter and setter and list appends

2009-04-20 Thread Rhodri James
. Please don't top-post, it really doesn't help legibility. 2. This is an artist's impression of a photograph of a greek translation of your code. I wouldn't use it as a reference for anything except how to terminally confuse yourself. -- Rhodri James *-* Wildebeeste Herder t

Re: Passing all extra commandline arguments to python program, Optparse raises exception

2009-04-20 Thread Rhodri James
ents: * either "--" or "-" can be option arguments * bare "--" (if not the argument to some option): halt command-line processing and discard the "--" * bare "-" (if not the argument to some option): halt command-line processing but keep the "-" (append it to parser.largs) """ -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a programming language that is combination of PythonandBasic?

2009-04-20 Thread Rhodri James
r your code to take advantage of sets of instructions that can be executed in parallel, shield you from the fact that the results of some instructions take several cycles to arrive, and do some wonderfully bizarre loop optimisations. I have written hand-optimised assembly for those chips, but it's

Re: Best Python Web Framework ?

2009-04-21 Thread Wes James
On Tue, Apr 21, 2009 at 12:46 PM, SKYLAB wrote: > Greetings.. > > First , my english is not good . > > I heard that was written in python ( Youtube Programming Language : > PYTHON :S ) Correct ? > > That's not correct ? Then youtube is PHP application ? > > That's correct ; Which python web framew

Re: Accessing items in nested tuples

2009-04-22 Thread Rhodri James
]. This generalises. You can use whatever object data[0] gives you exactly like any other use of that type of object. If it gives you a dictionary, you can write: data[0]['spam'] = "moist and delicious" and so on. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: python list handling and Lisp list handling

2009-04-24 Thread Rhodri James
t slicing is another copy operation, so you're going to run into exactly the same set of problems. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Lisp mentality vs. Python mentality

2009-04-25 Thread Rhodri James
ng algorithms, which are rarely going to reuse standalone code. They still need to deal with case-insensitive strings, though. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: python list handling and Lisp list handling

2009-04-25 Thread Rhodri James
" is a 'yes'. Any disagreement? I'm probably being rather thick, but aren't you saying here "Assuming that the answer to this question is 'yes', is the answer to this question 'yes'?" -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: getting linux distro used...

2009-04-27 Thread James Matthews
You can always pipe the information for the command line. On Mon, Apr 27, 2009 at 8:59 AM, David Lyon wrote: > > perphaps platform.uname()? > > On Sun, 26 Apr 2009 22:35:29 -0700 (PDT), deostroll > wrote: > > Hi, > > > > I just found that you could use platform.system() to get the > > underlying

Re: extracting duplicates from CSV file by specific fields

2009-04-28 Thread Rhodri James
reject_this(row) else: seen_in_field0.add(row[0]) seen_in_field3.add(row[3]) accept_this(row) This assumes that you don't record fields 0 and 3 for lines that are rejected, i.e. if the file is: 'aaa.111', 'T100', 'pn123', 'sn111' 'aaa.111', 'T200', 'pn123', 'sn222' 'aaa.222', 'T300', 'pn123', 'sn222' you want to keep: 'aaa.111', 'T100', 'pn123', 'sn111' 'aaa.222', 'T300', 'pn123', 'sn222' -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Why bool( object )?

2009-04-28 Thread Rhodri James
ng no carrots. Not if you need onions but not carrots it isn't! -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: regular expression, unicode

2009-04-29 Thread Rhodri James
n position 0-1: invalid data What on earth makes you think this is anything to do with the regular expression? It looks more like it's complaining about what you've typed in at the console. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Help! Can't get program to run.

2009-05-02 Thread Rhodri James
with the command line that you've already succeeded with! -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Help inside Python

2009-05-03 Thread Rhodri James
the brackets. Thus: help(123) tells you all about Python's integers, while l = [1, 2, 3] help(l) tells you about lists. The only gotcha is that if you try getting help on a string object, it thinks that you're trying to look up a keyword. In other words: s = "for" h

Re: if statement, with function inside it: if (t = Test()) == True:

2009-05-04 Thread Rhodri James
onstructed arrows like "<=" or "<-" collide with different comparators. About all that's left that even vaguely implies assignment is "~", and it's no better. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: call function of class instance with no assigned name?

2009-05-05 Thread Rhodri James
'that' : do_that, 'the other' : do_the_other } def update(self, cmd): try: DoSomething._CMD_DICT[cmd](self) except KeyError: print "Foul! Foul, I say!" END CODE<<<< To be honest, the getat

Re: Self function

2009-05-05 Thread Rhodri James
orry, but while I'm mildly positive towards the proposal (and more so towards Aaron's decorator), I don't buy this argument at all. What is broken about your editor's global search-and-replace function that makes it "usually useless" for making these name changes? --

Re: Parsing text

2009-05-06 Thread Rhodri James
#x27;t going to produce well-formed XML. else: print "No scene number" Nor will this. m = ' Missing close double quotes after 'scene'. m += scene m += '<\div>' print m I'm seeing nothing here that should p

Re: Self function

2009-05-06 Thread Rhodri James
On Wed, 06 May 2009 04:59:59 +0100, Gabriel Genellina wrote: En Tue, 05 May 2009 22:35:08 -0300, Rhodri James escribió: On Tue, 05 May 2009 21:43:16 +0100, wrote: wolfram.hinde...: It is easy to change all references of the function name, except for those in the function body itself

Re: Self function

2009-05-06 Thread Rhodri James
On Wed, 06 May 2009 23:33:20 +0100, Luis Alberto Zarrabeitia Gomez wrote: Quoting Rhodri James : So the answer to my question would be "nothing"? Indeed, there is nothing broken with the search and replace feature of his editor. When he is copying a non-recursive funct

Re: regular expression for getting content between parentheses

2009-05-07 Thread Rhodri James
lue4 You can't get around that with regular expressions, you'll have to parse your way through the input string counting open and close parentheses as you go. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: ISO exemplary Python scripts

2009-05-10 Thread Rhodri James
s "optparse" is your friend. Possibly also your enemy if you don't want to do things its way, but it does at least make parameter handling in a user-friendly way easy. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: There may be a much better way to manage artillery.

2009-05-10 Thread Rhodri James
What framework are you writing your game in? Pygame has facilities for handling this sort of thing fairly straightforwardly. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrapping comments

2009-05-10 Thread Rhodri James
to re-learn or configure that is just sick) What on earth are you talking about? '#' has its own key on a UK layout (shared with '~', but you know what I mean), just to the left of the RETURN key. Emacs is my editor of choice, and I've never once come across anything lik

Re: There may be a much better way to manage artillery.

2009-05-11 Thread Rhodri James
On Mon, 11 May 2009 22:59:43 +0100, Tobiah wrote: On Mon, 11 May 2009 00:48:25 +0100, Rhodri James wrote: On Mon, 11 May 2009 00:06:34 +0100, Tobiah wrote: [Snippety snip] I wanted the bullets to be responsible for destroying themselves, but a little Googling brought me to points about

Re: Wrapping comments

2009-05-11 Thread Rhodri James
On Mon, 11 May 2009 08:39:48 +0100, Tobias Weber wrote: In article , "Rhodri James" wrote: What on earth are you talking about? '#' has its own key on a UK layout Not on Apple keyboards, and the emacs release in question is Mac only. My commiserations. That was a

Re: n00b question: Possible to pass lists to a Template class?

2009-05-13 Thread Rhodri James
nto the template with '%s' substitution, so you'll just get a string representation of your dictionary. You could play around with defining your own custom Template class, but it's probably not worth the effort. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Odd list behavior

2009-05-13 Thread Rhodri James
=== Take a look at the split() command. I think you will find you need one var on the left side for each piece on the right. Given that he's immediately indexing the split results, that's irrelevant. There's no point in even guessing with out the traceback. -- Rhodri James *-*

Re: When *don't* I use 'self' in classes?

2009-05-13 Thread Rhodri James
o it would vanish when __init__ returned just like any other local variable. Making it an attribute keeps it around (attached to just that one instance of the class) so that you can use it later. In general, don't make something an attribute if you know you're never going to reuse it. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Odd list behavior

2009-05-14 Thread Rhodri James
On Thu, 14 May 2009 17:49:33 +0100, norseman wrote: Rhodri James wrote: On Wed, 13 May 2009 23:08:26 +0100, norseman wrote: Evan Kroske wrote: I'm working on a simple file processing utility, and I encountered a weird error. If I try to get the first element of a list I'm

Re: How to catch str exception?

2009-05-15 Thread Rhodri James
writers nicely to fix the problem. 3) Fix it yourself. The beauty of Python is that 3) isn't all that hard! -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing Strings in Enclosed in Curly Braces

2009-05-15 Thread Rhodri James
uot; Can you have nested braces, and what are you supposed to do with them: x = "{Some text to parse {as well as an aside} and so on}" Parsing is not an entirely trivial subject, particularly when users can futz about with the strings you're parsing. That's one reason there

Re: python

2009-05-15 Thread Rhodri James
tty complete recipe already. If you can't see how to do it, re-read the tutorial. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Concurrency Email List

2009-05-17 Thread James Matthews
I second this. Google groups are annoying! Just request that it be added to python.org James On Sun, May 17, 2009 at 12:22 PM, David M. Besonen wrote: > On 5/16/2009 5:26 PM, Aahz wrote: > > > On Sat, May 16, 2009, Pete wrote: > > > >> python-concurre...@googlegro

Re: Your Favorite Python Book

2009-05-17 Thread James Matthews
For me it's any book on Django, Core Python 2nd Edition (which I will buy if updated) and Python Power. On Fri, May 15, 2009 at 7:05 PM, Lou Pecora wrote: > In article > , > Mike Driscoll wrote: > > > On May 11, 4:45 pm, Chris Rebert wrote: > > > > > > > I like "Python in a Nutshell" as a re

Re: Generic web parser

2009-05-17 Thread James Matthews
I don't see the issue of using urllib and Sqllite for everything you mention here. On Sat, May 16, 2009 at 4:18 PM, S.Selvam wrote: > Hi all, > > I have to design web parser which will visit the given list of websites and > need to fetch a particular set of details. > It has to be so generic tha

Fwd: [python-win32] Fwd: Autosizing column widths in Excel using win32com.client ?

2009-05-17 Thread James Matthews
-- Forwarded message -- From: Tim Golden Date: Sun, May 17, 2009 at 1:00 PM Subject: Re: [python-win32] Fwd: Autosizing column widths in Excel using win32com.client ? To: Cc: Python-Win32 List James Matthews wrote: > -- Forwarded message -- > From: >

Re: A newbie question about some code

2009-05-18 Thread Rhodri James
-- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Advanced Python books?

2009-05-19 Thread James Matthews
I found Core Python Programming to cater to my needs as a Pro book. On Tue, May 19, 2009 at 6:48 PM, Thomas Guettler wrote: > kj schrieb: > > I have read a couple of "learn Python"-type books, and now I'm > > looking for some more advanced books on Python, > ... > > Basically I'm looking for a b

Re: Is there a better way to chose a slice of a list?

2009-05-19 Thread Rhodri James
ion. The more elegant approach is not to try to index a list with strings, but to keep you "day" data in numeric form and use that to slice with, and for that enums will greatly help you keep things clear. However, whether that's worth doing or not depends on the bigger pictur

Re: How to get Form values in Python code and Send Email

2009-05-20 Thread James Matthews
Why don't you use Django? If you get the form information from Django you can send an email using the send_mail (or even if you don't you can still import the function. On Wed, May 20, 2009 at 8:52 AM, Kalyan Chakravarthy < [email protected]> wrote: > Hi All, > > I have one doubt,

Re: URGENT! Changing IE PAC Settings with Python

2009-05-20 Thread James Matthews
HI forwarded it to the Python Win32 list On Thu, May 21, 2009 at 12:11 AM, Tim Golden wrote: > K-Dawg wrote: > >> Thanks for any response. I am in a crisis where one of our networking >> guys >> moved where our PAC file is housed. There was a group policy set in >> Active >> Directory that set

Re: A list with periodic boundary conditions

2009-05-21 Thread Rhodri James
your original list, but I can't off-hand think of a view method that won't. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: defaultdict's bug or feature?

2009-05-21 Thread Rhodri James
;t. It's a bug, or just a feature? Feature. You're blaming 'get' for doing exactly what it said it would, both in returning None and not gratuitously altering the dictionary. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: ffmpeg and python big problem

2009-05-21 Thread Rhodri James
images from your webcam in a file already, I don't see why you aren't using ffmpeg directly. This program is for my friend and he needs it ready preety quick. Aha. Ahahahahahahahaha. Ahem. Sorry, but "pretty quick" and "ffmeg" don't go together well in my exp

Re: Is there a better way to chose a slice of a list?

2009-05-21 Thread Rhodri James
y because lists aren't designed to be indexed by value. Worse, if you were doing this a lot (as you imply) then it's going to be horribly inefficient, since you're doing an extra two (or more) O(n) searches for every row. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: finding repeated data sequences in a column

2009-05-21 Thread Rhodri James
from the iterator toolkit that make this a lot simpler. If you don't get what's going on here, I don't blame you. I just deleted my attempt to explain it because it was confusing me :-) Reading the descriptions of izip and groupby in the standard library documentation should make things clearer. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: When does the escape character work within raw strings?

2009-05-21 Thread Rhodri James
he newline in `s` and replaces it with an 'x'. Note, however, that the string object created by the raw string literal was *two* characters long. It's re.sub (in common with the rest of the re module functions) that chooses to interpret the backslash specially. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding a Par construct to Python?

2009-05-21 Thread Rhodri James
to mention the fact that your inner loops can't now be protected against common code in the outer loop accessing the shared variables. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: defaultdict's bug or feature?

2009-05-21 Thread Rhodri James
different interfaces with two different specs. Why are you expecting them to have the same effect? -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding a Par construct to Python?

2009-05-22 Thread Rhodri James
the end of the PAR. Yes, this does make it very easy for the freshly-enabled careless programmer to introduce deadlocks and never realise it. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: defaultdict's bug or feature?

2009-05-22 Thread Rhodri James
t__(self) in your __init__() function just in case defaultdict needs any setup that you aren't doing (which it does, but you override __missing__() so it never notices that it doesn't have a default_factory). You get away with it here, but it's not a good habit to get into. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

Re: When does the escape character work within raw strings?

2009-05-22 Thread Rhodri James
On Fri, 22 May 2009 15:47:49 +0100, walterbyrd wrote: On May 21, 9:44 pm, "Rhodri James" wrote: Escaping the delimiting quote is the *one* time backslashes have a special meaning in raw string literals. If that were true, then wouldn't r'\b' be treated as two c

Re: ffmpeg and python big problem

2009-05-22 Thread Rhodri James
to make a video from, I could try it. You seem to have emailed me directly, not the list. I've copied this back to the list so Emile can see it too. -- Rhodri James *-* Wildebeeste Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list

<    22   23   24   25   26   27   28   29   30   31   >